Commit Graph

50885 Commits

Author SHA1 Message Date
Alex Crichton
01a2a7f991 rustc: Add an i586-pc-windows-msvc target
Similarly to #31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent [Gecko bug][ff] where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

[ff]: https://bugzilla.mozilla.org/show_bug.cgi?id=1253202
2016-03-04 09:21:28 -08:00
bors
f6e125f04a Auto merge of #31979 - jseyfried:rename_ctxt, r=eddyb
r? @eddyb
2016-03-03 10:22:41 +00:00
bors
4aa913cd23 Auto merge of #32012 - bluss:more-drop-in-place, r=alexcrichton
Use `drop_in_place` in Vec and VecDeque

We can use drop_in_place's DST capabilities directly in Vec::drop and similarly in VecDeque::drop. I verfied this has the same effect as the previous `needs_drop` code; `drop_in_place` it itself an intrinsic.

The VecDeque replacement should be more efficient too, even in release mode (slice iteration makes a more efficient loop than the deque iterator).
2016-03-03 08:35:51 +00:00
Jeffrey Seyfried
37ba66a66e Rename middle::ty::ctxt to TyCtxt 2016-03-03 07:37:56 +00:00
bors
7cee8b9ffb Auto merge of #31824 - jseyfried:privacy_in_resolve, r=nikomatsakis
This PR privacy checks paths as they are resolved instead of in `librustc_privacy` (fixes #12334 and fixes #31779). This removes the need for the `LastPrivate` system introduced in PR #9735, the limitations of which cause #31779.

This PR also reports privacy violations in paths to intra- and inter-crate items the same way -- it always reports the first inaccessible segment of the path.

Since it fixes #31779, this is a [breaking-change]. For example, the following code would break:
```rust
mod foo {
    pub use foo::bar::S;
    mod bar { // `bar` should be private to `foo`
        pub struct S;
    }
}

impl foo::S {
    fn f() {}
}

fn main() {
    foo::bar::S::f(); // This is now a privacy error
}
```

r? @alexcrichton
2016-03-03 02:21:28 +00:00
bors
7b0b80ae21 Auto merge of #32005 - vegai:31686, r=Manishearth
Fix note for type alias in trait position

Fixes #31686
2016-03-02 22:15:51 +00:00
vegai
01a6e8653b Type defined here note added to test 2016-03-02 22:29:54 +02:00
bors
b9e61c9f40 Auto merge of #31996 - gandro:update-libc, r=alexcrichton
This fixes the `x86_64-rumprun-netbsd` target.

r? @alexcrichton
2016-03-02 17:41:00 +00:00
vegai
86357c37d2 Fix test to reflect new note 2016-03-02 19:27:56 +02:00
Ulrik Sverdrup
7ceafaee4f Use ptr::drop_in_place in VecDeque::drop
Just like for Vec. This should benefit both non-optimized and optimized
performance. Non-optimized since the intrinsic drop_in_place is easily
removed, and optimized because iterating the slices is more efficient
than using the VecDeque iterators.
2016-03-02 18:05:41 +01:00
Ulrik Sverdrup
1da364e98f Use ptr::drop_in_place in Vec::truncate 2016-03-02 18:05:40 +01:00
Ulrik Sverdrup
c0f8b08594 Use ptr::drop_in_place in Vec::drop
Directly use the drop glue for [T]. Still optimizes out in -O1 like with
the `needs_drop` intrinsic.
2016-03-02 18:05:40 +01:00
bors
675723e243 Auto merge of #32000 - xaocon:master, r=steveklabnik
Vectors come up in sections dedicated to ownership with the assumption that we know something about it but we haven't seen it yet. On the other hand, you need not know anything about ownership or lifetimes to understand the basics of vectors covered in the vector section of the book. Additionally, by moving it where it is there is a natural progression from loops to an iterative type which discusses for loops. This kind of interaction is generally better for learning.

I would like to have moved the struct section as well but I'm less confident about how to handle it since the ownership sections discuss structs and the structs section talks about mutable borrow.
2016-03-02 14:35:33 +00:00
bors
25e42ac106 Auto merge of #31937 - petrochenkov:field, r=eddyb
The names are "0", "1", "2" etc, the same as used in field access.

This generally make things simpler and potentially allows to reuse braced struct machinery (struct patterns, struct expressions) for tuple structs.

I haven't touched the AST for stability reasons, but I intend to do it later.

r? @eddyb
2016-03-02 08:42:38 +00:00
Vadim Petrochenkov
bc93fbc32f Add test (fixes #27340) 2016-03-02 10:32:04 +03:00
Vadim Petrochenkov
9047b201bf Move span into StructField
+ some cleanup in rustdoc
2016-03-02 10:32:04 +03:00
Vadim Petrochenkov
8b026a6e48 Use numeric field Names ("0", "1" etc) for positional fields 2016-03-02 10:31:19 +03:00
Vadim Petrochenkov
8b60b948d9 Get rid of hir::StructFieldKind 2016-03-02 10:31:19 +03:00
vegai
bd7e422996 Add a span note on type definition spot 2016-03-02 07:06:22 +02:00
bors
0400d929e8 Auto merge of #32001 - Manishearth:rollup, r=Manishearth
- Successful merges: #31919, #31982, #31985, #31989, #31999
- Failed merges:
2016-03-02 02:40:07 +00:00
Manish Goregaokar
b515bb3b6b Rollup merge of #31999 - bluss:fundamental-raw-ptr, r=eddyb
Use raw pointer casts for slice, str's .as_ptr()

We can now use raw pointer casts `*const [T] as *const T` and
`*const str as *const u8` instead of .repr() for getting the
pointer out of a slice.
2016-03-02 07:01:16 +05:30
Manish Goregaokar
fe565954ea Rollup merge of #31989 - Kimundi:more_flexible_str_pattern_indirection, r=bluss
This allows a bit more flexibility in how to use it, see the included test case.
2016-03-02 07:01:15 +05:30
Manish Goregaokar
3f7867c21f Rollup merge of #31985 - ashleysommer:libbackgrace_emscripten_fix, r=alexcrichton
Was getting error:
```
running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu"
...
Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized
```
This commit adds the emscripten target to the libbacktrace configure script so it is no longer unrecognized.
2016-03-02 07:01:15 +05:30
Manish Goregaokar
4ed3826f27 Rollup merge of #31982 - apasel422:sync, r=alexcrichton
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others.

r? @alexcrichton
2016-03-02 07:01:15 +05:30
Manish Goregaokar
9d4422e1fc Rollup merge of #31919 - petrochenkov:blockpub, r=nikomatsakis
Closes https://github.com/rust-lang/rust/issues/31776

r? @nikomatsakis
2016-03-02 07:01:15 +05:30
Evan
cf01fb6836 Make book ordering more natural
Vectors come up in sections dedicated to ownership with the assumption that we know something about it but we haven't seen it yet. On the other hand, you need not know anything about ownership or lifetimes to understand the basics of vectors covered in the vector section of the book. Additionally, by moving it where it is there is a natural progression from loops to an iterative type which discusses for loops. This kind of interaction is generally better for learning.

I would like to have moved the struct section as well but I'm less confident about how to handle it since the ownership sections discuss structs and the structs section talks about mutable borrow.
2016-03-01 19:50:11 -05:00
ashleysommer
d846f490a0 Fix compiling libstd with emscripten target.
Was getting error:
```
running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu"
...
Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized
```

Undo change to libbacktrace configure script.
Modify libstd build.rs to not build libbacktrace in the case of targeting emscripten.
2016-03-02 10:40:30 +10:00
Andrew Paseltiner
f522d88237 Explicitly opt out of Sync for cell and mpsc types
These types were already `!Sync`, but this improves error messages when
they are used in contexts that require `Sync`, aligning them with
conventions used with `Rc`, among others.
2016-03-01 18:51:46 -05:00
bors
339a409bfd Auto merge of #31430 - nagisa:mir-dyndrop, r=nikomatsakis
Zeroing on-drop seems to work fine. Still thinking about the best way to approach zeroing on-move.

(based on top of the other drop PR; only the last 2 commits are relevant)
2016-03-01 23:30:49 +00:00
Ulrik Sverdrup
63c4065af0 Use raw pointer casts for slice, str's .as_ptr()
We can now use raw pointer casts `*const [T] as *const T` and
`*const str as *const u8` instead of .repr() for getting the
pointer out of a slice.
2016-03-01 22:30:18 +01:00
Sebastian Wicki
ffd734c35b Update libc crate 2016-03-01 21:15:49 +01:00
bors
84d8fec9b0 Auto merge of #31993 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #31965, #31969, #31973, #31978, #31984, #31987, #31992
- Failed merges:
2016-03-01 20:09:00 +00:00
vegai
59fafcf00c span_note => fileline_note 2016-03-01 21:33:35 +02:00
Steve Klabnik
fbe9f10266 Rollup merge of #31992 - brson:bump, r=steveklabnik 2016-03-01 13:39:42 -05:00
Steve Klabnik
0ee1b99288 Rollup merge of #31987 - gcatlin:patch-1, r=steveklabnik
r? @steveklabnik
2016-03-01 13:39:42 -05:00
Steve Klabnik
c98c1b777f Rollup merge of #31984 - xaocon:master, r=steveklabnik
Had a discussion at https://www.reddit.com/r/rust/comments/488mjv/borrowing_or_returning_ownership/ about how an example could be worded more clearly and tried to take my recommendation and expand upon it with further information provided in the post.
2016-03-01 13:39:42 -05:00
Steve Klabnik
5b40e9b733 Rollup merge of #31978 - tsion:patch-1, r=Manishearth
Previously it was rendering like this: http://i.imgur.com/ODFPdFW.png
2016-03-01 13:39:42 -05:00
Steve Klabnik
a217b19035 Rollup merge of #31973 - brson:relnotes3, r=alexcrichton
This builds on some of the other relnotes PRs in the queue.
2016-03-01 13:39:42 -05:00
Steve Klabnik
b3c78fc29a Rollup merge of #31969 - brson:relnotes, r=alexcrichton
Same as https://github.com/rust-lang/rust/pull/31923 but without the submodule updates.
2016-03-01 13:39:41 -05:00
Steve Klabnik
5b91fc02f0 Rollup merge of #31965 - miqid:doc, r=steveklabnik
Hello.

Quite a few of the links in the `core` module concerning redirection to additional primitive type documentation are broken. I noticed in #30214 that there seemed to be a consensus with linking across to `std` module documentation from the `core` module. This is what I've done with the `core` modules for primitive types.

If the changes here are good to go forward with, I'll happily tend to adding more documentation links for the extension traits in the aforementioned issue if need be.

r? @steveklabnik
2016-03-01 13:39:41 -05:00
Brian Anderson
7bf4d9c951 Bump to 1.9 2016-03-01 18:34:26 +00:00
Marvin Löbel
dd67e55c10 Changed std::pattern::Pattern impl on &'a &'a str to &'a &'b str
in order to allow a bit more felixibility in how to use it.
2016-03-01 17:53:51 +01:00
bors
f25f0e8de9 Auto merge of #31939 - killercup:patch-17, r=brson
Use unordered nested list for stabilised APIs to improve readability. This makes the release notes for 1.7 a bit longer, but I don't think we should optimise for brevity here. It's a bit inconsistent since the other releases are not done this way, so feel free to ignore this change.

Also:
- Add link to `u32::checked_neg`
- Remove trailing back tick from BTreeMap line

r? @brson
2016-03-01 14:46:04 +00:00
Geoff Catlin
dcb92abbe1 grammar: 'fewer' instead of 'less' 2016-03-01 08:42:34 -05:00
Michael Huynh
dc97f84be4 Fix broken links for core primitives
Redirects existing links for more details on primitive types in the
`core` module to the ones that exist in the `std` module.
2016-03-01 20:44:48 +08:00
bors
bbc0238e90 Auto merge of #31962 - sanxiyn:const-eval-map, r=arielb1
Fix #31910.
2016-03-01 11:33:25 +00:00
bors
0a52494f7e Auto merge of #31335 - SimonSapin:ascii-into, r=alexcrichton
The default implementations (with `where Self: Sized`) are so that methods that take `self` by value can exist in a trait that’s implemented for dynamically-sized types (`str` and `[u8]`).

CC https://github.com/rust-lang/rust/issues/27809#issuecomment-177564950
CC @alexcrichton
2016-03-01 07:43:52 +00:00
bors
a93bb135c8 Auto merge of #31713 - alexcrichton:rustbuild-docs, r=brson
This commit implements documentation generation of the nomicon, the book, the
style guide, and the standalone docs. New steps were added for each one as well
as appropriate makefile targets for each one as well.
2016-03-01 04:44:56 +00:00
Evan
ae9121bb6d Clarified the details of a borrowing example.
Had a discussion at https://www.reddit.com/r/rust/comments/488mjv/borrowing_or_returning_ownership/ about how an example could be worded more clearly and tried to take my recommendation and expand upon it with further information provided in the post.
2016-02-29 23:22:30 -05:00
Scott Olson
60ee36a1b9 Add link for checked_neg in 1.7 release notes. 2016-02-29 16:36:36 -06:00