summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-01-27Make pointers to statics internalMatthew Jasper-0/+62
2020-01-17Add ICE regression testsEsteban Küber-0/+34
(cherry picked from commit f6e9fd037a7b55f8f4fe78694b77d9788b18dfeb)
2020-01-17Do not ICE on unicode next pointEsteban Küber-0/+23
Use `shrink_to_hi` instead of `next_point` Fix #68000. (cherry picked from commit fcd850fc5db2501d14b2e0cbfac8aa890d700e55)
2020-01-17expect `fn` after `const unsafe` / `const extern`Mazdak Farrokhzad-0/+41
(cherry picked from commit 915db7ae6430baef99f186ba40f08e105b7694fe)
2020-01-13Do not ICE on lifetime error involving closuresEsteban Küber-0/+18
2020-01-13Use the correct type for static qualifsMatthew Jasper-0/+14
2020-01-13Don't suppress move errors for union fieldsMatthew Jasper-0/+57
2020-01-13Move command-related tests into command/Jeremy Fitzhardinge-0/+0
2020-01-13Fix up Command Debug output when arg0 is specified.Jeremy Fitzhardinge-0/+24
PR https://github.com/rust-lang/rust/pull/66512 added the ability to set argv[0] on Command. As a side effect, it changed the Debug output to print both the program and argv[0], which in practice results in stuttery output ("echo echo foo"). This PR reverts the behaviour to the the old one, so that the command is only printed once - unless arg0 has been set. In that case it emits "[command] arg0 arg1 ...".
2019-12-15Rollup merge of #67289 - estebank:unnamed-closure, r=CentrilMazdak Farrokhzad-0/+46
Do not ICE on unnamed future Fix #67252.
2019-12-15Auto merge of #67216 - ecstatic-morse:const-loop, r=oli-obkbors-106/+465
Enable `loop` and `while` in constants behind a feature flag This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways. `while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user. r? @oli-obk cc @rust-lang/wg-const-eval
2019-12-14Do not ICE on unnamed futureEsteban Küber-0/+46
2019-12-14Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, ↵bors-128/+295
r=centril Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14[WIP] fix tests after rebaseNiko Matsakis-47/+15
2019-12-14add `#![feature(never_type)]` to tests as neededNiko Matsakis-11/+15
2019-12-14Add regression test for #66757Niko Matsakis-0/+29
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-98/+264
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-12-14Auto merge of #67136 - oli-obk:const_stability, r=Centrilbors-62/+57
Require stable/unstable annotations for the constness of all stable fns with a const modifier r? @RalfJung @Centril Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
2019-12-13Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakisbors-74/+225
Point at method call when type annotations are needed - Point at method call instead of whole expression when type annotations are needed. - Suggest use of turbofish on function and methods. Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082. Fixes https://github.com/rust-lang/rust/issues/40015 r? @nikomatsakis
2019-12-13Rollup merge of #67278 - Centril:67273, r=oli-obkMazdak Farrokhzad-0/+49
`coerce_inner`: use initial `expected_ty` Fixes #67273. Follow-up to #59439. r? @oli-obk
2019-12-13Rollup merge of #67026 - Nadrieril:improve-usefulness-empty, ↵Mazdak Farrokhzad-53/+766
r=varkor,Centril,estebank Improve diagnostics and code for exhaustiveness of empty matches There was a completely separate check and diagnostics for the case of an empty match. This led to slightly different error messages and duplicated code. This improves code reuse and generally clarifies what happens for empty matches. This also clarifies the action of the `exhaustive_patterns` feature, and ensures that this feature doesn't change diagnostics in places it doesn't need to.
2019-12-13Ensure test actually uses dataflow, not simulationDylan MacKenzie-3/+7
2019-12-13Apply suggestions from reviewDylan MacKenzie-0/+2
2019-12-13Fix grammar in test descriptionecstatic-morse-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-12-13Bless modified testsDylan MacKenzie-80/+298
2019-12-13Bless unrelated tests with new help messageDylan MacKenzie-17/+48
2019-12-13Add qualif smoke tests for const loopsDylan MacKenzie-0/+61
2019-12-13Extend control flow basics tests with loopsDylan MacKenzie-9/+52
2019-12-13coerce_inner: use initial expected_tyMazdak Farrokhzad-0/+49
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-48/+50
functions with a `const` modifier
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-14/+7
2019-12-13Rollup merge of #67269 - Centril:recover-lt-deref-pat, r=estebankMazdak Farrokhzad-3/+39
parser: recover on `&'lifetime mut? $pat`. r? @estebank
2019-12-13Rollup merge of #67251 - oli-obk:stability_sieve, r=CentrilMazdak Farrokhzad-27/+32
Require `allow_internal_unstable` for stable min_const_fn using unsta… …ble features r? @Centril cc @ecstatic-morse @RalfJung
2019-12-13Rollup merge of #67247 - JohnTitor:fix-sugg, r=estebankMazdak Farrokhzad-0/+34
Don't suggest wrong snippet in closure Fixes #67190 r? @estebank
2019-12-13parser: recover on `&'lifetime mut $pat`.Mazdak Farrokhzad-3/+39
2019-12-12Require `allow_internal_unstable` for stable min_const_fn using unstable ↵Oliver Scherer-27/+32
features
2019-12-12Don't suggest wrong snippet in closureYuki Okushi-0/+34
2019-12-12Auto merge of #67246 - JohnTitor:rollup-nfa7skn, r=JohnTitorbors-29/+116
Rollup of 8 pull requests Successful merges: - #62514 (Clarify `Box<T>` representation and its use in FFI) - #66983 (Fix `unused_parens` triggers on macro by example code) - #67215 (Fix `-Z print-type-sizes`'s handling of zero-sized fields.) - #67230 (Remove irelevant comment on `register_dtor`) - #67236 (resolve: Always resolve visibilities on impl items) - #67237 (Some small readability improvements) - #67238 (Small std::borrow::Cow improvements) - #67239 (Make TinyList::remove iterate instead of recurse) Failed merges: r? @ghost
2019-12-11Add more context for type parametersEsteban Küber-36/+101
2019-12-12Rollup merge of #67236 - petrochenkov:docerr2, r=matthewjasperYuki Okushi-0/+34
resolve: Always resolve visibilities on impl items Fixes https://github.com/rust-lang/rust/issues/64705. Similarly to https://github.com/rust-lang/rust/pull/67106 this was an issue with visitor discipline. Impl items were visited as a part of visiting `ast::ItemKind::Impl`, but they should be visit-able in isolation from their parents as well, because that's how they are visited when they are expanded from macros. I've checked that all the remaining `resolve_visibility` calls are used correctly. r? @matthewjasper
2019-12-12Rollup merge of #67215 - nnethercote:fix-Zprint-type-size-zero-sized-fields, ↵Yuki Okushi-0/+62
r=pnkfelix Fix `-Z print-type-sizes`'s handling of zero-sized fields. Currently, the type `struct S { x: u32, y: u32, tag: () }` is incorrectly described like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.x`: 4 bytes print-type-size field `.tag`: 0 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size padding: 4 bytes print-type-size field `.y`: 4 bytes, alignment: 4 bytes ``` Specifically: - The `padding` line is wrong. (There is no padding.) - The `offset` and `alignment` on the `.tag` line shouldn't be printed. The problem is that multiple fields can end up with the same offset, and the printing code doesn't handle this correctly. This commit fixes it by adjusting the field sorting so that zero-sized fields are dealt with before non-zero-sized fields. With that in place, the printing code works correctly. The commit also corrects the "something is very wrong" comment. The new output looks like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.tag`: 0 bytes print-type-size field `.x`: 4 bytes print-type-size field `.y`: 4 bytes ``` r? @pnkfelix
2019-12-12Rollup merge of #66983 - weiznich:bugfix/issue_66295, r=estebankYuki Okushi-29/+20
Fix `unused_parens` triggers on macro by example code Fix #66295 Unfortunately this does also break [an existing test](https://github.com/rust-lang/rust/blob/4787e97475de6be9487e3d9255a9c2d3c0bf9252/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs#L22). I'm not sure how to handle that, because that seems to be quite similar to the allowed cases If this gets accepted it would be great to backport this fix to beta.
2019-12-11Auto merge of #66650 - matthewjasper:nonuniform-array-move, r=pnkfelixbors-75/+849
Remove uniform array move MIR passes This PR fixes a number of bugs caused by limitations of this pass * Projections from constant indexes weren't being canonicalized * Constant indexes from the start weren't being canonicalized (they could have different min_lengths) * It didn't apply to non-moves This PR makes the following changes to support removing this pass: * ConstantIndex of arrays are now generated in a canonical form (from the start, min_length is the actual length). * Subslices are now split when generating move paths and when checking subslices have been moved. Additionally * The parent move path of a projection from an array element is now calculated correctly closes #66502
2019-12-11Auto merge of #65345 - ↵bors-63/+265
davidtwco:issue-64130-async-send-sync-error-improvements, r=nikomatsakis async/await: improve not-send errors, part 2 Part of #64130. Fixes #65667. This PR improves the errors introduced in #64895 so that they have specialized messages for `Send` and `Sync`. r? @nikomatsakis
2019-12-11resolve: Always resolve visibilities on impl itemsVadim Petrochenkov-0/+34
2019-12-11Revert a diagnostic change in the case of integer rangesNadrieril-8/+8
2019-12-11Auto merge of #66821 - eddyb:global-trait-caching, r=nikomatsakisbors-2/+13
rustc: allow non-empty ParamEnv's in global trait select/eval caches. *Based on #66963* This appears to alleviate the symptoms of #65510 locally (without fixing WF directly), and is potentially easier to validate as sound (since it's a more ad-hoc version of queries we already have). I'm opening this PR primarily to test the effects on perf. r? @nikomatsakis cc @rust-lang/wg-traits
2019-12-11Rollup merge of #67164 - matthewjasper:never-remove-const, r=oli-obkMazdak Farrokhzad-0/+114
Ensure that panicking in constants eventually errors based on #67134 closes #66975 r? @oli-obk
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-7/+102
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
2019-12-11Rollup merge of #67015 - osa1:issue66971, r=wesleywiserMazdak Farrokhzad-0/+13
Fix constant propagation for scalar pairs We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes #66971 Fixes #66339 Fixes #67019