about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2021-10-26Add a regression test for issue-89875Yuki Okushi-0/+14
2021-10-25Rollup merge of #90266 - b-naber:uneval_substs, r=lcnrMatthias Krüger-0/+25
Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated Fixes https://github.com/rust-lang/rust/issues/89334 The changes introduced in https://github.com/rust-lang/rust/pull/87280 allowed for "duplicate" caller bounds candidates to be assembled that only differed in their default substs having been "exposed" or not and resulted in an ambiguity error during trait selection. To fix this we expose the defaults substs during the creation of the ParamEnv. r? `@lcnr`
2021-10-25Rollup merge of #90017 - jackh726:issue-tests, r=nikomatsakisGuillaume Gomez-0/+28
Add a couple tests for normalize under binder issues Closes #56556 Closes #76956 r? ``@nikomatsakis``
2021-10-25add testsb-naber-0/+25
2021-10-25Rollup merge of #90127 - JohnTitor:fix-90113, r=estebankMatthias Krüger-0/+35
Do not mention a reexported item if it's private Fixes #90113 The _actual_ regression was introduced in #73652, then #88838 made it worse. This fixes the issue by not counting such an import as a candidate.
2021-10-25Rollup merge of #89889 - estebank:unmet-send-bound-on-foreign-future, r=tmandryMatthias Krüger-14/+3
Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate Partly address #78543 by making the error quieter. We don't have access to the `typeck` tables from foreign crates, so we used to completely skip the new code when checking foreign crates. Now, we carry on and don't provide as nice output (we don't clarify *what* is making the `Future: !Send`), but at least we no longer emit a sea of derived obligations in the output. [1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html r? `@tmandry`
2021-10-24Auto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726bors-69/+440
Point at overlapping impls when type annotations are needed Address https://github.com/rust-lang/rust/issues/89254.
2021-10-24Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crateEsteban Kuber-14/+3
Partly address #78543 by making the error quieter. We don't have access to the `typeck` tables from foreign crates, so we used to completely skip the new code when checking foreign crates. Now, we carry on and don't provide as nice output (we don't clarify *what* is making the `Future: !Send`), but at least we no longer emit a sea of derived obligations in the output. [1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html
2021-10-24Always sort suggestions before emitting themEsteban Kuber-22/+22
2021-10-24Point at overlapping impls when type annotations are neededEsteban Kuber-49/+420
2021-10-24Fix ICE when forgetting to `Box` a parameter to a `Self::func` callJakob Degen-0/+30
2021-10-23Auto merge of #90175 - cuviper:min-llvm-12, r=nagisabors-57/+48
Update the minimum external LLVM to 12 With this change, we'll have stable support for LLVM 12 and 13. For reference, the previous increase to LLVM 10 was #83387, and this replaces the pending increase to LLVM 11 in #90062. r? `@nagisa` `@nikic`
2021-10-23bless the line changes in ui/asm/aarch64/srcloc.rsJosh Stone-23/+23
2021-10-23Auto merge of #90203 - matthiaskrgr:rollup-v215wew, r=matthiaskrgrbors-111/+136
Rollup of 5 pull requests Successful merges: - #85833 (Scrape code examples from examples/ directory for Rustdoc) - #88041 (Make all proc-macro back-compat lints deny-by-default) - #89829 (Consider types appearing in const expressions to be invariant) - #90168 (Reset qualifs when a storage of a local ends) - #90198 (Add caveat about changing parallelism and function call overhead) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-23Rollup merge of #90168 - tmiasko:const-qualif-storage, r=matthewjasperMatthias Krüger-0/+20
Reset qualifs when a storage of a local ends Reset qualifs when a storage of a local ends to ensure that the local qualifs are affected by the state from previous loop iterations only if the local is kept alive. The change should be forward compatible with a stricter handling of indirect assignments, since storage dead invalidates all existing pointers to the local.
2021-10-23Rollup merge of #89829 - voidc:assoc-const-variance, r=lcnrMatthias Krüger-25/+32
Consider types appearing in const expressions to be invariant This is an approach to fix #80977. Currently, a type parameter which is only used in a constant expression is considered bivariant and will trigger error E0392 *"parameter T is never used"*. Here is a short example: ```rust pub trait Foo { const N: usize; } struct Bar<T: Foo>([u8; T::N]) where [(); T::N]:; ``` ([playgound](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=b51a272853f75925e72efc1597478aa5)) While it is possible to silence this error by adding a `PhantomData<T>` field, I think the better solution would be to make `T` invariant. This would be analogous to the invariance constraints added for associated types. However, I'm quite new to the compiler and unsure whether this is the right approach. r? ``@varkor`` (since you authored #60058)
2021-10-23Rollup merge of #88041 - Aaron1011:deny-proc-macro-hack, r=wesleywiserMatthias Krüger-86/+84
Make all proc-macro back-compat lints deny-by-default The affected crates have had plenty of time to update. By keeping these as lints rather than making them hard errors, we ensure that downstream crates will still be able to compile, even if they transitive depend on broken versions of the affected crates. This should hopefully discourage anyone from writing any new code which relies on the backwards-compatibility behavior.
2021-10-23Auto merge of #90104 - spastorino:coherence-for-negative-trait, r=nikomatsakisbors-22/+149
Implement coherence checks for negative trait impls The main purpose of this PR is to be able to [move Error trait to core](https://github.com/rust-lang/project-error-handling/issues/3). This feature is necessary to handle the following from impl on box. ```rust impl From<&str> for Box<dyn Error> { ... } ``` Without having negative traits affect coherence moving the error trait into `core` and moving that `From` impl to `alloc` will cause the from impl to no longer compiler because of a potential future incompatibility. The compiler indicates that `&str` _could_ introduce an `Error` impl in the future, and thus prevents the `From` impl in `alloc` that would cause overlap with `From<E: Error> for Box<dyn Error>`. Adding `impl !Error for &str {}` with the negative trait coherence feature will disable this error by encoding a stability guarantee that `&str` will never implement `Error`, making the `From` impl compile. We would have this in `alloc`: ```rust impl From<&str> for Box<dyn Error> {} // A impl<E> From<E> for Box<dyn Error> where E: Error {} // B ``` and this in `core`: ```rust trait Error {} impl !Error for &str {} ``` r? `@nikomatsakis` This PR was built on top of `@yaahc` PR #85764. Language team proposal: to https://github.com/rust-lang/lang-team/issues/96
2021-10-23Reset qualifs when a storage of a local endsTomasz Miąsko-0/+20
to ensure that the local qualifs are affected by the state from previous loop iterations only if the local is kept alive. The change should be forward compatible with a stricter handling of indirect assignments, since storage dead invalidates all existing pointers to the local.
2021-10-23Rollup merge of #90117 - calebsander:fix/rsplit-clone, r=yaahcMatthias Krüger-0/+11
Make RSplit<T, P>: Clone not require T: Clone This addresses a TODO comment. The behavior of `#[derive(Clone)]` *does* result in a `T: Clone` requirement. Playground example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a8b1a9581ff8893baf401d624a53d35b Add a manual `Clone` implementation, mirroring `Split` and `SplitInclusive`. `(R)?SplitN(Mut)?` don't have any `Clone` implementations, but I'll leave that for its own pull request.
2021-10-23Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davidtwcoMatthias Krüger-0/+37
Implement -Z location-detail flag This PR implements the `-Z location-detail` flag as described in https://github.com/rust-lang/rfcs/pull/2091 . `-Z location-detail=val` controls what location details are tracked when using `caller_location`. This allows users to control what location details are printed as part of panic messages, by allowing them to exclude any combination of filenames, line numbers, and column numbers. This option is intended to provide users with a way to mitigate the size impact of `#[track_caller]`. Some measurements of the savings of this approach on an embedded binary can be found here: https://github.com/rust-lang/rust/issues/70579#issuecomment-942556822 . Closes #70580 (unless people want to leave that open as a place for discussion of further improvements). This is my first real PR to rust, so any help correcting mistakes / understanding side effects / improving my tests is appreciated :) I have one question: RFC 2091 specified this as a debugging option (I think that is what -Z implies?). Does that mean this can never be stabilized without a separate MCP? If so, do I need to submit an MCP now, or is the initial RFC specifying this option sufficient for this to be merged as is, and then an MCP would be needed for eventual stabilization?
2021-10-23Rollup merge of #89730 - crlf0710:type_changing_feature, r=jackh726Matthias Krüger-0/+38
add feature flag for `type_changing_struct_update` This implements the PR0 part of the mentoring notes within #86618. overrides the previous inactive #86646 pr. r? ```@nikomatsakis```
2021-10-23Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726Matthias Krüger-0/+9
Report fatal lexer errors in `--cfg` command line arguments Fixes #89358. The erroneous behavior was apparently introduced by `@Mark-Simulacrum` in https://github.com/rust-lang/rust/commit/a678e3191197f145451c97c6cc884e15cae38186; the idea is to silence individual parser errors and instead emit one catch-all error message after parsing. However, for the example in #89358, a fatal lexer error is created here: https://github.com/rust-lang/rust/blob/edebf77e0090195bf80c0d8cda821e1bf9d03053/compiler/rustc_parse/src/lexer/mod.rs#L340-L349 This fatal error aborts the compilation, and so the call to `new_parser_from_source_str()` never returns and the catch-all error message is never emitted. I have therefore changed the `SilentEmitter` to silence only non-fatal errors; with my changes, for the rustc invocation described in #89358: ```sh rustc --cfg "abc\"" ``` I get the following output: ``` error[E0765]: unterminated double quote string | = note: this error occurred on the command line: `--cfg=abc"` ```
2021-10-22nice_region_error: Include lifetime placeholders in error outputMichael Howell-28/+28
As you can see in src/test/ui/traits/self-without-lifetime-constraint.stderr you can get very confusing type names if you don't have this. Fixes #87763
2021-10-22Hide negative coherence checks under negative_impls feature flagSantiago Pastorino-0/+32
2021-10-22Be sure that we do not allow too muchSantiago Pastorino-0/+36
2021-10-22Add rustc_strict_coherence attribute and use it to check overlapSantiago Pastorino-0/+49
2021-10-22Update the minimum external LLVM to 12Josh Stone-3/+1
2021-10-22Update the minimum external LLVM to 11Josh Stone-33/+26
2021-10-22add feature flag for `type_changing_struct_update`Charles Lew-0/+38
2021-10-22Rollup merge of #90115 - samlich:test-issue-78561, r=oli-obkYuki Okushi-0/+23
Add test for issue #78561 Adds test for and closes #78561 which previously crashed compiler.
2021-10-22Rollup merge of #90114 - BoxyUwU:cg_defaults_tests, r=lcnrYuki Okushi-2/+294
Add some tests for const_generics_defaults I think this covers some of the stuff required for stabilisation report, some of these tests are probably covering stuff we already have but it can't hurt to have more :) r? ````@lcnr````
2021-10-22Rollup merge of #90078 - JohnTitor:test-83479, r=Mark-SimulacrumYuki Okushi-0/+60
Add a regression test for issue-83479 Add a regression test for https://github.com/rust-lang/rust/issues/83479#issue-841147340, but not close the issue, see https://github.com/rust-lang/rust/issues/83479#issuecomment-947255641.
2021-10-22Rollup merge of #90069 - tmiasko:promoted-const-qualif, r=oli-obkYuki Okushi-0/+9
Fix const qualification when executed after promotion The const qualification was so far performed before the promotion and the implementation assumed that it will never encounter a promoted. With `const_precise_live_drops` feature, checking for live drops is delayed until after drop elaboration, which in turn runs after promotion. so the assumption is no longer true. When evaluating `NeedsNonConstDrop` it is now possible to encounter promoteds. Use type base qualification for the promoted. It is a sound approximation in general, and in the specific case of promoteds and `NeedsNonConstDrop` it is precise. Fixes #89938.
2021-10-22Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorinoYuki Okushi-0/+36
Reject closures in patterns Fixes #90013.
2021-10-22Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726Yuki Okushi-17/+32
Update E0637 description to mention `&` w/o an explicit lifetime name Deal with https://github.com/rust-lang/rust/issues/89824#issuecomment-941598647. Another solution would be splitting the error code into two as (I think) it's a bit unclear to users why they have the same error code.
2021-10-22Rollup merge of #89257 - aDotInTheVoid:macro-error-2, r=estebankYuki Okushi-0/+52
Give better error for `macro_rules name` follow up to #89221 r? ``@estebank`` ``@rustbot`` modify labels: +A-diagnostics +A-parser
2021-10-21Make RSplit<T, P>: Clone not require T: CloneCaleb Sander-0/+11
This addresses a TODO comment. The behavior of #[derive(Clone)] *does* result in a T: Clone requirement. Add a manual Clone implementation, matching Split and SplitInclusive.
2021-10-21add tests for -Zlocation-detailHudson Ayers-0/+37
2021-10-21Do not mention a reexported item if it's privateYuki Okushi-0/+35
2021-10-21Add test for issue #78561samlich-0/+23
2021-10-21Rollup merge of #90029 - tgnottingham:incr-debug-logging-test, r=Mark-SimulacrumYuki Okushi-4/+1
Add test for debug logging during incremental compilation Debug logging during incremental compilation had been broken for some time, until #89343 fixed it (among other things). Add a test so this is less likely to break without being noticed. This test is nearly a copy of the `src/test/ui/rustc-rust-log.rs` test, but tests debug logging in the incremental compliation code paths.
2021-10-21*dust dust*Ellen-2/+2
2021-10-20OrderingEllen-1/+10
2021-10-20add fixmeEllen-1/+1
2021-10-20InferenceEllen-0/+26
2021-10-20WfnessEllen-0/+59
2021-10-20Return pos impl traitEllen-0/+94
2021-10-20Trait objectsEllen-0/+104
2021-10-20Only assemble_candidates_from_impls for polarity NegativeSantiago Pastorino-22/+13