Commit Graph

46423 Commits

Author SHA1 Message Date
bors
44e657312e Auto merge of #28198 - alexcrichton:from-raw-mut, r=aturon
Conventionally in C `*mut T` is a transfer of ownership where `*const T` is a
loan, so `*mut T` is likely the more appropriate return type for these
functions. Additionally, this more closely mirrors the APIs on `Box` for this
sort of functionality.

cc #27769
2015-09-09 01:16:54 +00:00
Andrew Paseltiner
37b1a8762b Remove references to removed Valgrind headers 2015-09-08 19:01:26 -04:00
bors
24e54aebd0 Auto merge of #28264 - mneumann:dragonfly_backend_fixes2, r=alexcrichton
Having -L/usr/local/lib in the linking path by default interferes
with an already installed version of Rust during building of Rust.
2015-09-08 22:22:36 +00:00
Andrew Paseltiner
04fff50d51 Add tests for #17001, #21449, #22992, #23208, #23442
Closes #17001
Closes #21449
Closes #22992
Closes #23208
Closes #23442
2015-09-08 16:51:21 -04:00
bors
8115b397f6 Auto merge of #28241 - dhuseby:adding_openbsd_snapshot, r=alexcrichton
@alexcrichton please upload this snapshot when landing:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2015-08-11-1af31d4-openbsd-x86_64-9cae790c4ca19b1b29a048605ce249fe1c20a498.tar.bz2

BTW, this is the snapshot that @semarie has published on his website for use in the OpenBSD port for rust.  Credit goes to him.
2015-09-08 20:34:50 +00:00
Manish Goregaokar
c65d33819c Print correct crate name 2015-09-09 01:22:03 +05:30
Manish Goregaokar
00e70051dc Add test 2015-09-09 00:34:55 +05:30
Manish Goregaokar
a3f05f6ace Fix fixme, add crate check 2015-09-09 00:05:08 +05:30
Manish Goregaokar
b48ffa073f Use 'a different' for trait object mismatches too 2015-09-08 23:50:48 +05:30
Manish Goregaokar
89af15322d Handle trait objects 2015-09-08 23:42:51 +05:30
bors
192c37537b Auto merge of #28173 - alexcrichton:llvm-37, r=brson
This updates the jemalloc and LLVM submodules to the recently released 4.0.0 and 3.7 versions. There's no breakage on the LLVM side of things because we had already been tracking the 3.7 release branch for awhile and no breakage was introduced, and jemalloc apparently is stable enough that nothing broke!
2015-09-08 17:47:23 +00:00
bors
474ad2fc72 Auto merge of #28292 - kud1ing:patch-1, r=steveklabnik
The dates are taken from

  * https://www.rust-lang.org/install.html
  * http://blog.rust-lang.org/2015/06/25/Rust-1.1.html
  * http://blog.rust-lang.org/2015/05/15/Rust-1.0.html
2015-09-08 15:55:28 +00:00
Kang Seonghoon
e98fa0e88f rustdoc: Tweak the main template and CSS for semantic mark-up.
- section.sidebar -> nav.sidebar, also added an unordered list.
- div#help -> aside#help, also added a hidden heading.
- the current crate is now emphasized in the sidebar.

Fixes #16310.
2015-09-09 00:49:23 +09:00
Manish Goregaokar
8b16eb8325 Add note for when a type error comes from similarly named objects from two different crate of the same name (#22750) 2015-09-08 19:48:56 +05:30
Steve Klabnik
ca1a81df23 Fix small sentence about references
Thanks Eric, reported via email
2015-09-08 09:33:53 -04:00
bors
b2b6c6b811 Auto merge of #28287 - llogiq:clippy, r=Manishearth
It's a large number of small improvements to the code, mostly readability-related, but removing closures and replacing `str::to_string()` with `.to_owned()` should also positively affect performance.

r? @Manishearth (once it compiles, of course 😄)
2015-09-08 13:04:22 +00:00
midinastasurazz
3e8038bcab Fix link to hygienic macros on Wikipedia 2015-09-08 14:06:35 +02:00
llogiq
d956e63b1c Reverted for-loop, it messes up type inference 2015-09-08 09:02:04 +02:00
kud1ing
77a2b389f6 Add release days, fixes #28228 2015-09-08 08:29:45 +02:00
llogiq
1c87c3530c Let's see if lifetime elision works in this case 2015-09-08 08:05:59 +02:00
llogiq
658b7eba5b Fixed required type coercion
I'd have thought that the types of the slice::Split would have been inferred, but this appears not to be the case. Reverted this one change.
2015-09-08 07:41:50 +02:00
bors
a7d63fdbd0 Auto merge of #28291 - nrc:shr_span_fix, r=sfackler 2015-09-08 04:45:37 +00:00
Nick Cameron
5fbdf3ccd0 Fix span bug with >> and type bindings 2015-09-08 16:28:12 +12:00
bors
d2a5b117c1 Auto merge of #28246 - huonw:lang-tracking-issues, r=alexcrichton
This is similar to the libs version, which allow an `issue` field in the
`#[unstable]` attribute.

cc #28244
2015-09-08 01:02:06 +00:00
Huon Wilson
31310f5b65 Allow tracking issues for lang features.
This is similar to the libs version, which allow an `issue` field in the
`#[unstable]` attribute.

cc #28244
2015-09-08 11:01:42 +10:00
Jake Goulding
acea5f4c82 Clarify that include_bytes! returns a reference to an array, not just a slice
This can be shown with the example code

```rust
fn main() {
    let () = include_bytes!("/etc/hosts");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`
2015-09-07 20:01:14 -04:00
Andre Bogus
808390817a fixes/improvements thanks to @Manishearth 2015-09-08 01:03:01 +02:00
Andre Bogus
9cca96545f some more clippy-based improvements 2015-09-08 00:36:29 +02:00
bors
7bf626a680 Auto merge of #28285 - steveklabnik:split_at_idiom, r=arielb1
Generally, including everything that makes an unsafe block safe in the
block is good style. Since the assert! is what makes this safe, it
should go inside the block. I also added a few bits of whitespace.

This is of course, a little style thing, so no worries if we don't want this patch.
2015-09-07 19:25:21 +00:00
Aleksey Kladov
0e96c28236 libsyntax: restore lost error message 2015-09-07 22:15:36 +03:00
Aleksey Kladov
c8da5697e0 libsyntax: remove dead code from parser.rs
Both `parse_tuple_struct_body` and `parse_item_struct` handled the case
of unit like struct. The redundancy is removed,
`parse_tuple_struct_body` now handles only real tuple structs.
2015-09-07 20:08:57 +03:00
Steve Klabnik
5441ad6b9d Use unsafe more idiomatically
Generally, including everything that makes an unsafe block safe in the
block is good style. Since the assert! is what makes this safe, it
should go inside the block. I also added a few bits of whitespace.
2015-09-07 10:16:57 -04:00
bors
a7f4a8e50d Auto merge of #28278 - pfpacket:typo, r=steveklabnik 2015-09-07 13:59:08 +00:00
Vladimir Rutsky
b5b94037c4 fix punctuation in list (again) 2015-09-07 11:03:53 +03:00
Vladimir Rutsky
b1e8007999 fix capitalization inside sentense 2015-09-07 11:01:01 +03:00
Vladimir Rutsky
0d5cae2d45 fix punctuation in list
r? @steveklabnik
2015-09-07 09:41:02 +03:00
bors
a41d4359c5 Auto merge of #28275 - hunan-rostomyan:patch-1, r=steveklabnik 2015-09-07 06:13:50 +00:00
bors
6f142404d6 Auto merge of #28272 - Manishearth:improve_vec_docs, r=steveklabnik
r? @steveklabnik
2015-09-07 03:09:05 +00:00
Ryo Munakata
e8758e44b4 at_exit: fix a typo of the doc comment 2015-09-07 10:28:54 +09:00
bors
86156ac606 Auto merge of #28175 - christopherdumas:master, r=nrc
per #28168. This is my first contribution. I don't know who to "r?" for source code changes.
2015-09-07 01:16:38 +00:00
Richard Diamond
ba72d9722c Don't add unnamed address attributes to intrinsics.
Intrinsics never have an address, so it doesn't make sense to say that their
address is unnamed.
2015-09-06 19:26:41 -05:00
bors
f6aac80375 Auto merge of #28270 - arielb1:raw-fat-ops, r=nrc
r? @nrc 

Fixes #17736
Fixes #18829
Fixes #23888
Fixes #28236
2015-09-06 23:24:11 +00:00
Manish Goregaokar
5e2d8545e8 Add note about clone in docs for vec![] 2015-09-07 03:57:20 +05:30
Hunan Rostomyan
b4afa8e2e5 Fix a typo 2015-09-06 14:38:12 -07:00
bors
3dd1a48f3f Auto merge of #27893 - nikomatsakis:mir, r=nrc
This PR contains a new crate, `rustc_mir`, which implements the MIR as specified in the RFC (more or less). There are no targeted unit tests at the moment, as I didn't decide what kind of infrastructure would be best and didn't take the time to implement it. 

~~NB: In packaging up this PR, I realized that MIR construction code is not triggering for methods right now, I think it's only for fixed fns. I'll push a fix for this soon. Hopefully it doesn't stop any crates from building. :)~~ Fixed. Everything still seems to work.

However, the MIR construction code (`librustc_mir/build`) is intentionally quite distinct from the code which munges the compiler's data structures (`librustc_mir/tcx`). The interface between the two is the `HIR` trait (`librustc_mir/hir`). To avoid confusion with @nrc's work, perhaps a better name for this trait is warranted, although ultimately this trait *will* be connected to the HIR, I imagine, so in a way the name is perfect. Anyway, I'm open to suggestions. The initial motivation for this split was to allow for the MIR construction code to be unit-tested. But while I didn't end up writing unit tests (yet), I did find the split made the code immensely easier to think about, since the messiness of our existing system, with its myriad hashtables, punning, and so forth, is confined to one part, which simply transforms to a more fully explicit AST-like form. I tried to separate out the commits somewhat, but since this mostly new code, it mostly winds up coming in one fell swoop in the MIR commit.

Quick guide to the MIR crate:

- `repr.rs` defines the MIR itself; each MIR instance is parameterized by some HIR `H`
- `build/` is the MIR construction code, parameterized by a particular HIR
- `hir/` is the definition of the HIR interface
- `tcx/` is the impl of the HIR interface for the tcx
- `dump.rs` is the minimal compiler pass that invokes the HIR

One open question:

- In the HIR trait, I used exclusively struct-like variants. I found I like this more, since things have names. Should I convert the repr code?
2015-09-06 21:31:26 +00:00
Niko Matsakis
c8a661838e enable slice patterns and enable building rustdoc 2015-09-06 16:48:57 -04:00
bors
01b9cc58ba Auto merge of #28269 - petrochenkov:docorder, r=steveklabnik
This is what I was talking about in https://github.com/rust-lang/rust/pull/26462#issuecomment-113883744

r? @steveklabnik
2015-09-06 19:43:06 +00:00
bors
a269e31a30 Auto merge of #28265 - boblehest:master, r=bluss
In the last code snippet on the following page there is a bug in the
implementation of Vec::drain().

https://doc.rust-lang.org/nightly/nomicon/vec-drain.html

```rust
pub fn drain(&mut self) -> Drain<T> {
    // Oops, setting it to 0 while we still need the old value!
    self.len = 0;

    unsafe {
        Drain {
            // len is used to create a &[T] from &self here,
            // so we end up always creating an empty slice.
            iter: RawValIter::new(&self),
            vec: PhantomData,
        }
    }
}
```

A simple test to verify that Drain is broken can be found here:
https://play.rust-lang.org/?gist=30f579565e4bbf4836ce&version=nightly

And here's one with a fixed implementation:
https://play.rust-lang.org/?gist=2ec0c1a6dcf5defd7a53&version=nightly
2015-09-06 17:55:04 +00:00
Jørn Lode
97dd25094c Rustonomicon: Reword potentially confusing comment in Vec::drain. 2015-09-06 18:21:57 +02:00
christopherdumas
cd9c9f048f functional structure update syntax -> structure update syntax 2015-09-06 09:13:20 -07:00