Commit Graph

83484 Commits

Author SHA1 Message Date
Niko Matsakis
8eb789f4c7 region_infer.rs: add some debug! 2018-09-07 16:41:15 -04:00
Eduard-Mihai Burtescu
e0e7cf303b rustc_resolve: only prepend CrateRoot to a non-keyword segment. 2018-09-07 23:23:51 +03:00
steveklabnik
de6a61110c update books for next release 2018-09-07 15:30:35 -04:00
bors
fc81e36242 Auto merge of #53327 - wesleywiser:wip_optimize_nll, r=nikomatsakis
[nll] teach SCC about `'static`

r? @nikomatsakis

I think this is right? I am seeing better performance on the `html5ever` benchmark but I'd like a perf run to quantify the exact speedup. There's a few ui tests failing due to changes in the error messages. The main issue seems to be that returns aren't being detected correctly?

`mir_check_cast_unsize.rs` before:

```
error: unsatisfied lifetime constraints
  --> mir_check_cast_unsize.rs:17:46
   |
17 |   fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
   |  ________--____________________________________^
   | |        |
   | |        lifetime `'a` defined here
18 | |     //~^ ERROR unsatisfied lifetime constraints
19 | |     x
20 | |     //~^ WARNING not reporting region error due to nll
21 | | }
   | |_^ return requires that `'a` must outlive `'static`
```

`mir_check_cast_unsize.rs` after:

```
error: unsatisfied lifetime constraints
  --> mir_check_cast_unsize.rs:19:5
   |
17 | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
   |        -- lifetime `'a` defined here
18 |     //~^ ERROR unsatisfied lifetime constraints
19 |     x
   |     ^ cast requires that `'a` must outlive `'static`
```
2018-09-07 17:56:23 +00:00
Niko Matsakis
ab43c1e9a4 add const_fn feature 2018-09-07 13:28:23 -04:00
Jordan Rhee
54a16aea6a Fix tidy errors 2018-09-07 08:41:16 -07:00
Niko Matsakis
e5e72f6666 switch back to using a plain u32, not NonZeroU32
This reverts (part of) commit cb9a336ae2cf6a75fdcc130853286349cb424c96.
2018-09-07 11:37:47 -04:00
Niko Matsakis
ec0ad09059 use a BTreeSet for a more stable error message order 2018-09-07 11:37:47 -04:00
Niko Matsakis
3805ebeeb9 remove use of from_u32_unchecked 2018-09-07 11:37:47 -04:00
Niko Matsakis
3b6361d29d switch to using NonZeroU32 to represent indices 2018-09-07 11:37:47 -04:00
Niko Matsakis
f702bd6a52 rewrite constants to use NewType::MAX instead of u32::MAX
Also, adjust the MAX to be `u32::MAX - 1`, leaving room for `u32::MAX`
to become a sentinel value in the future.
2018-09-07 11:37:47 -04:00
Niko Matsakis
c67d518b0d add various #[inline] directives 2018-09-07 11:37:47 -04:00
Niko Matsakis
24ab3758a6 remove all references to private from outside the macro 2018-09-07 11:37:47 -04:00
Niko Matsakis
6ccf9b8134 change from tuple struct to brace struct 2018-09-07 11:37:47 -04:00
Niko Matsakis
5aee959e9f make field always private, add From impls 2018-09-07 11:37:46 -04:00
Niko Matsakis
c46f185f67 add a comment 2018-09-07 11:34:41 -04:00
Niko Matsakis
1242639b88 change syntax of newtype_index to look like a struct decl 2018-09-07 11:34:41 -04:00
Jordan Rhee
b081a49a07 Removed hardcoded paths and unnecessary LLVM features 2018-09-07 08:34:24 -07:00
Marc-Antoine Perennou
ef44068613 rustbuild: allow configuring llvm version suffix
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-09-07 17:33:45 +02:00
Alex Crichton
0c89243fd3 Fix compiling some rustc crates to wasm
I was dabbling recently seeing what it would take to compile `rustfmt` to the
`wasm32-unknown-unknown` target and it turns out not much effort is needed!
Currently `rustfmt` depends on a few rustc crates published to crates.io, so
this commit touches up those crates to compile for wasm themselves. Notably:

* The `rustc_data_structures` crate's `flock` implementation is stubbed out to
  unconditionally return errors on unsupported platforms.
* The `rustc_errors` crate is extended to not do any locking for all non-windows
  platforms.

In both of these cases if we port the compiler to new platforms the
functionality isn't critical but will be discovered over time as it comes up, so
this hopefully doesn't make it too too hard to compile to new platforms!
2018-09-07 08:17:02 -07:00
bors
24ef47bccf Auto merge of #53893 - petrochenkov:cfgexpr, r=pnkfelix
Validate syntax of `cfg` attributes

Fixes https://github.com/rust-lang/rust/issues/53298
2018-09-07 15:14:52 +00:00
Tom Tromey
8aae6ca44a Have rust-lldb look for the rust-enabled lldb
We're shipping a rust-enabled lldb, but the "lldb" executable is not
installed into the "bin" directory by rustup.  See the discussion in
https://github.com/rust-lang-nursery/rustup.rs/pull/1492 for
background on this decision.  There, we agreed to have rust-lldb
prefer the rust-enabled lldb if it is installed.

This patch changes dist.rs to put lldb into rustlib, following what
was done for the other LLVM tools in #53955, and then fixes rust-lldb
to prefer that lldb, if it exists.

See issue #48168
2018-09-07 09:13:47 -06:00
ljedrz
8bbe1789fa A few cleanups and minor improvements to rustc_passes 2018-09-07 15:10:16 +02:00
bors
5a3292f163 Auto merge of #54021 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #53299 (Updated core/macros.rs to note it works in a no_std environment.)
 - #53376 (Cross reference io::copy and fs::copy in docs.)
 - #53455 (Individual docs for {from,to}_*_bytes)
 - #53550 (librustc_lint: In recursion warning, change 'recurring' to 'recursing')
 - #53860 (Migrate (some) of run-pass/ to ui)
 - #53874 (Implement Unpin for Box, Rc, and Arc)
 - #53895 (tidy: Cleanups and clippy warning fixes)
 - #53946 (Clarify `ManuallyDrop` docs)
 - #53948 (Minimized clippy test from when NLL disabled two-phase borrows)
 - #53959 (Add .git extension to submodule paths missing it)
 - #53966 (A few cleanups and minor improvements to mir/dataflow)
 - #53967 (propagate build.python into cmake)
 - #53979 (Remove `#[repr(transparent)]` from atomics)
 - #53991 (Add unchecked_shl/shr check for intrinsics to fix miri's test suit)
 - #53992 (migrate run-pass/borrowck to ui/run-pass)
 - #53994 (migrate run-pass/*/ to ui/run-pass)
 - #54023 (update clippy submodule)
2018-09-07 12:48:20 +00:00
Jorge Aparicio
358fc5b621 stabilize #[panic_handler] 2018-09-07 13:27:30 +02:00
kennytm
87fbf54413
Rollup merge of #54023 - matthiaskrgr:clippy, r=oli-obk
update clippy submodule

updates to cafef7b576
2018-09-07 18:14:28 +08:00
kennytm
ba57ef116f
Rollup merge of #53994 - pnkfelix:issue-53764-migrate-run-pass-dirs-to-ui, r=alexcrichton
migrate run-pass/*/ to ui/run-pass

I think this is all that remains of #53764
2018-09-07 18:14:05 +08:00
kennytm
12b382648e
Rollup merge of #53992 - pnkfelix:issue-53764-migrate-run-pass-borrowck-to-ui, r=nikomatsakis
migrate run-pass/borrowck to ui/run-pass

Part of #53764
2018-09-07 18:14:02 +08:00
kennytm
dcca8e86b1
Rollup merge of #53991 - TimDiekmann:fix-unchecked-intrinsics, r=oli-obk
Add unchecked_shl/shr check for intrinsics to fix miri's test suit

r? @RalfJung

cc @oli-obk

#53697 broke miri's test suite as described in [this comment](https://github.com/rust-lang/rust/pull/53697#issuecomment-419034668). This PR adds test for the `unchecked_shr/shl` for the intrinsics.
2018-09-07 18:13:59 +08:00
kennytm
9b70ef7780
Rollup merge of #53979 - alexcrichton:remove-repr-transparent-atomics-master, r=sfackler
Remove `#[repr(transparent)]` from atomics

Added in #52149 the discussion in #53514 is showing how we may not want to
actually add this attribute to the atomic types. While we continue to
debate #53514 this commit reverts the addition of the `transparent` attribute.
This should be a more conservative route which leaves us the ability to tweak
this in the future but in the meantime allows us to continue discussion as well.
2018-09-07 18:13:57 +08:00
kennytm
1681b154ee
Rollup merge of #53967 - froydnj:cmake-python-executable, r=alexcrichton
propagate build.python into cmake

If a suitable value of Python is not on `PATH`, one can still invoke x.py
manually, which propagates `BOOTSTRAP_PYTHON` into the bootstrap
environment.  But building LLVM will abort with error messages about not
being able to find Python, and instructions to set `PYTHON_EXECUTABLE`,
because nothing is done with `BOOTSTRAP_PYTHON` when invoking cmake.
Setting `build.python` in config.toml had no effect in this scenario,
either

To fix this, let's provide `PYTHON_EXECUTABLE` when invoking cmake; for
the "normal" case of Python in `PATH`, this doesn't alter any behavior.
For more unusual cases, however, this ensures cmake finds Python
properly.  (This change also ensures there are no differences between
what bootstrap is using, and what cmake uses, which may be useful for
consistency's sake.)
2018-09-07 18:13:55 +08:00
kennytm
776b90cee2
Rollup merge of #53966 - ljedrz:mir_dataflow_cleanups, r=estebank
A few cleanups and minor improvements to mir/dataflow

- simplify `dot::GraphWalk::edges` and optimize its vector's allocation
- turn a `kill` loop into `kill_all`
- remove the `prepost` parameter from `dataflow_path` (it doesn't seem to do anything)
- a couple of other minor improvements
2018-09-07 18:13:52 +08:00
kennytm
7e9fb78962
Rollup merge of #53959 - tlively:fix-submodules, r=alexcrichton
Add .git extension to submodule paths missing it

Fixes a problem where submodules could not be cloned under some git
configurations. Specifically, when url.git@github.com:.insteadOf =
https://github.com/ is set.
2018-09-07 18:13:50 +08:00
kennytm
d70e055b66
Rollup merge of #53948 - pnkfelix:issue-52934-minimize-clippy-test, r=wesleywiser
Minimized clippy test from when NLL disabled two-phase borrows

(Of course anyone even skimming the test will realize that this is an *expansion* of a previously posted [minimization](https://github.com/rust-lang/rust/issues/52934#issuecomment-418144787).)

Fix #52934.
2018-09-07 18:13:47 +08:00
kennytm
03de1c44d1
Rollup merge of #53946 - tbu-:pr_doc_manuallydrop, r=cramertj
Clarify `ManuallyDrop` docs

Mention that you can use `into_inner` to drop the contained value.
2018-09-07 18:13:42 +08:00
bors
7366752a61 Auto merge of #53830 - davidtwco:issue-53228, r=nikomatsakis
Add help message for missing IndexMut impl with NLL

Fixes #53228.

r? @nikomatsakis
2018-09-07 09:57:27 +00:00
kennytm
d2a0f98159
Rollup merge of #53895 - joshtriplett:tidy-tidy, r=nikomatsakis
tidy: Cleanups and clippy warning fixes

This eliminates various clippy warnings in the tidy tool, as well as
making some related cleanups. These changes should not introduce any
functional differences.
2018-09-07 15:26:51 +08:00
kennytm
3c77043677
Rollup merge of #53874 - withoutboats:pin-ptr-impls, r=RalfJung
Implement Unpin for Box, Rc, and Arc

Per the discussion in #49150, these should implement `Unpin` even if what they point to does not.
2018-09-07 15:26:49 +08:00
kennytm
3792dbd013
Rollup merge of #53860 - pnkfelix:issue-53764-migrate-run-pass-to-ui, r=nikomatsakis
Migrate (some) of run-pass/ to ui

This is a step towards addressing #53764. Much still remains.

I went through a large portion of the `*.rs` files that were directly stored into `src/test/run-pass/` and moved them into various subdirectories of a newly created `src/test/ui/run-pass/`.

(yes, it would have perhaps been nice to meld it more directly with directories already in `src/test/ui/`; but the sad truth is that opens up the reality of filename collisions, and one of my short term goals for resolving #53764 is to keep the *filenames* invariant, even as their parents directories and contents are mildly revised...)
2018-09-07 15:26:42 +08:00
kennytm
1805f3c2fb
Rollup merge of #53550 - brson:recurring, r=estebank
librustc_lint: In recursion warning, change 'recurring' to 'recursing'

The existing wording seems incorrect.

Aside: This warning, 'function cannot return without recursing' is not perfectly clear - it implies that the function _can_ return, it's just got to recurse. But really the fn cannot return period. Clearer wording: 'function recurses infinitely; it cannot return'; or 'function is infinitely self-recursive; it cannot return, and this is probably an error'. I like that.
2018-09-07 15:26:40 +08:00
kennytm
3f2de03daa
Rollup merge of #53455 - llogiq:num-byte-conversion-docs, r=steveklabnik
Individual docs for {from,to}_*_bytes
2018-09-07 15:26:37 +08:00
kennytm
654c5788aa
Rollup merge of #53376 - frewsxcv:frewsxcv-copy, r=GuillaumeGomez
Cross reference io::copy and fs::copy in docs.

Fixes https://github.com/rust-lang/rust/issues/52524.
2018-09-07 15:26:30 +08:00
kennytm
846a0bd1b9
Rollup merge of #53299 - MagnumOpus21:fix-macro-write, r=steveklabnik
Updated core/macros.rs to note it works in a no_std environment.

Fixes #45797
This PR updates the documentation of `write!` to note it works in a `no_std` environment, and adds an
example to showcase this. In a `no_std` environment, the author of the code is responsible for the
implementation of the `Write` trait. This example will work out of the box with `no_std`, but the
implementation of `Write` is expected to be provided by the user.

r? @steveklabnik
2018-09-07 15:26:26 +08:00
Matthias Krüger
10e7b76dfc update clippy submodule
updates to cafef7b576
2018-09-07 09:18:03 +02:00
bors
2ae11a9c22 Auto merge of #54018 - alexcrichton:omg-fix-again, r=Mark-Simulacrum
Ship libLLVM.dylib on OSX

Previously we just weren't shipping this at all as we were only looking for the
Linux version!
2018-09-07 04:18:07 +00:00
Wesley Wiser
b1211e8703 Fix tests 2018-09-06 22:57:05 -04:00
Alex Crichton
bd1fb60133 Ship libLLVM.dylib on OSX
Previously we just weren't shipping this at all as we were only looking for the
Linux version!
2018-09-06 19:06:09 -07:00
bors
9804689b58 Auto merge of #53969 - alexcrichton:update-compiler-builtins, r=nikomatsakis
Update the compiler-builtins submodule

Fixes a mistake in using C shims to...

Closes #53916
2018-09-07 01:52:24 +00:00
Niko Matsakis
5390cf32f7 resolve_lifetime: types are not late-bound regions =) 2018-09-06 19:58:23 -04:00
Niko Matsakis
81f64b7fa3 universal_regions.rs: rustfmt 2018-09-06 19:58:23 -04:00