Commit graph

24519 commits

Author SHA1 Message Date
Matthew Jasper
be5fe051a8 Remove feature(nll) when compare mode is sufficient 2019-05-12 18:46:43 +01:00
Matthew Jasper
ff71b80a85 Change compare mode to use -Zborrowck=mir 2019-05-12 18:46:43 +01:00
bors
0df1e57991 Auto merge of #60244 - SimonSapin:dangling, r=oli-obk
const-stabilize NonNull::dangling and NonNull::cast
2019-05-12 14:32:11 +00:00
bors
efa3c27f0f Auto merge of #60474 - mati865:musl_toolchain, r=alexcrichton
Make tests compatible with musl host

As an alternative to passing explicit linker all over the place I could try linking `cc` to musl gcc since this bootstraps itself.

Assigning for discussion:
r? @alexcrichton
2019-05-12 09:19:28 +00:00
bors
5f1924c992 Auto merge of #60714 - varkor:existential-global-lift-ice, r=oli-obk
Fix ICE with un-feature-gated existential type

Fixes https://github.com/rust-lang/rust/issues/60371.

r? @oli-obk
2019-05-11 12:25:11 +00:00
bors
af39a1fd73 Auto merge of #60717 - varkor:impl-const-generic, r=matthewjasper
Fix a bug preventing const parameters from being used in const generic impls

Fixes https://github.com/rust-lang/rust/issues/60712.
2019-05-11 09:24:45 +00:00
bors
7519eaca9a Auto merge of #60721 - estebank:ice-ice-baby, r=varkor
Avoid ICE by using delay_span_bug

Fix #59406, fix #53498.
2019-05-11 03:56:11 +00:00
Esteban Küber
adc18eb7cf Avoid ICE by using delay_span_bug 2019-05-10 18:22:25 -07:00
varkor
b3207d531d Add test for const impl 2019-05-11 00:08:40 +01:00
bors
acc7e652f8 Auto merge of #59288 - Centril:hir-if-to-match, r=oli-obk
[let_chains, 1/6] Remove hir::ExprKind::If

Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239.

r? @oli-obk
2019-05-10 22:58:52 +00:00
varkor
aa9369c7a4 Add test 2019-05-10 22:11:19 +01:00
Mazdak Farrokhzad
0b63f5530b
Rollup merge of #60697 - hellow554:fix_60629, r=michaelwoerister
add regression test for #60629

This bug was fixed, but I don't know which one. (I think it even doesn't matter at all).

Added a regression test.

```
op@OP ~/m/r/s/t/incremental> rustc --version
rustc 1.35.0-nightly (acd8dd6a5 2019-04-05)
op@OP ~/m/r/s/t/incremental> rustc -C incremental= --cfg rpass1 issue-60629.rs
warning: struct is never constructed: `A`
 --> issue-60629.rs:3:1
  |
3 | struct A;
  | ^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

op@OP ~/m/r/s/t/incremental> rustc -C incremental= --cfg rpass2 issue-60629.rs
error: internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[c27c]::ops[0]::drop[0]::Drop[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:635:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.35.0-nightly (acd8dd6a5 2019-04-05) running on x86_64-unknown-linux-gnu

note: compiler flags: -C incremental
```

with latest nightly it does not crash anymore, so nothing more to do.

Fixes #60629

(accidentally removed the remote branch on github, therefore GH closed the other PR.)

r? @nikomatsakis
2019-05-10 20:31:11 +02:00
Mazdak Farrokhzad
ec6afb1ff6
Rollup merge of #60692 - davidtwco:pr-60676-followup, r=Centril
Extend #60676 test for nested mut patterns.

At request of @centril, this commit extends the existing test added by #60676 to include nested `mut` patterns.

cc @Centril
2019-05-10 20:31:10 +02:00
Mazdak Farrokhzad
efd3733f9d add test checking that 'if cond { .. }' where 'cond: &mut? bool' isn't accepted. 2019-05-10 19:41:10 +02:00
Mazdak Farrokhzad
8d1e5b8b39 Various test changes 2019-05-10 19:41:10 +02:00
Mazdak Farrokhzad
99039689f0 Adjust mir-opt tests for new HIR without If 2019-05-10 19:41:10 +02:00
David Wood
1f0fb0391c
Add a bunch more tests. 2019-05-10 17:52:13 +01:00
David Wood
214f977fee
Move uninhabited tests into subdirectory.
This commit just tries to tidy up a little.
2019-05-10 17:52:12 +01:00
David Wood
8838b9130e
Fix uninhabitedness of non-exhaustive enums.
This commit ensures that non-exhaustive enums are considered inhabited
when used in extern crates.
2019-05-10 17:52:12 +01:00
David Wood
0d034a2e4d
Fix inhabitedness of non-exhaustive variants.
This commit ensures that non-exhaustive variants are considered
inhabited when used in extern crates.
2019-05-10 17:52:12 +01:00
David Wood
0db087e684
Add uninhabitedness tests w/ #[non_exhaustive].
This commit adds tests checking that uninhabited non-exhaustive types
are considered inhabited when used in another crate.
2019-05-10 17:52:12 +01:00
Mateusz Mikuła
f74debbe7d Make tests compatible with musl host 2019-05-10 16:12:47 +02:00
Marcel Hellwig
c81780b156 add regression test for #60629 2019-05-10 12:59:40 +02:00
David Wood
d28b7afd17
Extend existing test for nested mut patterns.
At request of `@centril`, this commit extends the existing test added
by #60676 to include nested `mut` patterns.
2019-05-10 08:55:54 +01:00
Mazdak Farrokhzad
45b09453db
Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj
Fix async desugaring providing wrong input to procedural macros.

Fixes #60674.

This PR fixes a minor oversight introduced by #60535 where unused `mut` binding modes were removed from the arguments to an `async fn` (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the `unused_mut` error that it avoided.

r? @cramertj
cc @taiki-e
2019-05-09 23:56:18 +02:00
Mazdak Farrokhzad
e7b4023f37
Rollup merge of #60648 - petrochenkov:shorten2, r=Dylan-DPC
Skip codegen for one UI test with long file path

The path to this test is so long that object files produced by it hit some path length limit on Windows and linker cannot find them.
The workaround here is to skip codegen and avoid producing object files, this test doesn't need them anyway.
2019-05-09 23:56:14 +02:00
Mazdak Farrokhzad
39edc68c69
Rollup merge of #60188 - estebank:recover-block, r=varkor
Identify when a stmt could have been parsed as an expr

There are some expressions that can be parsed as a statement without
a trailing semicolon depending on the context, which can lead to
confusing errors due to the same looking code being accepted in some
places and not others. Identify these cases and suggest enclosing in
parenthesis making the parse non-ambiguous without changing the
accepted grammar.

Fix #54186, cc #54482, fix #59975, fix #47287.
2019-05-09 23:56:09 +02:00
Mazdak Farrokhzad
62ab971bb7
Rollup merge of #59348 - matthewjasper:cleanup-drop-shims, r=arielb1
Clean up and add tests for slice drop shims

Adds a test for the MIR generated by `real_drop_in_place::<[T]>`. Also slightly reduces the number of statements and locals used in the shim.

r? @RalfJung
2019-05-09 23:56:08 +02:00
David Wood
dcd3cf7017
Do not modify mutability of simple bindings.
This commit removes the modification of the mutability of simple
bindings. While the mutability isn't used, it is important that it is
kept so that the input to procedural macros matches what the user wrote.
This commit also modifies the span of the binding mode so that it is
considered a compiler desugaring and won't be linted against for being
unused..
2019-05-09 19:10:27 +01:00
David Wood
e57c7b859d
Add regression test for #60674.
This commit adds a regression test (with current broken behaviour) that
tests that `mut` patterns are not lost when provided as input to a proc macro.
2019-05-09 18:15:15 +01:00
Mazdak Farrokhzad
26a7544aa3
Rollup merge of #60647 - petrochenkov:nospace, r=michaelwoerister
cleanup: Remove `DefIndexAddressSpace`

The scheme with two address spaces for `DefIndex` was needed in the past, but apparently not needed anymore (after removing `DefId`s from locals and `HirId`-ification).
2019-05-09 18:34:55 +02:00
Mazdak Farrokhzad
f683b6b799
Rollup merge of #60644 - estebank:abolish-ice, r=varkor
Use `delay_span_bug` for "Failed to unify obligation"

Fix #60283.
2019-05-09 00:58:32 +02:00
Mazdak Farrokhzad
0597292967
Rollup merge of #60641 - estebank:defer-ice, r=oli-obk
Instead of ICEing on incorrect pattern, use delay_span_bug

Fix #60635.
2019-05-09 00:58:31 +02:00
Mazdak Farrokhzad
d20b692756
Rollup merge of #60627 - matklad:test, r=estebank
test for #50518

It was fixed somewhere between 1.28.0 and 1.31.1

closes #50518

r? @estebank

Where's the best place to add this test? I *think* we want "compile-pass" for this test (no need to run a binary, and not running saves us a millisecond of process creation) , but there's no compile-pass anymore.

Should this be UI test with empty stdout, stderr and zero return code?
2019-05-09 00:58:28 +02:00
Mazdak Farrokhzad
b04f87fede
Rollup merge of #60572 - tmandry:issue-59972, r=RalfJung,oli-obk
Add test for #59972

This PR adds a test for #59972, which was fixed in #59897.

Closes #59972.

r? @eddyb
2019-05-09 00:58:26 +02:00
Mazdak Farrokhzad
59ff11393d
Rollup merge of #60550 - skinny121:concrete_const_tests, r=varkor
Add tests for concrete const types

In response to the request for help in https://github.com/rust-lang/rust/issues/44580#issuecomment-488819344, I have added several ui tests around the use of concrete const types, i.e. A<2>.

r? @varkor
2019-05-09 00:58:25 +02:00
Vadim Petrochenkov
d0ba8fe33f Skip codegen for one UI test with long file path 2019-05-09 01:06:03 +03:00
Vadim Petrochenkov
ee6d315200 cleanup: Remove DefIndexAddressSpace 2019-05-09 00:46:38 +03:00
Esteban Küber
0fce5c1bf0 Use delay_span_bug for "Failed to unify obligation" 2019-05-08 11:42:47 -07:00
Esteban Küber
cc40f41ee5 Instead of ICEing on incorrect pattern, use delay_span_bug 2019-05-08 10:23:55 -07:00
Aleksey Kladov
c87d2ccf88 test for #50518
It was fixed somewhere between 1.28.0 and 1.31.1

closes #50518
2019-05-08 13:43:43 +03:00
ben
bfa15f3988 Add tests for concrete const types 2019-05-08 20:35:41 +12:00
bors
b92d360c6c Auto merge of #60378 - froydnj:apple-target-modifications, r=michaelwoerister
conditionally modify darwin targets to macosx targets with versions

We need this behavior so that Rust LLVM IR objects match the target triple for Clang LLVM IR objects.  This matching then convinces the linker that yes, you really can do cross-language LTO with objects from different compilers.

The newly-added tests seem to pass locally on x86_64-unknown-linux-gnu.  I haven't done a full test run or tried the new compiler in an cross-language LTO setup yet.
2019-05-08 08:26:48 +00:00
bors
33cde4aac2 Auto merge of #60586 - cramertj:await, r=oli-obk
Implement built-in await syntax

Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.

This new syntax is not final, but is the consensus solution proposed by the lang team, as explained in https://boats.gitlab.io/blog/post/await-decision/

Fix https://github.com/rust-lang/rust/issues/51719
Fix https://github.com/rust-lang/rust/issues/51751
Fix https://github.com/rust-lang/rust/issues/60016
2019-05-07 22:33:12 +00:00
Taylor Cramer
fe8760cb84 Implement built-in await syntax
Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.
2019-05-07 14:45:53 -07:00
bors
cfdc84a009 Auto merge of #60612 - Centril:rollup-61drhqt, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #60489 (Remove hamburger button from source code page)
 - #60535 (Correct handling of arguments in async fn)
 - #60579 (Rename `ParamTy::idx` to `ParamTy::index`)
 - #60583 (Fix parsing issue with negative literals as const generic arguments)
 - #60609 (Be a bit more explicit asserting over the vec rather than the len)

Failed merges:

r? @ghost
2019-05-07 19:39:52 +00:00
Mazdak Farrokhzad
9995bb5855
Rollup merge of #60583 - varkor:const-generics-emplace, r=petrochenkov
Fix parsing issue with negative literals as const generic arguments
2019-05-07 19:30:09 +02:00
Mazdak Farrokhzad
535db2f357
Rollup merge of #60535 - taiki-e:async-fn-arguments, r=cramertj
Correct handling of arguments in async fn

Fixes #60509
Fixes #60566

r? @cramertj or @davidtwco
2019-05-07 19:30:06 +02:00
bors
17dba3b6e4 Auto merge of #60277 - estebank:relate-ice, r=varkor
Don't ICE when relating const type args

Fix #60263.

r? @varkor
2019-05-07 16:45:14 +00:00
Nathan Froyd
97ba4c95d0 choose a more specific LLVM target on OS X when necessary
This behavior matches clang's behavior, and makes cross-language LTO
possible.

Fixes #60235.
2019-05-07 11:09:39 -04:00