Commit Graph

53495 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
9cd83eb15c Rollup merge of #33605 - tshepang:less-awkward, r=steveklabnik
doc: use less awkward and less confusing language
2016-05-16 02:00:19 +03:00
Eduard-Mihai Burtescu
9c745e7feb Rollup merge of #33604 - tshepang:line-em-up, r=GuillaumeGomez
doc: line these comments up

Looks more nice, and same is done with prior examples
2016-05-16 02:00:18 +03:00
Eduard-Mihai Burtescu
752137f9cb Rollup merge of #33603 - tshepang:no-need, r=apasel422
doc: to_string not needed since we gots coercion
2016-05-16 02:00:18 +03:00
bors
5ebe41835f Auto merge of #33619 - jonathandturner:improve_structured_errors, r=nikomatsakis
Batch of improvements to errors for new error format

This is a batch of improvements to existing errors to help get the most out of the new error format.

* Added labels to primary spans (^^^) for a set of errors that didn't currently have them
* Highlight the source blue under the secondary notes for better readability
* Move some of the "Note:" into secondary spans+labels
* Fix span_label to take &mut instead, which makes it work the same as other methods in that set
2016-05-15 15:08:46 -07:00
Jonathan Turner
65cb5f7378 Add space after equals 2016-05-15 11:57:50 -07:00
bors
e7420fbbae Auto merge of #33620 - eddyb:oops-static-is-not-fn, r=dotdash
mir: always allow &mut [...] in static mut regardless of the array length.
2016-05-15 11:01:03 -07:00
Florian Berger
92abda02c4 Update link to license 2016-05-15 19:59:45 +03:00
bors
9f58fb776a Auto merge of #33658 - Manishearth:rollup, r=Manishearth
Rollup of 14 pull requests

- Successful merges: #33342, #33393, #33415, #33475, #33517, #33533, #33534, #33565, #33580, #33584, #33585, #33590, #33591, #33598
- Failed merges: #33578
2016-05-15 08:37:09 -07:00
Manish Goregaokar
95ace6be43 Rollup merge of #33598 - haikoschol:master, r=alexcrichton
doc: Fix comment in std::string::String example code
2016-05-15 20:13:43 +05:30
Manish Goregaokar
762e5b1c0f Rollup merge of #33591 - dns2utf8:systemtime_wording, r=GuillaumeGomez
Use the correct word in the explanation

r? @steveklabnik
2016-05-15 20:13:43 +05:30
Manish Goregaokar
9f336f6368 Rollup merge of #33590 - durka:patch-22, r=aturon
update "reason" for fnbox feature gate

It isn't "newly introduced" anymore.
2016-05-15 20:13:43 +05:30
Manish Goregaokar
e82596b9d8 Rollup merge of #33585 - GuillaumeGomez:error_code_test, r=steveklabnik
Add compile-fail tests for error codes

r? @steveklabnik

cc @jonathandturner
2016-05-15 20:13:42 +05:30
Manish Goregaokar
65814df26b Rollup merge of #33584 - GuillaumeGomez:error_code_improvements, r=steveklabnik
Add more details and examples in error codes

r? @steveklabnik
2016-05-15 20:13:42 +05:30
Manish Goregaokar
3bc7fc1b54 Rollup merge of #33580 - frewsxcv:temp-dir, r=alexcrichton
Cleanup formatting and wording for `std::env::temp_dir` docs.

None
2016-05-15 20:13:42 +05:30
Manish Goregaokar
0238e29652 Rollup merge of #33565 - Amanieu:once_doc, r=GuillaumeGomez
Fix typo in std::sync::Once documentation
2016-05-15 20:13:41 +05:30
Manish Goregaokar
0ceb073038 Rollup merge of #33534 - dns2utf8:atomic_docs, r=GuillaumeGomez
Simplify text

This way it should be clear: Any number of other threads have this guaranty not just one other thread.
2016-05-15 20:13:41 +05:30
Manish Goregaokar
0f4f51b173 Rollup merge of #33533 - GuillaumeGomez:add_E0500, r=steveklabnik
Add E0500 error explanation

r? @Manishearth

Part of #32777.
2016-05-15 20:13:41 +05:30
Manish Goregaokar
0e5f385b96 Rollup merge of #33517 - sanxiyn:tight-span, r=nagisa
Tighten span for E0063
2016-05-15 20:13:40 +05:30
Manish Goregaokar
7003253b34 Rollup merge of #33475 - billyevans:master, r=guillaumegomez
Add detailed error explanation for E0505

Part of #32777
2016-05-15 20:13:40 +05:30
Manish Goregaokar
a9a130f6af Rollup merge of #33415 - dfockler:master, r=steveklabnik
Add error explanations for E0374, E0375, E0376 on issue #32777
2016-05-15 20:13:40 +05:30
Manish Goregaokar
03ec483a72 Rollup merge of #33393 - cristianoliveira:docs-error-explanation, r=steveklabnik
Add error description for E0455

r? @GuillaumeGomez.

About this error there is no much thing to explain. The short description says enough to understand. Feel free to review.
2016-05-15 20:13:40 +05:30
Manish Goregaokar
c3086c2ef8 Rollup merge of #33342 - birkenfeld:issue-26472, r=jseyfried
typeck: if a private field exists, also check for a public method

For example, `Vec::len` is both a field and a method, and usually encountering `vec.len` just means that the parens were forgotten.

Fixes: #26472

NOTE: I added the parameter `allow_private` to `method::exists` since I don't want to suggest inaccessible methods. For the second case, where only the method exists, I think it would make sense to set it to `false` as well, but I wanted to preserve compatibility for this case.
2016-05-15 20:13:39 +05:30
Guillaume Gomez
391ae7f37a Add lifetime's bounds in doc generation 2016-05-15 15:29:44 +02:00
bors
b358319353 Auto merge of #33612 - royalstream:royalstream-enc-enum-ptr, r=michaelwoerister
gdb Pretty Print: generic encoded was failing on reference/pointer types

If you debug this program using **gdb**
```rust
fn main() {
    let x = 10;
    let y = Some(&x);
    // additional code
}
```
And you try to print **y**'s value from the debugger, you get the following:
```
(gdb) print y
Python Exception <class 'gdb.error'> Cannot convert value to int.:
$1 = {RUST$ENCODED$ENUM$0$None = Some = {0x7fff5fbff97c}}
```
What happens is that inside **debugger_pretty_printers_common.py** the method `is_null_variant` doesn't have any special handling for pointer values so it ends up calling `.as_integer()` on `discriminant_val` (which holds a pointer) and fails.

Considering it needs to handle pointers and return _true_ when the pointer is _null_, I modified the `.as_integer()` method in **gdb_rust_pretty_printing.py** to take pointers into consideration.

After this modification **gdb** prints **y** like this:
```
(gdb) print y
$1 = Some = {0x7fff5fbff97c}
```
Now, it would be nice to print something useful (instead of a pointer address) but the pretty printer doesn't currently handle references/pointers so that's a completely different subject.
2016-05-15 05:26:50 -07:00
Nerijus Arlauskas
148b5e4e10 Update i686-linux-android features to match android ABI. 2016-05-15 14:34:04 +03:00
Nerijus Arlauskas
e512abd418 Update libc to bring in updates for android's aarch64. 2016-05-15 11:57:19 +03:00
bors
1a26d2364f Auto merge of #33607 - jonas-schievink:prettier-mir, r=eddyb
Some simple improvements to MIR pretty printing

In short, this PR changes the MIR printer so that it:

* places an empty line between the MIR for each item
* does *not* write an empty line before the first BB when there are no
  var decls
* aligns the "// Scope" comments 50 chars in (makes the output more
  readable)
* prints the scope comments as "// scope N at ..." instead of "//
  Scope(N) at ..."
* prints a prettier scope tree:
 * no more unbalanced delimiters!
 * no more "Parent" entry (these convey no useful information)
 * drop the "Scope()" and just print scope IDs
 * no braces when the scope is empty

In action: https://gist.github.com/jonas-schievink/1c11226cbb112892a9470ce0f9870b65
2016-05-15 01:14:10 -07:00
bors
088d417852 Auto merge of #33593 - dotdash:smart_derive, r=brson
Improve derived implementations for enums with lots of fieldless variants

A number of trait methods like PartialEq::eq or Hash::hash don't
actually need a distinct arm for each variant, because the code within
the arm only depends on the number and types of the fields in the
variants. We can easily exploit this fact to create less and better
code for enums with multiple variants that have no fields at all, the
extreme case being C-like enums.

For nickel.rs and its by now infamous 800 variant enum, this reduces
optimized compile times by 25% and non-optimized compile times by 40%.
Also peak memory usage is down by almost 40% (310MB down to 190MB).

To be fair, most other crates don't benefit nearly as much, because
they don't have as huge enums. The crates in the Rust distribution that
I measured saw basically no change in compile times (I only tried
optimized builds) and only 1-2% reduction in peak memory usage.
2016-05-14 22:04:58 -07:00
bors
dd0ef17a2d Auto merge of #33600 - ollie27:rustdoc_impl_params, r=alexcrichton
rustdoc: Fix missing type parameters on impls

They were broken by #32558.

Fixes: #33592
2016-05-14 19:46:01 -07:00
Nerijus Arlauskas
39b311ecd5 Add all possible features (NEON, FP) to aarch64 android target. 2016-05-14 22:43:50 +03:00
Nerijus Arlauskas
155faafb04 Add missing "max_atomic_width" to new armv7 android target. 2016-05-14 22:43:49 +03:00
Nerijus Arlauskas
dfc4930fe8 Remove "gnu" from "target_env" because it does not matter for android. 2016-05-14 22:26:40 +03:00
bors
8492b6aa45 Auto merge of #33579 - Amanieu:atomic_bool2, r=alexcrichton
Make AtomicBool the same size as bool

Reopening #32365

This allows `AtomicBool` to be transmuted to a `bool`, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a valid `bool` value, which wasn't the case before (due to `fetch_nand`).

r? @alexcrichton
2016-05-14 11:56:58 -07:00
Luca Bruno
22972b8b6f
test: clear deprecation warnings in tcp-stress
Signed-off-by: Luca Bruno <lucab@debian.org>
2016-05-14 18:57:09 +02:00
Luca Bruno
47ebc56386
test: assert that all tcp-stress threads get spawned
System limits may restrict the number of threads effectively spawned
by this test (eg. systemd recently introduced a 512 tasks per unit
maximum default).
This commit explicitly asserts on the expected number of threads,
making failures due to system limits easier to spot.
More details at https://bugs.debian.org/822325

Signed-off-by: Luca Bruno <lucab@debian.org>
2016-05-14 18:56:20 +02:00
bors
5029a60d83 Auto merge of #33568 - nrc:save-json-2, r=pnkfelix
save-analysis: JSON mk2

cc @aochagavia

r? @pnkfelix
2016-05-14 09:36:52 -07:00
bors
5f6eb14b28 Auto merge of #33563 - Amanieu:oncestate, r=alexcrichton
Export OnceState from libstd

This type is used in the signature of `call_once_force` but isn't exported from libstd.

r? @alexcrichton
2016-05-14 07:15:45 -07:00
bors
6ba8a1a657 Auto merge of #33632 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests

- Successful merges: #33544, #33552, #33554, #33555, #33560, #33566, #33572, #33574, #33576
- Failed merges:
2016-05-14 04:24:33 -07:00
Tshepang Lekhonkhobe
e699e12eb0 doc: 'tis the lang, not the reptile 2016-05-14 13:02:28 +02:00
Vadim Petrochenkov
a62a690326 Add checks for self: _ and self: &_ 2016-05-14 13:42:37 +03:00
Tshepang Lekhonkhobe
971a3afe48 doc: improve output 2016-05-14 12:35:02 +02:00
Vadim Petrochenkov
766f9b5a2f Remove ExplicitSelf from HIR 2016-05-14 13:26:40 +03:00
Vadim Petrochenkov
212d5d4352 syntax: Refactor parsing of method declarations
Fix spans and expected token lists, fix #33413 + other cosmetic improvements
Add test for #33413
Convert between `Arg` and `ExplicitSelf` precisely
Simplify pretty-printing for methods
2016-05-14 13:23:37 +03:00
Manish Goregaokar
61d87f0825 Rollup merge of #33576 - soltanmm:vtable, r=nikomatsakis
Plumb inference obligations through selection, take 2

Using a `SnapshotVec` and dumping inferred obligations into `Vtable` variants.

r? @nikomatsakis
2016-05-14 11:57:49 +02:00
Manish Goregaokar
c62d65cfbf Rollup merge of #33574 - michaelwoerister:collector-cleanup, r=nikomatsakis
trans-collector: Assorted fixes and refactorings needed for making trans collector-driven.

As the title says. The messages on the individual commits should do a good job of explaining what they are about.

r? @nikomatsakis
2016-05-14 11:57:49 +02:00
Manish Goregaokar
8845592514 Rollup merge of #33572 - nagisa:assoc-const-types, r=eddyb
Support references to outer type params for assoc consts

Fixes #28809

r? @eddyb
2016-05-14 11:57:48 +02:00
Manish Goregaokar
25ca82aa17 Rollup merge of #33566 - dotdash:biased_switch, r=nagisa
[MIR trans] Optimize trans for biased switches

Currently, all switches in MIR are exhausitive, meaning that we can have
a lot of arms that all go to the same basic block, the extreme case
being an if-let expression which results in just 2 possible cases, be
might end up with hundreds of arms for large enums.

To improve this situation and give LLVM less code to chew on, we can
detect whether there's a pre-dominant target basic block in a switch
and then promote this to be the default target, not translating the
corresponding arms at all.

In combination with #33544 this makes unoptimized MIR trans of
nickel.rs as fast as using old trans and greatly improves the times for
optimized builds, which are only 30-40% slower instead of ~300%.

cc #33111
2016-05-14 11:57:48 +02:00
Manish Goregaokar
f5462013ee Rollup merge of #33560 - eddyb:symtidy, r=alexcrichton
Use symlink_metadata in tidy to avoid panicking on broken symlinks.

r? @alexcrichton
2016-05-14 11:57:48 +02:00
Manish Goregaokar
8bc265bdd1 Rollup merge of #33555 - soltanmm:ambiguous-nixon, r=nikomatsakis
Remove unification despite ambiguity in projection

Turns out that closures aren't explicitly considered in `project.rs`, so the ambiguity handling w.r.t. closures can just be removed as the change done in `select.rs` covers it.

r? @nikomatsakis
2016-05-14 11:57:48 +02:00
Manish Goregaokar
4a1ce9831c Rollup merge of #33554 - sfackler:no-current-exe, r=alexcrichton
Don't use env::current_exe with libbacktrace

If the path we give to libbacktrace doesn't actually correspond to the
current process, libbacktrace will segfault *at best*.

cc #21889

r? @alexcrichton
cc @semarie
2016-05-14 11:57:47 +02:00