Commit Graph

66105 Commits

Author SHA1 Message Date
Simon Sapin
ff7f220a43 Don’t create NonZero(0) in test/ui/print_type_sizes/nullable.rs 2017-07-22 20:38:40 +02:00
Simon Sapin
f732911cf5 Fix unstable feature name for some impls for Unique<T> 2017-07-22 20:38:40 +02:00
Simon Sapin
1ba8b15321 Use safe conversion instead of unsafe constructor in issue-23433 test 2017-07-22 20:38:40 +02:00
Simon Sapin
06e130fb24 Use checked NonZero constructor in MIR move path indices
… to protect against UB in the unlikely case that `idx + 1` overflows.
2017-07-22 20:38:40 +02:00
Simon Sapin
13d17adf60 Use checked NonZero constructor in obligation forest NodeIndex
… to remove an `unsafe` block.
2017-07-22 20:38:40 +02:00
Simon Sapin
938552a228 Use checked NonZero constructor instead of explicit null check in btree 2017-07-22 20:38:40 +02:00
Simon Sapin
a4edae95ad Add conversions from references to NonZero pointers, Unique, and Shared 2017-07-22 20:38:40 +02:00
Simon Sapin
cbd2b6b484 Add Box::into_unique 2017-07-22 20:38:40 +02:00
Simon Sapin
1ef24bb3e2 Implement From<Unique<T>> for Shared<T> 2017-07-22 20:38:40 +02:00
Simon Sapin
ddaf9b24f0 Rename {NonZero,Shared,Unique}::new_checked to new 2017-07-22 20:38:39 +02:00
Simon Sapin
0a08ad0443 Rename {NonZero,Shared,Unique}::new to new_unchecked 2017-07-22 20:38:16 +02:00
Simon Sapin
e9af03a222 Add new_checked(…) -> Option<Self> to NonZero, Unique, and Shared. 2017-07-22 20:37:52 +02:00
bors
8d22af87d8 Auto merge of #43059 - Mark-Simulacrum:rustbuild-2.0, r=alexcrichton
Rework Rustbuild to an eagerly compiling approach

This introduces a new dependency on `serde`; I don't believe that's a problem since bootstrap is compiled with nightly/beta always so proc macros are available. Compile times are slightly longer -- about 2-3x (30 seconds vs. 10 seconds). I don't think this is too big a problem, especially since recompiling bootstrap is somewhat rare. I think we can remove the dependency on Serde if necessary, though, so let me know.

r? @alexcrichton
2017-07-22 18:27:29 +00:00
mandeep
ae7b1f9f2c Add generic example of std::ops::Sub in doc comments 2017-07-22 12:48:32 -05:00
Mark Simulacrum
1c118231ad Make distcheck work again. 2017-07-22 10:48:29 -06:00
bors
f8d485f53d Auto merge of #43367 - alexcrichton:remove-inline-always, r=sfackler
std: Cut down #[inline] annotations where not necessary

This PR cuts down on a large number of `#[inline(always)]` and `#[inline]`
annotations in libcore for various core functions. The `#[inline(always)]`
annotation is almost never needed and is detrimental to debug build times as it
forces LLVM to perform inlining when it otherwise wouldn't need to in debug
builds. Additionally `#[inline]` is an unnecessary annoation on almost all
generic functions because the function will already be monomorphized into other
codegen units and otherwise rarely needs the extra "help" from us to tell LLVM
to inline something.

Overall this PR cut the compile time of a [microbenchmark][1] by 30% from 1s to
0.7s.

[1]: https://gist.github.com/alexcrichton/a7d70319a45aa60cf36a6a7bf540dd3a
2017-07-22 16:06:12 +00:00
Mark Simulacrum
8f2e576cb3 Add make_run to distcheck. 2017-07-22 07:35:42 -06:00
bors
35f64996ad Auto merge of #43352 - estebank:macro-span-replacement, r=petrochenkov
Use the macro structure spans instead of the invocation

Fix #42104, CC #2887.
2017-07-22 13:30:19 +00:00
Mark Simulacrum
d302c18937 Fix StartupObject build 2017-07-22 05:50:55 -06:00
bors
e49a9483de Auto merge of #43344 - tlively:wasm-debug, r=alexcrichton
Pass debugging arguments to emcc

Tells emcc to enable assertions and debugging information for
wasm32-experimental-emscripten. This makes the codegen issues caused by
LLVM bug 33824 manifest more frequently at runtime and improves the wasm
debugging experience.
2017-07-22 11:02:49 +00:00
Andrew Cann
c0fa16afc9 Add !: Clone impl 2017-07-22 17:21:05 +08:00
bors
066a0ae99b Auto merge of #43343 - petrochenkov:methlife3, r=estebank
Add an extra note to `late_bound_lifetime_arguments` error/lint

Fixes https://github.com/rust-lang/rust/issues/42868#issuecomment-316368538
2017-07-22 08:36:11 +00:00
bors
f0b07cac2f Auto merge of #43323 - perryprog:master, r=estebank
Less verbose output for unused arguments

Closes #37718

This is my first contribution to rust, so sorry if I'm missing anything!

The output now looks like this:
<img width="831" alt="screen shot 2017-07-18 at 5 01 32 pm" src="https://user-images.githubusercontent.com/12972285/28347566-dbfa9962-6c05-11e7-8730-c2e8062a04cc.png">

It's not the prettiest, but whenever #41850 gets resolved, this should be able to be improved.

**EDIT:** This also does not seem
r? @Mark-Simulacrum
2017-07-22 04:41:10 +00:00
Nick Cameron
f6f03639b1 Gate signatures on the config 2017-07-22 16:35:40 +12:00
Nick Cameron
52e9f2035a Use config::pub_only rather than a spearate api mode 2017-07-22 16:35:40 +12:00
Nick Cameron
4d81e8bb22 Use Config::full_docs to trim documentation 2017-07-22 16:35:40 +12:00
Nick Cameron
84d93a4edd Use a config file with save-analysis
Replaces the output path env var. Can be passed to save-analysis via a function call or env var.
2017-07-22 16:35:40 +12:00
bors
68be86d032 Auto merge of #42973 - zackmdavis:json_byte_position_to_start_at_top_of_file, r=nrc
make JSON error byte position start at top of file

The `hi` and `lo` offsets in a span are relative to a `CodeMap`, but this
doesn't seem to be terribly useful for tool consumers who don't have the
codemap, but might want the byte offset within an actual file?

I couldn't get @killercup's [example](https://github.com/rust-lang/rust/issues/35164#issuecomment-301436519) to run, perhaps due to the limitations of the merely-stage-1 compiler that I built (error was `libproc_macro-456500c7095d8fbe.so: cannot open shared object file: No such file or directory`)??—but a dummy project confirms that the byte offsets have successfully been changed to be file-relative—

**Before:**

```
$ cargo run --message-format json
   Compiling byte_json v0.1.0 (file:///home/ubuntu/byte_json)
{"message":{"children":[{"children":[],"code":null,"level":"note","message":"#[warn(dead_code)] on by default","rendered":null,"spans":[]}],"code":null,"level":"warning","message":"function is never used: `rah`","rendered":null,"spans":[{"byte_end":100,"byte_start":67,"column_end":2,"column_start":1,"expansion":null,"file_name":"src/foo.rs","is_primary":true,"label":null,"line_end":5,"line_start":3,"suggested_replacement":null,"text":[{"highlight_end":11,"highlight_start":1,"text":"fn rah() {"},{"highlight_end":21,"highlight_start":1,"text":"    println!(\"rah!\")"},{"highlight_end":2,"highlight_start":1,"text":"}"}]}]},"package_id":"byte_json 0.1.0 (path+file:///home/ubuntu/byte_json)","reason":"compiler-message","target":{"crate_types":["bin"],"kind":["bin"],"name":"byte_json","src_path":"/home/ubuntu/byte_json/src/main.rs"}}
{"message":{"children":[{"children":[],"code":null,"level":"note","message":"#[warn(dead_code)] on by default","rendered":null,"spans":[]}],"code":null,"level":"warning","message":"function is never used: `alas`","rendered":null,"spans":[{"byte_end":137,"byte_start":102,"column_end":2,"column_start":1,"expansion":null,"file_name":"src/bar.rs","is_primary":true,"label":null,"line_end":3,"line_start":1,"suggested_replacement":null,"text":[{"highlight_end":12,"highlight_start":1,"text":"fn alas() {"},{"highlight_end":22,"highlight_start":1,"text":"    println!(\"alas\");"},{"highlight_end":2,"highlight_start":1,"text":"}"}]}]},"package_id":"byte_json 0.1.0 (path+file:///home/ubuntu/byte_json)","reason":"compiler-message","target":{"crate_types":["bin"],"kind":["bin"],"name":"byte_json","src_path":"/home/ubuntu/byte_json/src/main.rs"}}
{"features":[],"filenames":["/home/ubuntu/byte_json/target/debug/byte_json"],"fresh":false,"package_id":"byte_json 0.1.0 (path+file:///home/ubuntu/byte_json)","profile":{"debug_assertions":true,"debuginfo":2,"opt_level":"0","overflow_checks":true,"test":false},"reason":"compiler-artifact","target":{"crate_types":["bin"],"kind":["bin"],"name":"byte_json","src_path":"/home/ubuntu/byte_json/src/main.rs"}}
    Finished dev [unoptimized + debuginfo] target(s) in 0.36 secs
     Running `target/debug/byte_json`
Hello, world!
```

**After:**

```
$ RUSTC=../rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc cargo run --message-format json
   Compiling byte_json v0.1.0 (file:///home/ubuntu/byte_json)
{"message":{"children":[{"children":[],"code":null,"level":"note","message":"#[warn(dead_code)] on by default","rendered":null,"spans":[]}],"code":null,"level":"warning","message":"function is never used: `rah`","rendered":null,"spans":[{"byte_end":35,"byte_start":2,"column_end":2,"column_start":1,"expansion":null,"file_name":"src/foo.rs","is_primary":true,"label":null,"line_end":5,"line_start":3,"suggested_replacement":null,"text":[{"highlight_end":11,"highlight_start":1,"text":"fn rah() {"},{"highlight_end":21,"highlight_start":1,"text":"    println!(\"rah!\")"},{"highlight_end":2,"highlight_start":1,"text":"}"}]}]},"package_id":"byte_json 0.1.0 (path+file:///home/ubuntu/byte_json)","reason":"compiler-message","target":{"crate_types":["bin"],"kind":["bin"],"name":"byte_json","src_path":"/home/ubuntu/byte_json/src/main.rs"}}
{"message":{"children":[{"children":[],"code":null,"level":"note","message":"#[warn(dead_code)] on by default","rendered":null,"spans":[]}],"code":null,"level":"warning","message":"function is never used: `alas`","rendered":null,"spans":[{"byte_end":35,"byte_start":0,"column_end":2,"column_start":1,"expansion":null,"file_name":"src/bar.rs","is_primary":true,"label":null,"line_end":3,"line_start":1,"suggested_replacement":null,"text":[{"highlight_end":12,"highlight_start":1,"text":"fn alas() {"},{"highlight_end":22,"highlight_start":1,"text":"    println!(\"alas\");"},{"highlight_end":2,"highlight_start":1,"text":"}"}]}]},"package_id":"byte_json 0.1.0 (path+file:///home/ubuntu/byte_json)","reason":"compiler-message","target":{"crate_types":["bin"],"kind":["bin"],"name":"byte_json","src_path":"/home/ubuntu/byte_json/src/main.rs"}}
{"features":[],"filenames":["/home/ubuntu/byte_json/target/debug/byte_json"],"fresh":false,"package_id":"byte_json 0.1.0 (path+file:///home/ubuntu/byte_json)","profile":{"debug_assertions":true,"debuginfo":2,"opt_level":"0","overflow_checks":true,"test":false},"reason":"compiler-artifact","target":{"crate_types":["bin"],"kind":["bin"],"name":"byte_json","src_path":"/home/ubuntu/byte_json/src/main.rs"}}
    Finished dev [unoptimized + debuginfo] target(s) in 2.59 secs
     Running `target/debug/byte_json`
Hello, world!
```

Resolves #35164.

r? @jonathandturner
2017-07-22 02:16:00 +00:00
Josh Stone
5c6ccdc37c Correct the spelling of "homogeneous" 2017-07-21 18:08:40 -07:00
Zack M. Davis
bb2b8630f5 run-make test for JSON error byte start/end
This is in the matter of #35164.
2017-07-21 16:50:44 -07:00
Zack M. Davis
6043ce9f75 make JSON error byte position start at top of file
The `hi` and `lo` offsets in a span are relative to a `CodeMap`, but this
doesn't seem to be terribly useful for tool consumers who don't have the
codemap, but might want the byte offset within an actual file?

Resolves #35164.
2017-07-21 16:50:44 -07:00
Esteban Küber
6772661f37 Review comments 2017-07-21 16:49:09 -07:00
bors
504328a31a Auto merge of #43274 - bitshifter:union-align, r=petrochenkov
Support repr alignment on unions.

Requested as part of RFC 1358 https://github.com/rust-lang/rust/issues/33626#issuecomment-309137284.
2017-07-21 23:46:05 +00:00
Perry Fraser
5c10db3f94 More tests 2017-07-21 18:11:44 -04:00
Alex Crichton
38e40ce506 Relax a codegen test to be compatible with LLVM 5.0 2017-07-21 14:15:09 -07:00
bors
15aa15b03f Auto merge of #43319 - SimonSapin:cargoup, r=alexcrichton
Update Cargo to ffab51954ec32d55631c37a8730bb24915fc090b

https://github.com/rust-lang/cargo/pull/4123 added the `[patch]` section of the manifest
2017-07-21 20:57:37 +00:00
Alex Crichton
fb217afe86 Fix archive member names on 5.0 2017-07-21 19:09:11 +02:00
Alex Crichton
b022d54641 update attributes API usage 2017-07-21 19:09:10 +02:00
Tim Neumann
1ee87b3765 rustllvm: split DebugLoc in UnpackOptimizationDiagnostic 2017-07-21 19:09:10 +02:00
bors
6c949655de Auto merge of #43313 - pftbest:fix_asm, r=alexcrichton
[LLVM] Fix an assertion when a weak symbol is defined in global_asm.

This change will fix the issue from
https://github.com/japaric/svd2rust/pull/130

cc @japaric
r? @alexcrichton
2017-07-21 15:42:17 +00:00
Tim Neumann
a53676762b rustllvm: update to SyncScope::ID 2017-07-21 14:32:00 +02:00
Tim Neumann
48424c9749 rustllvm: adjust usage of createNameSpace 2017-07-21 14:31:54 +02:00
Tim Neumann
5f9e432534 rustllvm: adjust usage of createPointerType 2017-07-21 14:31:51 +02:00
Tim Neumann
2c9c8dc5f4 rustllvm: use LLVMMetadataRef 2017-07-21 14:31:46 +02:00
Tim Neumann
c9787296f8 rustllvm: define LLVM_VERSION_LT 2017-07-21 14:31:17 +02:00
Oliver Schneider
401ab612c2 Adjust new suggestions to the suggestion guidelines 2017-07-21 13:59:17 +02:00
Segev Finer
c41ac2e11a rustbuild: Fix the --build argument to bootstrap.py
This makes the --build argument also apply for the downloading of the
stage0 toolchain and building rustbuild.

Fixes #42116
2017-07-21 14:18:35 +03:00
MaulingMonkey
90a7cac8c8 *.natvis: Use s8 postfixes to correctly interpret rust strings as UTF-8. 2017-07-21 03:39:56 -07:00
Simon Sapin
b77ff24060 Update Cargo to ffab51954ec32d55631c37a8730bb24915fc090b
https://github.com/rust-lang/cargo/pull/4123 added the [patch] section of the manifest
2017-07-21 11:13:18 +02:00
Mátyás Mustoha
9ca2fd0d90 Ignore stack probe tests on AArch64 2017-07-21 10:21:42 +02:00