summary refs log tree commit diff
path: root/tests/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2023-05-18Simplify suggestion when returning bare dyn traitMichael Goulet-25/+17
2023-05-09Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillotMatthias Krüger-5/+5
Various changes to name resolution of anon consts Sorry this PR is kind of all over the place ^^' Fixes #111012 - Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments) - Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy` - Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993 - Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters - Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)` I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands. r? `@cjgillot` cc `@compiler-errors`
2023-05-05improve diagnostics and bless testsBoxy-5/+5
2023-05-05tweak "make mut" spans when assigning to localsEzra Shaw-1/+1
2023-05-03rustc_middle: Fix `opt_item_ident` for non-local def idsVadim Petrochenkov-1/+2
2023-05-01Don't use implied trait predicates in gather_explicit_predicates_ofMichael Goulet-2/+11
2023-04-17Spelling - compilerJosh Soref-1/+1
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-1/+2
2023-04-11Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiserYuki Okushi-6/+10
Update `error [E0449]: unnecessary visibility qualifier` to be more clear This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore. Resolves #109822.
2023-04-03Update ui tests involving invalid visibility qualifiersTam Pham-6/+10
2023-04-03Perform match checking on THIR.Camille GILLOT-17/+3
2023-03-21evaluate: improve and fix recursion depth handlinglcnr-1/+1
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-16/+37
2023-03-08may not => cannotMichael Goulet-3/+3
2023-02-25docs/test: add UI test and docs for `E0476`Ezra Shaw-0/+44
2023-02-23diagnostics: remove inconsistent English article "this" from E0107Michael Howell-20/+20
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.
2023-02-22diagnostics: update test cases to refer to assoc fn with `self` as methodMichael Howell-4/+4
2023-02-16Rollup merge of #106347 - estebank:removal-suggestion, r=TaKO8KiMatthias Krüger-5/+4
More accurate spans for arg removal suggestion Partially address #106304.
2023-02-14Fetch less HIR in signature check.Camille GILLOT-1/+1
2023-02-14Make removal suggestion not verboseEsteban Küber-6/+4
2023-02-14rebase and review commentsEsteban Küber-1/+1
2023-02-14More accurate spans for arg removal suggestionEsteban Küber-2/+3
2023-02-13Tighter spans for bad inherent impl typesMichael Goulet-7/+7
2023-02-06Add extended error message for E0523Matthew Kelly-0/+27
Adds the extended error documentation for E0523 to indicate that the error is no longer produced by the compiler. Update the E0464 documentation to include example code that produces the error. Remove the error message E0523 from the compiler and replace it with an internal compiler error.
2023-01-30Modify primary span label for E0308Esteban Küber-2/+2
The previous output was unintuitive to users.
2023-01-27internally change regions to be covariantAli MJ Al-Nasrawy-2/+2
2023-01-25Rollup merge of #106897 - estebank:issue-99430, r=davidtwcoMatthias Krüger-3/+10
Tweak E0597 CC #99430
2023-01-23add UI test + docs for `E0789`Ezra Shaw-0/+27
2023-01-19Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errorsGuillaume Gomez-0/+16
document + UI test `E0208` and make its output more user-friendly Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it. r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off. Part of https://github.com/rust-lang/rust/issues/61137.
2023-01-18remove error code from `#[rustc_variance]` and document its remainsEzra Shaw-0/+16
2023-01-18special case removing `&` suggestionEzra Shaw-6/+19
2023-01-16make `CastError::NeedsDeref` create a `MachineApplicable` suggestion + other ↵Ezra Shaw-4/+6
misc fixes
2023-01-15Tweak E0597Esteban Küber-3/+10
CC #99430
2023-01-13Rollup merge of #106585 - estebank:issue-46585, r=compiler-errorsMatthias Krüger-2/+6
When suggesting writing a fully qualified path probe for appropriate types Address the more common part of #46585.
2023-01-12Point at impl self type for impl wf obligationsMichael Goulet-2/+2
2023-01-12Auto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errorsbors-17/+3
Rollup of 8 pull requests Successful merges: - #103236 (doc: rewrite doc for signed int::{carrying_add,borrowing_sub}) - #103800 (Stabilize `::{core,std}::pin::pin!`) - #106097 (Migrate mir_build diagnostics 2 of 3) - #106170 (Move autoderef to `rustc_hir_analysis`) - #106323 (Stabilize f16c_target_feature) - #106360 (Tweak E0277 `&`-removal suggestions) - #106524 (Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch) - #106739 (Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-11Rollup merge of #106097 - mejrs:mir_build2, r=oli-obkMichael Goulet-17/+3
Migrate mir_build diagnostics 2 of 3 The first three commits are fairly boring, however I've made some changes to the output of the match checking diagnostics.
2023-01-12Rollup merge of #106167 - yanchen4791:issue-105544-fix, r=oli-obkMatthias Krüger-5/+22
Fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311 Fixes #105544 The problems: The suggestion given for E0311 has invalid syntax when the synthetic type parameter is used for Trait type in function declaration: ```rust fn foo(d: impl Sized) -> impl Sized ``` instead of explicitly specified like the following: ```rust fn foo<T: Sized>(d: T) -> impl Sized ``` In addition to the syntax error, the suggestions given for E0311 are not complete when multiple elided lifetimes are involved in lifetime bounds, not all involved parameters are given the named lifetime in the suggestions. For the following test case: ``` fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ { (d, p) } ``` a good suggestion should add the lifetime 'a to both d and p, instead of d only: ``` fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ { (d, p) } ``` The Solution: Fix the syntax problem in the suggestions when synthetic type parameter is used, and also add lifetimes for all involved parameters.
2023-01-11Fix invalid syntax in impl Trait parameter type suggestions for E0311yanchen4791-5/+22
2023-01-11Don't recommend `if let` if `let else` worksmejrs-5/+1
2023-01-11Migrate pattern matchingmejrs-13/+3
2023-01-11When suggesting writing a fully qualified path probe for appropriate typesEsteban Küber-2/+6
Fix #46585.
2023-01-11Note predicate span on ImplDerivedObligationMichael Goulet-1/+1
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-2/+2
2023-01-11Move /src/test to /testsAlbert Larsan-0/+7197