Commit graph

3776 commits

Author SHA1 Message Date
Felix S. Klock II
92ef0c4bff Make test robust to NLL, in sense of ensuring borrows extend to something approximating lexical scope. 2018-11-09 00:14:11 +01:00
Felix S. Klock II
918f70f628 Removed an unneeded instance of // revisions; the compare-mode NLL shows the output is identical now. 2018-11-09 00:03:17 +01:00
Oliver Scherer
ffa7ce4290 Add more regression tests 2018-11-08 20:18:26 +01:00
Oliver Scherer
df10965dc0 Prevent ICE in const-prop array oob check 2018-11-08 20:15:13 +01:00
Nikita Popov
b1a33971ab Fix some tests for wasm32-unknown-emscripten 2018-11-08 18:17:57 +01:00
Felix S. Klock II
dd6398256e Revise the temp creation for blocks in stmt_expr to setup BlockTailInfo. 2018-11-08 14:32:17 +01:00
Felix S. Klock II
556f583587 Regression test for issue #54382
(I opted to rely on compare-mode=nll rather than opt into
`#![feature(nll)]`, mostly to make it easy to observe the interesting
differences between the AST-borrwock diagnostic and the NLL one.)
2018-11-08 12:54:20 +01:00
bors
653da4fd00 Auto merge of #55532 - pnkfelix:rustc_error-survey, r=nikomatsakis
#[rustc_error] survey

Fix #55505
2018-11-08 09:38:49 +00:00
Alexander Regueiro
7d9ee0314a Only do check for trait objects, not trait or trait alias definitions. 2018-11-07 21:57:45 +00:00
Alexander Regueiro
6d3ee4170d Added error for duplicate bindings of associated type. 2018-11-07 21:57:45 +00:00
Alexander Regueiro
0e89f570d2 Added tests. 2018-11-07 21:57:40 +00:00
Felix S. Klock II
34ffbdb965 This test will not link on wasm32. 2018-11-07 16:33:41 +01:00
David Wood
299a452a75
Ignore never-initialized locals for unused_mut.
This commit filters out locals that have never been initialized for
consideration in the `unused_mut` lint.

This is intended to detect when the statement that would have
initialized the local was removed as unreachable code. In these cases,
we would not want to lint. This is the same behaviour as the AST borrow
checker.

This is achieved by taking advantage of an existing pass over the MIR
for the `unused_mut` lint and creating a set of those locals that were
never initialized.
2018-11-07 16:10:40 +01:00
Felix S. Klock II
f4da71e04e work around deviation in diagnostic output for opt-level=0 by forcing -O. 2018-11-07 15:58:59 +01:00
Felix S. Klock II
58c7a786b0 Update output of lint-type-overflow2.stderr to reflect its output from rustc -O.
(The fact that output differs under `opt-level=0` is an instance of #55757.)
2018-11-07 15:47:49 +01:00
F001
f63c2f80e5 fix ICE 2018-11-07 22:17:32 +08:00
kennytm
4e86576277
Rollup merge of #55645 - RalfJung:validity-range-inclusive, r=oli-obk
do not print wrapping ranges like normal ranges in validity diagnostics
2018-11-07 21:28:19 +08:00
kennytm
e222d1db3c
Rollup merge of #55730 - estebank:impl-trait-arg-mismatch, r=varkor
Use trait impl method span when type param mismatch is due to impl Trait

Fix #55374.
2018-11-07 21:26:56 +08:00
Ralf Jung
3ec89746ba test diagnostics for more ranges 2018-11-07 14:06:38 +01:00
Ralf Jung
b42b9b34d5 pretty-print scalar range that only has an upper bound 2018-11-07 13:58:43 +01:00
Ralf Jung
9dba743a6a do not print wrapping ranges like normal ranges in diagnostics 2018-11-07 13:46:49 +01:00
Felix S. Klock II
a2e090624e Removed #[rustc_error] from tests that are all // compile-pass.
I also added `// skip-codegen` to each one, to address potential concerns
that this change would otherwise slow down our test suite spending time
generating code for files that are really just meant to be checks of
compiler diagnostics.

(However, I will say: My preference is to not use `// skip-codegen` if
one can avoid it. We can use all the testing of how we drive LLVM that
we can get...)

(Updated post rebase.)
2018-11-07 13:09:52 +01:00
Felix S. Klock II
0332a39f07 Replaced use of #[rustc_error] with // skip-codegen.
This test specifically notes that it does not want to invoke the
linker, due to the way it (IMO weakly) exercises the `#[link=...]`
attribute.

In any case, removing the the `#[rustc_error]` here uncovered an
"invalid windows subsystem" error that was previously not included in
the transcript of diagnostic output. So that's a step forward, (right?).
2018-11-07 13:09:52 +01:00
Felix S. Klock II
bf544fa920 remove #[rustc_error] from ui/ tests that remain compile-fail tests. 2018-11-07 13:09:52 +01:00
kennytm
8f93a3c05e
Rollup merge of #55688 - alexreg:move-issue-tests, r=estebank
Standardised names and location of ui issue tests

None
2018-11-07 18:01:56 +08:00
kennytm
dfa104ecf1
Rollup merge of #55609 - nikic:fix-51947, r=nagisa
Run name-anon-globals after LTO passes as well

If we're going to emit bitcode (through ThinLTOBuffer), then we need to ensure that anon globals are named. This was already done after optimization passes, but also has to happen after LTO passes, as we always emit the final result in a ThinLTO-compatible manner.

I added the test as `run-make`. The important bit is that we emit bitcode in some way (e.g. `--crate-type rlib` or `--emit=llvm-bc`). Please tell me if there is a better way to test for that.

Fixes #51947
2018-11-07 18:01:54 +08:00
kennytm
0708a6a717
Rollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkov
Fix feature gate only being checked on first repr attr.

Reported in https://github.com/rust-lang/rust/issues/33158#issuecomment-412185357.
2018-11-07 18:01:53 +08:00
kennytm
099c587851
Rollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakis
Don't print opt fuel messages to stdout because it breaks Rustbuild

Rustbuild passes `--message-format json` to the compiler invocations
which causes JSON to be emitted on stdout. Printing optimization fuel
messages to stdout breaks the json and causes Rustbuild to fail.

Work around this by emitting optimization fuel related messages on
stderr instead.
2018-11-07 18:01:50 +08:00
bors
8315b11b63 Auto merge of #55549 - RalfJung:miri-visitor, r=oli-obk
Value visitors for miri

Generalize the traversal part of validation to a `ValueVisitor`.

~~This includes https://github.com/rust-lang/rust/pull/55316, [click here](https://github.com/RalfJung/rust/compare/retagging...RalfJung:miri-visitor) for just the new commits.~~
2018-11-07 09:14:12 +00:00
bors
ddd4b194a0 Auto merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung
Change the ICE from #55223 to a hard error

cc @SimonSapin

r? @RalfJung

fixes https://github.com/rust-lang/rust/issues/55287
2018-11-06 23:36:13 +00:00
Esteban Küber
3ec837e763 Elide anon lifetimes in conflicting impl note 2018-11-06 14:49:09 -08:00
Esteban Küber
46fcf1c6ad Use trait impl method span when type param mismatch is due to impl Trait 2018-11-06 11:24:48 -08:00
Nikita Popov
66702fcd0a Run name-anon-globals after LTO passes as well
If we're going to emit bitcode (through ThinLTOBuffer), then we
need to ensure that anon globals are named. This was already done
after optimization passes, but also has to happen after LTO passes,
as we always emit the final result in a ThinLTO-compatible manner.

Fixes #51947.
2018-11-06 19:24:28 +01:00
Felix S. Klock II
22b571d62a Add explcit --error-format options to tests of print-fuel to sidestep compiletests presumption of JSON.
As a driveby, rename the stdout files to stderr, which should have been part of the earlier commit.
2018-11-06 17:07:27 +01:00
Felix S. Klock II
e7f8c0d105 Sidestep link error from rustfix'ed code by using a *defined* static.
As a drive-by, added `-g` to the compile-flags so that the test more
reliably fails to compile when the extern static in question is *not*
provided. (I.e. this is making the test more robust in the face of
potential future revisions.)

Fix #54388.
2018-11-06 14:21:52 +01:00
Oliver Scherer
69c80f4878 Bubble up an overflow error so that rustdoc can ignore it 2018-11-06 13:03:16 +01:00
kennytm
6231720de0
Rollup merge of #55700 - pnkfelix:issue-55533-update-ui-tests-wrt-nll, r=davidtwco
Update ui tests with respect to NLL

Fix #55533
2018-11-06 17:08:31 +08:00
kennytm
1ea1a4277e
Rollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix
NLL Diagnostic Review 3: Missing errors for borrows of union fields

Fixes #55675.

This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.

r? @pnkfelix
2018-11-06 17:08:29 +08:00
kennytm
54bc9c27e4
Rollup merge of #55694 - jsirs:issue-31076, r=oli-obk
Fixes #31076
2018-11-06 17:08:27 +08:00
kennytm
435aca1c8f
Rollup merge of #55664 - varkor:all-possible-cases-message, r=zackmdavis
Make "all possible cases" help message uniform with existing help messages

Specifically no capitalisation or trailing full stops.
2018-11-06 17:08:21 +08:00
kennytm
6091696cfd
Rollup merge of #55601 - petrochenkov:featissue, r=pnkfelix
Fix tracking issue numbers for some unstable features

And also remove deprecated unstable `#[panic_implementation]` attribute that was superseded by stable `#[panic_handler]` and doesn't have an open tracking issue.
2018-11-06 17:08:08 +08:00
kennytm
1525b0ee82
Rollup merge of #55490 - petrochenkov:resolveice, r=eddyb
resolve: Fix ICE in macro import error recovery

Fixes https://github.com/rust-lang/rust/issues/55457
2018-11-06 15:20:57 +08:00
Alexander Regueiro
a1c4060c9d Moved and renamed ui issue tests. 2018-11-06 01:51:27 +00:00
bors
13dab66a6f Auto merge of #55410 - nagisa:atomic-align, r=pnkfelix
Correct alignment of atomic types and (re)add Atomic{I,U}128

This is a updated https://github.com/rust-lang/rust/pull/53514 to also make atomic types `repr(C)` as per comment in https://github.com/rust-lang/rust/pull/53514#issuecomment-431042767.

Fixes #39590
Closes #53514

r? @pnkfelix
2018-11-05 19:29:57 +00:00
bors
af791bb8f4 Auto merge of #55451 - estebank:arg-doc, r=pnkfelix
Custom diagnostic when trying to doc comment argument

When writing

```
pub fn f(
    /// Comment
    id: u8,
) {}
```

Produce a targeted diagnostic

```
error: documentation comments cannot be applied to method arguments
  --> $DIR/fn-arg-doc-comment.rs:2:5
   |
LL |     /// Comment
   |     ^^^^^^^^^^^ doc comments are not allowed here
```

Fix #54801.
2018-11-05 16:36:18 +00:00
David Wood
8e7786a2d9
Add run-pass test for reinitialized unions.
This commit adds a run-pass test for the subset of
`src/test/ui/borrowck/borrowck-union-move-assign.rs` that is intended to
pass as the union is reinitialized.
2018-11-05 17:34:53 +01:00
Felix S. Klock II
fff9ddedce For feature-gate-nll test, turn off testing modes that externally enable NLL. 2018-11-05 16:37:18 +01:00
Felix S. Klock II
b75fbbf540 Make ui/borrowck/borrowck-overloaded-call.rs robust w.r.t. NLL. 2018-11-05 16:29:41 +01:00
Felix S. Klock II
cf71582718 Use // revisions in the dropck-eyepatch tests instead of relying on compare-mode=nll.
NLL has increased precision in its analysis of drop order, and we want
the test annotations to deliberately reflect this by having fewer
ERROR annotations for NLL than for AST-borrowck. The best way to get
this effect is via `// revisions`.

As a drive-by, also added uses of all the borrows just to make it
clear that NLL isn't somehow sidestepping things by using shorter
borrows than you might have otherwise expected. (Of course, the added
uses do not make all that much difference since the relevant types all
declare `impl Drop` and thus those drops have implicit uses anyway.)
2018-11-05 16:19:51 +01:00
Felix S. Klock II
c25319fcfc Update ui/borrowck/borrowck-closures-mut-of-imm.rs robust w.r.t. NLL. 2018-11-05 15:26:02 +01:00