Commit graph

45364 commits

Author SHA1 Message Date
bors
5aca49c693 Auto merge of #27338 - alexcrichton:remove-morestack, r=brson
This commit removes all morestack support from the compiler which entails:

* Segmented stacks are no longer emitted in codegen.
* We no longer build or distribute libmorestack.a
* The `stack_exhausted` lang item is no longer required

The only current use of the segmented stack support in LLVM is to detect stack
overflow. This is no longer really required, however, because we already have
guard pages for all threads and registered signal handlers watching for a
segfault on those pages (to print out a stack overflow message). Additionally,
major platforms (aka Windows) already don't use morestack.

This means that Rust is by default less likely to catch stack overflows because
if a function takes up more than one page of stack space it won't hit the guard
page. This is what the purpose of morestack was (to catch this case), but it's
better served with stack probes which have more cross platform support and no
runtime support necessary. Until LLVM supports this for all platform it looks
like morestack isn't really buying us much.

cc #16012 (still need stack probes)
Closes #26458 (a drive-by fix to help diagnostics on stack overflow)

r? @brson
2015-08-10 23:40:54 +00:00
Alex Crichton
7a3fdfbf67 Remove morestack support
This commit removes all morestack support from the compiler which entails:

* Segmented stacks are no longer emitted in codegen.
* We no longer build or distribute libmorestack.a
* The `stack_exhausted` lang item is no longer required

The only current use of the segmented stack support in LLVM is to detect stack
overflow. This is no longer really required, however, because we already have
guard pages for all threads and registered signal handlers watching for a
segfault on those pages (to print out a stack overflow message). Additionally,
major platforms (aka Windows) already don't use morestack.

This means that Rust is by default less likely to catch stack overflows because
if a function takes up more than one page of stack space it won't hit the guard
page. This is what the purpose of morestack was (to catch this case), but it's
better served with stack probes which have more cross platform support and no
runtime support necessary. Until LLVM supports this for all platform it looks
like morestack isn't really buying us much.

cc #16012 (still need stack probes)
Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-10 16:35:44 -07:00
bors
75383ea7d7 Auto merge of #27531 - bluss:io-copy-dst, r=alexcrichton
std: Allow ?Sized parameters in std::io::copy
2015-08-10 22:03:09 +00:00
bors
8856927f64 Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219).

The RFC is not merged yet, but once merged, this could be.
2015-08-10 20:24:06 +00:00
bors
3d69bec881 Auto merge of #27252 - tbu-:pr_less_transmutes, r=alexcrichton
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.

This builds upon #27233.
2015-08-10 18:46:21 +00:00
bors
96a1f40402 Auto merge of #27516 - alexcrichton:osx-flaky-zomg, r=brson
The investigation into #14232 discovered that it's possible that signal delivery
to a newly spawned process is racy on OSX. This test has been failing spuriously
on the OSX bots for some time now, so ignore it as we don't currently know a
solution and it looks like it may be out of our control.
2015-08-10 17:06:15 +00:00
bors
1db1417736 Auto merge of #27547 - vberger:more_perseverant_resolve, r=nrc
As noted in my previous PR #27439 , the import resolution algorithm has two cases where it bails out:

- The algorithm will delay an import if the module containing the target of the import still has unresolved glob imports
- The algorithm will delay a glob import of the target module still has unresolved imports

This PR alters the behaviour to only bail out when the above described unresolved imports are `pub`, as non-pub imports don't affect the result anyway.

It is still possible to fail the algorithm with examples like
```rust
pub mod a {
    pub use b::*;
}

pub mod b {
    pub use a::*;
}
```
but such configurations cannot be resolved in any meaningful way, as these are cyclic imports.

Closes #4865
2015-08-10 14:40:07 +00:00
Ulrik Sverdrup
664fdbed32 std: Allow ?Sized parameters in std::io::copy
std::io::copy did not allow passing trait objects directly (only with an
extra &mut wrapping).
2015-08-10 14:29:08 +02:00
bors
a136d4c95f Auto merge of #27634 - TimNN:master, r=dotdash
I don't know how this single inline caused the breakage but it seems to be the cause of the issue (see https://github.com/rust-lang/rust/issues/27619#issuecomment-129420094).
2015-08-10 12:01:01 +00:00
Tim Neumann
03f561c5f2 Revert "Mark round_up_to_next as inline"
This reverts commit febdc3b201.
2015-08-10 13:51:55 +02:00
Tobias Bucher
33af24ca4c Remove unused feature 2015-08-09 23:53:28 +02:00
Tobias Bucher
2ec26681a4 Remove #[cfg(stage0)] annotation 2015-08-09 22:05:23 +02:00
Tobias Bucher
587a32b61b Change TODO to FIXME 2015-08-09 22:05:23 +02:00
Tobias Bucher
5309fbb6c9 Make str::as_bytes_mut private 2015-08-09 22:05:22 +02:00
Tobias Bucher
47041fe289 Make slice::transmute* private 2015-08-09 22:05:22 +02:00
Tobias Bucher
22ec5f4af7 Replace many uses of mem::transmute with more specific functions
The replacements are functions that usually use a single `mem::transmute` in
their body and restrict input and output via more concrete types than `T` and
`U`. Worth noting are the `transmute` functions for slices and the `from_utf8*`
family for mutable slices. Additionally, `mem::transmute` was often used for
casting raw pointers, when you can already cast raw pointers just fine with
`as`.
2015-08-09 22:05:22 +02:00
Ariel Ben-Yehuda
febdc3b201 Mark round_up_to_next as inline
This speeds up rustc on #25916 from 1.36Â0.022s to 1.326Â0.025s
2015-08-09 17:20:12 +03:00
bors
a5d33d8911 Auto merge of #27182 - AlisdairO:diagnostics382, r=Manishearth
As title :-)
Part of #24407.

r? @Manishearth
2015-08-08 20:32:27 +00:00
Alisdair Owens
dadc717041 add long diagnostics for E0382 2015-08-08 20:17:03 +01:00
Sean McArthur
cfcd449c4c rustc: rename multiple imports in a list 2015-08-08 11:54:15 -07:00
bors
cbf4c342cf Auto merge of #27595 - mike-marcacci:patch-1, r=steveklabnik
Keeping integer values and integer references in the "value" columns made the examples quite difficult for me to follow. I've added unicode arrows to references to make them more obvious, without using any characters with actual meaning in the rust language (like `&` or previously `~`).

r? @steveklabnik
2015-08-08 16:27:12 +00:00
bors
920cf4b4b2 Auto merge of #27596 - tsion:fix-27450, r=arielb1
Fixes #27450.

r? @steveklabnik
2015-08-08 09:55:42 +00:00
Mike Marcacci
bcf3921a2a Added arrows to references in tables
Keeping integer values and integer references in the "value" columns made the examples quite difficult for me to follow. I've added unicode arrows to make references more obvious, without using a character with actual meaning in the rust language (like `&` or previously `~`).
2015-08-07 23:13:08 -07:00
Scott Olson
f351e762f0 Fix the diagnostic for fat pointer to usize casts.
Fixes #27450.
2015-08-07 22:08:28 -04:00
bors
e5d90d9840 Auto merge of #27378 - GuillaumeGomez:patch-2, r=brson
Part of #24407.
r? @Manishearth
2015-08-07 17:58:17 +00:00
bors
1b5d52122e Auto merge of #27582 - pnkfelix:disable-nonzeroing-move-hint-by-default, r=nikomatsakis
Turn nonzeroing move hints back off by default.

Works around bugs injected by PR #26173.

 * (@pnkfelix is unavailable in the short-term (i.e. for the next week) to fix them.)

 * When the bugs are fixed, we will turn nonzeroing move hints back on by default.

Fix #27401
2015-08-07 16:24:22 +00:00
Felix S. Klock II
1a68b18763 placate the pretty tests by ignoring my test. 2015-08-07 18:23:37 +02:00
Felix S. Klock II
6170435055 Regression test for dropflag reinit issue.
Fix #27401.
2015-08-07 16:21:22 +02:00
Felix S. Klock II
e9b28d22fb Turn nonzeroing move hints back off by default.
This is a temporary workaround for the bugs that have been found in
the implementation of PR #26173.

 * pnkfelix is unavailable in the short-term (i.e. for the next week) to fix them.

 * When the bugs are fixed, we will turn this back on by default.

(If you want to play with the known-to-be-buggy optimization in the
meantime, you can opt-back in via the debugging option that this
commit is toggling.)
2015-08-07 15:51:25 +02:00
Guillaume Gomez
c3d147eea6 Add a guard example for E0416 2015-08-07 15:23:00 +02:00
Guillaume Gomez
5aa6c155a3 Improve examples of E0102 2015-08-07 15:07:20 +02:00
bors
ab77c1d8d0 Auto merge of #27551 - arielb1:adt-def, r=nikomatsakis
This ended up being a bigger refactoring than I thought, as I also cleaned a few ugly points in rustc. There are still a few areas that need improvements.

Performance numbers:
```
Before:
572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k
llvm-time: 385.858

After:
545.27user 5.49system 7:10.22elapsed 128%CPU (0avgtext+0avgdata 1145348maxresident)k
llvm-time: 387.119
```

A good 5% perf improvement. Note that after this patch >70% of the time is spent in LLVM - Amdahl's law is in full effect.

Passes make check locally.

r? @nikomatsakis
2015-08-07 12:23:06 +00:00
Victor Berger
5847ea7619 Customize error messages for self glob imports. 2015-08-07 14:18:20 +02:00
Ariel Ben-Yehuda
eedb1cc576 rename ADTDef to AdtDef etc. 2015-08-07 15:03:09 +03:00
Ariel Ben-Yehuda
62cd3cc46b stop using skip_binder 2015-08-07 13:57:39 +03:00
Ariel Ben-Yehuda
7d32533eab add documentation 2015-08-07 13:48:29 +03:00
bors
9bba711063 Auto merge of #27576 - rust-lang:steveklabnik-patch-1, r=Gankro
1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.

r? @Gankro
2015-08-07 05:57:24 +00:00
bors
b77d2f5ac7 Auto merge of #27558 - mlalic:patch-1, r=brson
r? @steveklabnik
2015-08-07 04:21:47 +00:00
bors
871fd5eb73 Auto merge of #27552 - tshepang:misc, r=brson 2015-08-07 02:46:43 +00:00
bors
1181679c8f Auto merge of #27574 - brson:cache-staged-api, r=huonw
This search happens a lot! Locally, compiling hyper sees the following improvements:

before

real    0m30.843s
user    0m51.644s
sys     0m2.128s

real    0m30.164s
user    0m53.320s
sys     0m2.208s

after

real    0m28.438s
user    0m51.076s
sys     0m2.276s

real    0m28.612s
user    0m51.560s
sys     0m2.192s
2015-08-07 01:12:15 +00:00
Steve Klabnik
ad9a0713fd Remove reference to diabetes
1. this isn't actually true about diabetes
2. people with diabetes will get *real sad* when reading this
3. it isn't actually necessary.
2015-08-06 20:18:49 -04:00
Brian Anderson
fd142bb741 Cache a linear search for the #[staged_api] attribute.
This search happens a lot! Locally, compiling hyper sees the following improvements:

before

real    0m30.843s
user    0m51.644s
sys     0m2.128s

real    0m30.164s
user    0m53.320s
sys     0m2.208s

after

real    0m28.438s
user    0m51.076s
sys     0m2.276s

real    0m28.612s
user    0m51.560s
sys     0m2.192s
2015-08-06 16:53:05 -07:00
bors
68f79288bf Auto merge of #27566 - rubymeow:master, r=steveklabnik
I got a bit confused reading the guide over why all of a sudden there was an asterisk in the code. I was explained what it was there for in the IRC, and I think it should added it to the docs to prevent any further confusion!
2015-08-06 20:45:39 +00:00
bors
11deb083f5 Auto merge of #27296 - jroesch:type-macros, r=huonw
This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message.

@nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.
2015-08-06 19:11:17 +00:00
Guillaume Gomez
2a08cff97c Add another example for E0412 2015-08-06 20:57:36 +02:00
Ruby
d3e089f08b fixed the few nits! 2015-08-06 19:55:53 +01:00
Ruby
855f1ff321 Explained asterisk on & and &mut reference 2015-08-06 19:29:03 +01:00
Guillaume Gomez
99796a6c9c Update E0423 example 2015-08-06 19:46:09 +02:00
bors
fb92de75c1 Auto merge of #27556 - taliesinb:tarpl-clarity-2, r=Gankro
* Some clarifying rephrasing.
* Rename B.x back to B.a.
* Make null pointer optimization section bit more concrete.

r? @Gankro
2015-08-06 17:36:21 +00:00
Ariel Ben-Yehuda
015300109d cache Ty::is_simd 2015-08-06 18:26:00 +03:00