summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-02-24add test for the new pocIvan Komarov-0/+33
2020-02-23Correct stderr output for failing testsMark Rousskov-11/+12
2020-02-22Check types of statics in MIR typeckMatthew Jasper-0/+81
2020-02-22Check `Copy` lifetimes bounds when copying from a projectionMatthew Jasper-0/+26
2020-02-22Resolve long compile times when evaluating always valid constantsWesley Wiser-0/+87
This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539
2020-02-22Do not ICE when encountering `yield` inside `async` blockEsteban Küber-0/+15
2020-02-21Revert "Remove `checked_add` in `Layout::repeat`"Sebastian Hahn-0/+31
This fixes a a segfault in safe code, a stable regression. Reported in \#69225. This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494. Also adds a test for the expected behaviour.
2020-01-27Make pointers to statics internalMatthew Jasper-0/+62
2020-01-23Distinguish between private items and hidden items in rustdocDavid Tolnay-5/+30
I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document. This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another.
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-13Treat extern statics just like statics in the "const pointer to static" ↵Oliver Scherer-0/+71
representation
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/+300
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/+16
2019-12-14Add regression test for #66757Niko Matsakis-0/+29
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-98/+268
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-12-14Auto merge of #67136 - oli-obk:const_stability, r=Centrilbors-64/+61
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-13Fix rustdoc testOliver Scherer-2/+4
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-15/+8
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