Commit Graph

68272 Commits

Author SHA1 Message Date
Lucas Morales
f7fd04ae65
docs improvement sync::atomic::Atomic* 2017-09-25 19:39:52 -04:00
bors
82ae9682ca Auto merge of #44297 - laumann:suggest-misspelt-methods, r=arielb1
Add suggestions for misspelled method names

Use the syntax::util::lev_distance module to provide suggestions when a
named method cannot be found.

Part of #30197
2017-09-25 23:09:06 +00:00
bors
6c476ce462 Auto merge of #44279 - smaeul:crt_static-deps, r=alexcrichton
Require rlibs for dependent crates when linking static executables

This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case).

On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing.

This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
2017-09-25 20:37:02 +00:00
Esteban Küber
9c3fa4d3ef Point at signature on unused lint 2017-09-25 13:25:54 -07:00
Simon Sapin
20d4c0fab4 Move src/librustc_mir/transform/nll.rs to a subdirectory 2017-09-25 20:06:03 +02:00
bors
3df1f7b82d Auto merge of #44085 - bjorn3:no_llvm_write_metadata, r=arielb1
Allow writing metadata without llvm

# Todo:

* [x] Rebase
* [x] Fix eventual errors
* [x] <strike>Find some crate to write elf files</strike> (will do it later)

Cc #43842
2017-09-25 18:05:22 +00:00
steveklabnik
3db0094359 Improve wording for StepBy
No other iterator makes the distinction between an iterator and an iterator adapter
in its summary line, so change it to be consistent with all other adapters.
2017-09-25 11:41:39 -04:00
Douglas Campos
9d52cb2f84 those changes break miri, PR will be issued later 2017-09-25 09:51:51 -04:00
Douglas Campos
043d873b32 fix tidy errors 2017-09-25 09:50:37 -04:00
Douglas Campos
119882eaa5 add comment per @nikomatsakis request 2017-09-25 09:50:37 -04:00
Douglas Campos
c900abf42d expose ParamEnv as a param 2017-09-25 09:50:37 -04:00
Douglas Campos
77d3ca1bad add ParamEnv to the trait_cache key 2017-09-25 09:50:37 -04:00
Guillaume Gomez
d5d41f2a3c Add missing links in fmt module 2017-09-25 15:41:16 +02:00
bors
91dbf52af3 Auto merge of #44809 - arielb1:small-scope, r=eddyb
encode region::Scope using fewer bytes

Now that region::Scope is no longer interned, its size is more important. This PR encodes region::Scope in 8 bytes instead of 12, which should speed up region inference somewhat (perf testing needed) and should improve the margins on #36799 by 64MB (that's not a lot, I did this PR mostly to speed up region inference).

This is a perf-sensitive PR. Please don't roll me up.

r? @eddyb

This is based on  #44743 so I could get more accurate measurements on #36799.
2017-09-25 12:52:02 +00:00
Felix S. Klock II
e319f4093c Remove now dead code. 2017-09-25 14:02:39 +02:00
Felix S. Klock II
d9d10c1628 Make mir-borrowck more closely match (draft) NLL RFC.
In particular:

 * introduce the shallow/deep distinction for read/write accesses

 * use the notions of prefixes, shallow prefixes, and supporting prefixes
   rather than trying to recreate the restricted sets from ast-borrowck.

 * Add shallow reads of Discriminant and ArrayLength, and treat them
   as artificial fields when doing prefix traversals.
2017-09-25 14:02:34 +02:00
Felix S. Klock II
c4c32b24bd More fine-grained delineation for mir-borrowck errors. 2017-09-25 13:02:17 +02:00
Ariel Ben-Yehuda
7bb0923e46 fix Debug impls 2017-09-25 13:47:19 +03:00
bors
dcb4378e18 Auto merge of #44646 - petrochenkov:scompress, r=michaelwoerister
Compress most of spans to 32 bits

As described in https://internals.rust-lang.org/t/rfc-compiler-refactoring-spans/1357/28

Closes https://github.com/rust-lang/rust/issues/15594
r? @michaelwoerister
2017-09-25 09:01:53 +00:00
David Tolnay
247b58b4f4
Allow unused extern crate again
This is a partial revert of #42588. There is a usability concern
reported in #44294 that was not considered in the discussion of the PR,
so I would like to back this out of 1.21. As is, I think users would
have a worse and more confusing experience with this lint enabled by
default. We can re-enabled once there are better diagnostics or the case
in #44294 does not trigger the lint.
2017-09-24 23:57:45 -07:00
bjorn3
843cd5bacc Fix error 2017-09-25 08:17:37 +02:00
David Tolnay
874124b2c7
Backport libs stabilizations to 1.21 beta
This includes the following stabilizations:

- tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563
- iterator_for_each https://github.com/rust-lang/rust/pull/44567
- ord_max_min https://github.com/rust-lang/rust/pull/44593
- compiler_fences https://github.com/rust-lang/rust/pull/44595
- needs_drop https://github.com/rust-lang/rust/pull/44639
- vec_splice https://github.com/rust-lang/rust/pull/44640
2017-09-24 22:27:39 -07:00
bors
cd93969ec4 Auto merge of #44612 - pylaligand:magenta-to-zircon, r=alexcrichton
The Magenta kernel is now called Zircon.
2017-09-25 05:05:14 +00:00
James Tucker
a3aef1aa95 Fix fuchsia toolchain prebuild setup
* Adjust bootstrap to provide useful output on failure
 * Add missing package dependencies in the build environment
 * Fix permission bits on prebuilt toolchain files
2017-09-24 21:32:27 -07:00
bors
7a9cdc4c2a Auto merge of #44700 - arielb1:mir-effectck, r=nikomatsakis
Move effect-checking to MIR

This allows emitting lints from MIR and moves the effect-checking pass to work on it.

I'll make `repr(packed)` misuse unsafe in a separate PR.

r? @eddyb
2017-09-25 00:52:15 +00:00
James Tucker
d7a17fb3cf LP_CLONE_FDIO_ROOT is now LP_CLONE_FDIO_NAMESPACE 2017-09-24 14:31:50 -07:00
James Tucker
c481f85dc2 ensure that prebuilt toolchain binaries are +x 2017-09-24 13:55:55 -07:00
Petr Hosek
992e94ab3b Re-add CMake package
This appears to be needed by the Rust build.
2017-09-24 13:55:55 -07:00
Petr Hosek
1fdbfa9930 Use Zircon's Clang rather than building our own
This toolchain is already used to build Zircon itself and is the
official Clang toolchain used by all Fuchsia developers.
2017-09-24 13:55:55 -07:00
James Tucker
0ef87cc109 bump liblibc to 0.2.31 2017-09-24 13:53:11 -07:00
Petr Hosek
850c7cbbf1 Download clang-tools-extra as well 2017-09-24 13:53:10 -07:00
Petr Hosek
6c08208c31 Install unzip into Fuchsia Docker container 2017-09-24 13:53:10 -07:00
P.Y. Laligand
e98e674570 TODO --> FIXME 2017-09-24 13:53:10 -07:00
P.Y. Laligand
d0ff222d0f Update submodules. 2017-09-24 13:53:10 -07:00
Petr Hosek
ae0cf7fd5f Update Fuchsia toolchain build
compiler-rt is now being built as part of the toolchain itself.
2017-09-24 13:53:10 -07:00
P.Y. Laligand
20265ef3ac Updated Zircon version. 2017-09-24 13:53:10 -07:00
P.Y. Laligand
cc4e82fe7a Fixed casing issues. 2017-09-24 13:53:10 -07:00
P.Y. Laligand
de3bb916d8 Testing on Travis. 2017-09-24 13:53:10 -07:00
P.Y. Laligand
43cff131dd The Magenta kernel is now called Zircon. 2017-09-24 13:53:10 -07:00
bors
48c1c548e1 Auto merge of #44758 - arielb1:a-small-path, r=eddyb
put empty generic lists behind a pointer

This reduces the size of hir::Expr from 128 to 88 bytes (!) and shaves
200MB out of #36799.

This is a performance-sensitive PR so please don't roll it up.

r? @eddyb
2017-09-24 19:48:11 +00:00
Esteban Küber
ddee9fbc99 Point at parameter type on E0301
On "the parameter type `T` may not live long enough" error, point to the
parameter type suggesting lifetime bindings:

```
error[E0310]: the parameter type `T` may not live long enough
  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
   |
27 | struct Foo<T> {
   |            - help: consider adding an explicit lifetime bound `T: 'static`...
28 |     foo: &'static T
   |     ^^^^^^^^^^^^^^^
   |
note: ...so that the reference type `&'static T` does not outlive the data it points at
  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
   |
28 |     foo: &'static T
   |     ^^^^^^^^^^^^^^^
```
2017-09-24 11:50:09 -07:00
Thomas Jespersen
4963394f86 Change Levensthein-based method to a single suggestion
The convention for suggesting close matches is to provide at most one match (the
closest one). Change the suggestions for misspelt method names to obey that.
2017-09-24 20:00:02 +02:00
Steven Fackler
81bac74c2d Add a run-pass-valgrind test for vecdeque issue 2017-09-24 10:56:08 -07:00
Ethan Dagner
bc43e17392 Add doc example to HashMap::hasher 2017-09-24 10:29:37 -06:00
bors
1ed7d41d88 Auto merge of #44743 - arielb1:size-rollback, r=eddyb
typeck::check::coercion - roll back failed unsizing type vars

This wraps unsizing coercions within an additional level of
`commit_if_ok`, which rolls back type variables if the unsizing coercion
fails. This prevents a large amount of type-variables from accumulating
while type-checking a large function, e.g. shaving 2GB off one of the
4GB peaks in #36799.

This is a performance-sensitive PR so please don't roll it up.

r? @eddyb
cc @nikomatsakis
2017-09-24 15:41:13 +00:00
Ariel Ben-Yehuda
c10b23e2e0 encode region::Scope using fewer bytes
Now that region::Scope is no longer interned, its size is more
important. This PR encodes region::Scope in 8 bytes instead of 12, which
should speed up region inference somewhat (perf testing needed) and
should improve the margins on #36799 by 64MB (that's not a lot, I did
this PR mostly to speed up region inference).
2017-09-24 17:21:37 +03:00
Ariel Ben-Yehuda
8214ab1662 move Scope behind an enum 2017-09-24 16:13:54 +03:00
bors
647aecc281 Auto merge of #44807 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 4 pull requests

- Successful merges: #44103, #44625, #44789, #44795
- Failed merges:
2017-09-24 12:20:21 +00:00
Guillaume Gomez
a8a0ec2a28 Rollup merge of #44795 - KiChjang:mir-err-notes, r=arielb1
MIR borrowck: Add span labels for E0381 and E0505

Corresponds to `report_use_of_moved` and `report_move_out_when_borrowed`.

Part of #44596.
2017-09-24 14:01:52 +02:00
Guillaume Gomez
4e377081ca Rollup merge of #44789 - GuillaumeGomez:fix-rustdoc-display, r=QuietMisdreavus
Fix warning position in rustdoc code blocks

Before:

<img width="1440" alt="screen shot 2017-09-23 at 14 07 08" src="https://user-images.githubusercontent.com/3050060/30773382-b9649288-a06f-11e7-94ec-faa3c3ed999b.png">

After:

<img width="1440" alt="screen shot 2017-09-23 at 14 58 31" src="https://user-images.githubusercontent.com/3050060/30773384-bdfc9f3e-a06f-11e7-9030-9fb8a5308668.png">

r? @QuietMisdreavus
2017-09-24 14:01:51 +02:00