Commit Graph

89027 Commits

Author SHA1 Message Date
Alex Crichton
75d0bceb0a Add two more wasm-related LLVM commits 2019-01-25 15:39:54 -08:00
Josh Stone
df0466d0bb Rebase to the llvm-project monorepo
The new git submodule src/llvm-project is a monorepo replacing src/llvm
and src/tools/{clang,lld,lldb}.  This also serves as a rebase for these
projects to the new 8.x branch from trunk.

The src/llvm-emscripten fork is unchanged for now.
2019-01-25 15:39:54 -08:00
bors
37d51aa8f3 Auto merge of #57898 - Centril:rollup, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #56233 (Miri and miri-related code contains repetitions of `(n << amt) >> amt`)
 - #57645 (distinguish "no data" from "heterogeneous" in ABI)
 - #57734 (Fix evaluating trivial drop glue in constants)
 - #57886 (Add suggestion for moving type declaration before associated type bindings in generic arguments.)
 - #57890 (Fix wording in diagnostics page)

Failed merges:

r? @ghost
2019-01-25 23:27:20 +00:00
Vadim Petrochenkov
1b659d69bc Address review comments and cleanup code 2019-01-26 01:49:55 +03:00
Mark Rousskov
82fae2be04 Correctly set filetime for copied LLVM
This also makes compiletest no longer always retest everything.
2019-01-25 14:31:38 -07:00
bors
bf669d1e32 Auto merge of #57435 - Dylan-DPC:fi/compiler-builtins-lock, r=alexcrichton
Update Cargo.lock to use the latest `compiler_builtins`

A very tiny PR per the request of @alexcrichton : rust-lang-nursery/compiler-builtins#267 (comment)

Rewrite of #57414

cc @Lokathor

r? @alexcrichton
2019-01-25 20:30:43 +00:00
Alex Crichton
14b36fb15a std: Stabilize fixed-width integer atomics
This commit stabilizes the `Atomic{I,U}{8,16,32,64}` APIs in the
`std::sync::atomic` and `core::sync::atomic` modules. Proposed in #56753
and tracked in #32976 this feature has been unstable for quite some time
and is hopefully ready to go over the finish line now!

The API is being stabilized as-is. The API of `AtomicU8` and friends
mirrors that of `AtomicUsize`. A list of changes made here are:

* A portability documentation section has been added to describe the
  current state of affairs.
* Emulation of smaller-size atomics with larger-size atomics has been
  documented.
* As an added bonus, `ATOMIC_*_INIT` is now scheduled for deprecation
  across the board in 1.34.0 now that `const` functions can be invoked
  in statics.

Note that the 128-bit atomic types are omitted from this stabilization
explicitly. They have far less platform support than the other atomic
types, and will likely require further discussion about their best
location.

Closes #32976
Closes #56753
2019-01-25 11:48:10 -08:00
François Mockers
ac4b685650 #56411 do not suggest a fix for a import conflict in a macro 2019-01-25 22:39:14 +03:00
Simonas Kazlauskas
ce289c6c99 Resolve breakage 2019-01-25 19:20:38 +02:00
Mazdak Farrokhzad
0ae3d87d81
Rollup merge of #57890 - feinorgh:fix-diagnostics-typo, r=zackmdavis
Fix wording in diagnostics page

Fix a tiny wording error in the diagnostics text for E0070.
2019-01-25 16:59:31 +01:00
Mazdak Farrokhzad
7768358e72
Rollup merge of #57886 - davidtwco:issue-57385, r=estebank
Add suggestion for moving type declaration before associated type bindings in generic arguments.

Fixes #57385.

r? @estebank
2019-01-25 16:59:29 +01:00
Mazdak Farrokhzad
141fa859b8
Rollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelix
Fix evaluating trivial drop glue in constants

```rust
struct A;
impl Drop for A {
    fn drop(&mut self) {}
}

const FOO: Option<A> = None;

const BAR: () = (FOO, ()).1;
```

was erroring with

```
error: any use of this value will cause an error
 --> src/lib.rs:9:1
  |
9 | const BAR: () = (FOO, ()).1;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^
  |                           |
  |                           calling non-const function `std::ptr::real_drop_in_place::<(std::option::Option<A>, ())> - shim(Some((std::option::Option<A>, ())))`
  |
  = note: #[deny(const_err)] on by default

error: aborting due to previous error
```

before this PR. According to godbolt this last compiled successfully in 1.27
2019-01-25 16:59:27 +01:00
Mazdak Farrokhzad
7779bb9907
Rollup merge of #57645 - nikomatsakis:issue-56877-abi-aggregates, r=eddyb
distinguish "no data" from "heterogeneous" in ABI

Ignore zero-sized types when computing whether something is a homogeneous aggregate, except be careful of VLA.

cc #56877

r? @arielb1
cc @eddyb
2019-01-25 16:59:26 +01:00
Mazdak Farrokhzad
ef5a5bab7a
Rollup merge of #56233 - kenta7777:kenta7777#49937, r=oli-obk
Miri and miri-related code contains repetitions of `(n << amt) >> amt`

I reduced some code repetitions contains `(n << amt) >> amt`.
This pull request is related to #49937.
2019-01-25 16:59:25 +01:00
Niko Matsakis
8e4c57fca2 distinguish "no data" from "heterogeneous" for ABI purposes
Also, add a testing infrastructure and tests that lets us dump layout.
2019-01-25 10:03:47 -05:00
bors
0b1669d96c Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelix
[NLL] Clean up handling of type annotations

* Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free.
* Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943)
* Use the inferred type to allow infallible handling of user type projections (#57531)
* Uses revisions for the tests in #56993
* Check the types of `Unevaluated` constants with no annotations (#46702)
* Some drive-by cleanup

Closes #46702
Closes #54943
Closes #57531
Closes #57731
cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment

r? @nikomatsakis
2019-01-25 14:25:37 +00:00
Felix S. Klock II
620a03f5aa Unit test from #57866. 2019-01-25 15:19:37 +01:00
bors
7187db619c Auto merge of #57891 - michaelwoerister:no-default-incr-bootstrap, r=pietroalbini
bootstrap: Don't rely on any default settings regarding incr. comp. in Cargo

https://github.com/rust-lang/cargo/pull/6564 (temporarily) makes incremental compilation the default for release builds. We don't want this default to apply to building the compiler itself, that is, `bootstrap`'s `incremental` flag should always be respected. Otherwise we'll get incrementally build releases, which we really don't want `:)`.

r? @Mark-Simulacrum

Anybody else from @rust-lang/release should feel free to r+ this too if they get around to it earlier.
2019-01-25 11:25:14 +00:00
David Wood
7a0abbff8b
Combining move lifetime and type suggestions.
This commit combines the move lifetime and move type suggestions so that
when rustfix applies them they don't conflict with each other.
2019-01-25 11:54:21 +01:00
Michael Woerister
f4fe8085f8 bootstrap: Don't rely on any default settings regarding incr. comp. in Cargo. 2019-01-25 11:23:08 +01:00
David Wood
463e623ca9
Suggestion moving types before associated types.
This commit extends existing suggestions to move lifetimes before types
in generic arguments to also suggest moving types behind associated type
bindings.
2019-01-25 11:15:16 +01:00
Oliver Scherer
506393eaaf Add a compile-fail test for Drop in constants in the presence of Options 2019-01-25 09:54:25 +01:00
bors
5d74d75d1a Auto merge of #57881 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
submodules: update clippy from 280069dd to f1753522

Changes:
````
Rustup
allow assertions_on_constants for collapsible_if and missing_test_files
Improving comments.
Added rustfix to the test.
Improve span shortening.
Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
Fixed potential mistakes with nesting. Added tests.
Fix automatic suggestion on `use_self`.
run ./util/dev update_lints
add assert(true/false, some message) tests
change assert_checks to assertions_on_constants
run ./util/dev update_lints
Add unreachable!() as option
Add assert(true) and assert(false) lints
````

Fixes clippy toolstate

r? @oli-obk
2019-01-25 08:34:53 +00:00
Pär Karlsson
af153cef0c Fix wording in diagnostics page 2019-01-25 08:43:56 +01:00
dylan_DPC
14a38b30af lock after rebase 2019-01-25 12:37:07 +05:30
dylan_DPC
4092538770 fix lock after running build 2019-01-25 12:36:32 +05:30
Lokathor
49700a0a67 The file should be fully consistent now. 2019-01-25 12:36:18 +05:30
Lokathor
f532dfe9c3 Update Cargo.lock to use the latest compiler_builtins 2019-01-25 12:34:49 +05:30
bors
a41ade7bc3 Auto merge of #57888 - Centril:rollup, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #56217 (Add grammar in docs for {f32,f64}::from_str, mention known bug.)
 - #57294 (When using value after move, point at span of local)
 - #57652 (Update/remove some old readmes)
 - #57802 (Print visible name for types as well as modules.)
 - #57865 (Don't ICE when logging unusual types)

Failed merges:

r? @ghost
2019-01-25 01:18:13 +00:00
Mazdak Farrokhzad
a6fa7de8e7
Rollup merge of #57865 - Aaron1011:fix/debug-ice, r=estebank
Don't ICE when logging unusual types

MonoItemExt#to_string is used for both debug logging and LLVM symbol
name generation. When debugging, we want to print out any type we
encounter, even if it's something weird like GeneratorWitness. However,
during codegen, we still want to error if we encounter an unexpected
type when generating a name.

To resolve this issue, this commit introduces a new 'debug' parameter to
the relevant methods. When set to 'true', it allows any type to be
printed - when set to 'false', it 'bug!'s when encountering an
unexpected type.

This prevents an ICE when enabling debug logging (via RUST_LOG) while
running rustc on generator-related code.
2019-01-25 01:37:03 +01:00
Mazdak Farrokhzad
a9950f6a45
Rollup merge of #57802 - davidtwco:issue-56943, r=estebank
Print visible name for types as well as modules.

Fixes #56943 and fixes #57713.

This commit extends previous work in #55007 where the name from the
visible parent was used for modules. Now, we also print the name from
the visible parent for types.

r? @estebank
2019-01-25 01:37:02 +01:00
Mazdak Farrokhzad
2876801d18
Rollup merge of #57652 - mark-i-m:remove-old, r=nikomatsakis
Update/remove some old readmes

r? @nikomatsakis

cc #48478

There are a bunch of READMEs with content that I would like to see a final decision made on:
- https://github.com/rust-lang/rust/tree/master/src/librustc/ty/query
- https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph
- https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve
- https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/borrowck

It's not clear how useful or obsolete any of these are. I would really appreciate if the appropriate domain experts for each of these could respond with one of (a) delete it, (b) wait for system to be remove, or (c) move it to rustc-guide. @nikomatsakis do you know who to ping for any of these (sorry, I suspect many of them are you)?
2019-01-25 01:37:00 +01:00
Mazdak Farrokhzad
f20c6c8581
Rollup merge of #57294 - estebank:point-copy-less, r=nikomatsakis
When using value after move, point at span of local

When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.

```
error[E0382]: use of moved value: `x`
  --> $DIR/issue-34721.rs:27:9
   |
LL |     pub fn baz<T: Foo>(x: T) -> T {
   |                -       - move occurs because `x` has type `T`, which does not implement the `Copy` trait
   |                |
   |                consider adding a `Copy` constraint to this type argument
LL |         if 0 == 1 {
LL |             bar::bar(x.zero())
   |                      - value moved here
LL |         } else {
LL |             x.zero()
   |             - value moved here
LL |         };
LL |         x.zero()
   |         ^ value used here after move
```

Fix #34721.
2019-01-25 01:36:59 +01:00
Mazdak Farrokhzad
284e1a86c0
Rollup merge of #56217 - frewsxcv:frewsxcv-float-parse, r=QuietMisdreavus
Add grammar in docs for {f32,f64}::from_str, mention known bug.

- Original bug about documenting grammar
  - https://github.com/rust-lang/rust/issues/32243
- Known bug with parsing
  - https://github.com/rust-lang/rust/issues/31407
2019-01-25 01:36:57 +01:00
Matthias Krüger
a5d04ed803 submodules: update clippy from 280069dd to f1753522
Changes:
````
Rustup
allow assertions_on_constants for collapsible_if and missing_test_files
Improving comments.
Added rustfix to the test.
Improve span shortening.
Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
Fixed potential mistakes with nesting. Added tests.
Fix automatic suggestion on `use_self`.
run ./util/dev update_lints
add assert(true/false, some message) tests
change assert_checks to assertions_on_constants
run ./util/dev update_lints
Add unreachable!() as option
Add assert(true) and assert(false) lints
````
2019-01-24 22:25:13 +01:00
bors
278067d34d Auto merge of #57879 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57380 (Fix Instant/Duration math precision & associativity on Windows)
 - #57606 (Get rid of the fake stack frame for reading from constants)
 - #57803 (Several changes to libunwind for SGX target)
 - #57846 (rustdoc: fix ICE from loading proc-macro stubs)
 - #57860 (Add os::fortanix_sgx::ffi module)
 - #57861 (Don't export table by default in wasm)
 - #57863 (Add suggestion for incorrect field syntax.)
 - #57867 (Fix std::future::from_generator documentation)
 - #57873 (Stabilize no_panic_pow)

Failed merges:

r? @ghost
2019-01-24 21:23:11 +00:00
Esteban Küber
baa0828ee3 Fix --compare-mode=nll tests 2019-01-24 10:53:43 -08:00
Esteban Küber
29e8e63c84 review comments 2019-01-24 10:36:50 -08:00
Esteban Küber
0e2d6e0175 Point at type argument suggesting adding Copy constraint 2019-01-24 10:36:50 -08:00
Esteban Küber
f6e29babc0 break eagerly from loop 2019-01-24 10:36:50 -08:00
Esteban Küber
e0a606c6a9 Add test for #34721 2019-01-24 10:36:50 -08:00
Esteban Küber
5e9c8d7369 When using value after move, point at span of local
When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.
2019-01-24 10:36:50 -08:00
Simonas Kazlauskas
89e34d3e32 Add a feature gate test for #[optimize] 2019-01-24 20:13:51 +02:00
Simonas Kazlauskas
4d97b28893 Support revisions for codegen tests
`compile-flags: -Copt-level` will avoid adding -O. Similarly for -g and
-Cdebuglevel.
2019-01-24 20:13:51 +02:00
Simonas Kazlauskas
dcf5482cda Add an idealistic test for optimize attribute
Alas it does not currently work, because of limitations in compiletest…
2019-01-24 20:13:51 +02:00
Simonas Kazlauskas
f38d0da893 Implement optimize(size) and optimize(speed) 2019-01-24 20:13:50 +02:00
Mazdak Farrokhzad
5fa1016f93
Rollup merge of #57873 - milesand:master, r=Centril
Stabilize no_panic_pow

This would close #48320.

I'm not sure if I've done this right, I've just changed attribute name to stable and set `since` to two minor versions above current stable since that seemed like what others were doing.
2019-01-24 18:25:52 +01:00
Mazdak Farrokhzad
7274591df5
Rollup merge of #57867 - Aaron1011:fix/gen-future-doc, r=Centril
Fix std::future::from_generator documentation

This function takes a generator and wraps it in a future, not
vice-versa.
2019-01-24 18:25:50 +01:00
Mazdak Farrokhzad
1a3b3d4298
Rollup merge of #57863 - davidtwco:issue-57684, r=estebank
Add suggestion for incorrect field syntax.

Fixes #57684.

This commit adds a suggestion when a `=` character is used when
specifying the value of a field in a struct constructor incorrectly
instead of a `:` character.

r? @estebank
2019-01-24 18:25:49 +01:00
Mazdak Farrokhzad
5b288ae0eb
Rollup merge of #57861 - pepyakin:wasm-dont-export-table, r=alexcrichton
Don't export table by default in wasm

Revert of https://github.com/rust-lang/rust/pull/53237
As per discussion here https://github.com/rustwasm/team/issues/251
2019-01-24 18:25:48 +01:00