about summary refs log tree commit diff
path: root/tests/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2024-02-18Improve wording of static_mut_refObei Sideg-7/+7
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-17const_mut_refs: allow mutable refs to staticsRalf Jung-54/+18
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-53/+53
2024-02-15Rollup merge of #121107 - estebank:capitalization-suggestion, r=michaelwoeristerGuillaume Gomez-1/+1
Fix msg for verbose suggestions with confusable capitalization When encountering a verbose/multipart suggestion that has changes that are only caused by different capitalization of ASCII letters that have little differenciation, expand the message to highlight that fact (like we already do for inline suggestions). The logic to do this was already present, but implemented incorrectly.
2024-02-14Fix msg for verbose suggestions with confusable capitalizationEsteban Küber-1/+1
When encountering a verbose/multipart suggestion that has changes that are only caused by different capitalization of ASCII letters that have little differenciation, expand the message to highlight that fact (like we already do for inline suggestions). The logic to do this was already present, but implemented incorrectly.
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-5/+60
2024-02-10don't skip coercions for types with errorsLukas Markeffsky-44/+3
2024-02-10unstably allow constants to refer to statics and read from immutable staticsRalf Jung-15/+0
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-6/+39
2024-02-08Auto merge of #120558 - oli-obk:missing_impl_item_ice, r=estebankbors-9/+54
Stop bailing out from compilation just because there were incoherent traits fixes #120343 but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.
2024-02-06Rollup merge of #119939 - clubby789:static-const-generic-note, r=compiler-errorsMatthias Krüger-2/+2
Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items Fixes #109596 Fixes #119936
2024-02-05Stop bailing out from compilation just because there were incoherent traitsOli Scherer-9/+54
2024-02-04Rollup merge of #120556 - fmease:improve-unused-generic-param-diags, r=oli-obkMatthias Krüger-5/+11
Improve the diagnostics for unused generic parameters * Don't emit two errors (namely E0091 *and* E0392) for unused type parameters on *lazy* type aliases * Fix the diagnostic help message of E0392 for *lazy* type aliases: Don't talk about the “fields” of lazy type aliases (use the term “body” instead) and don't suggest `PhantomData` for them, it doesn't make much sense * Consolidate the diagnostics for E0091 (unused type parameters in type aliases) and E0392 (unused generic parameters due to bivariance) and make it translatable * Still keep the error codes distinct (for now) * Naturally leads to better diagnostics for E0091 r? ```@oli-obk``` (to ballast your review load :P) or compiler
2024-02-01Improve the diagnostics for unused generic parametersLeón Orell Valerian Liehr-5/+11
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-2/+2
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-4/+4
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-14Special case 'generic param from outer item' message for `Self`clubby789-2/+2
2024-01-13Bless testsGeorge-lewis-0/+8
Update tests
2024-01-11Taint more aggressively in astconvOli Scherer-23/+3
2024-01-09Auto merge of #117449 - oli-obk:query_merge_immobile_game, r=matthewjasperbors-6/+76
Avoid silencing relevant follow-up errors r? `@matthewjasper` This PR only adds new errors to tests that are already failing and fixes one ICE. Several tests were changed to not emit new errors. I believe all of them were faulty tests, and not explicitly testing for the code that had new errors.
2024-01-09Avoid silencing relevant follow-up errorsOli Scherer-6/+76
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-11/+30
2024-01-05Stabilize THIR unsafeckMatthew Jasper-1/+1
2024-01-05Remove revisions for THIR unsafeckMatthew Jasper-15/+1
This is to make the diff when stabilizing it easier to review.
2023-12-28rustc_lint: Prevent multiple 'incompatible with previous forbid' lintsMartin Nordholts-13/+1
2023-12-20Update existing testsVeera-7/+3
2023-12-15Collect lang items from ASTMichael Goulet-2/+2
2023-12-14update use of feature flagslcnr-1/+1
2023-12-10Remove edition umbrella features.Eric Huss-19/+0
2023-12-07Resolve assoc item bindings by namespaceLeón Orell Valerian Liehr-1/+1
If a const is expected, resolve a const. If a type is expected, resolve a type. Don't try to resolve a type first falling back to consts.
2023-12-05Add print_trait_sugaredMichael Goulet-1/+1
2023-11-30Enable link-arg link kind inside of #[link] attributezetanumbers-1/+1
- Implement link-arg as an attribute - Apply suggestions from review - Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> - Add unstable book entry
2023-11-24Auto merge of #118138 - Nilstrieb:one-previous-error, r=WaffleLapkinbors-194/+194
Fixes error count display is different when there's only one error left Supersedes #114759 ### What did I do? I did the small change in `rustc_errors` by hand. Then I did the other changes in `/compiler` by hand, those were just find replace on `*.rs` in the workspace. The changes in run-make are find replace for `run-make` in the workspace. All other changes are blessed using `x test TEST --bless`. I blessed the tests that were blessed in #114759. ### how to review this nightmare ping bors with an `r+`. You should check that my logic is sound and maybe quickly scroll through the diff, but fully verifying it seems fairly hard to impossible. I did my best to do this correctly. Thank you `@adrianEffe` for bringing this up and your initial implementation. cc `@flip1995,` you said you want to do a subtree sync asap cc `@RalfJung` maybe you want to do a quick subtree sync afterwards as well for Miri r? `@WaffleLapkin`
2023-11-24Show number in error message even for one errorNilstrieb-194/+194
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-23fix intercrate ambiguity causeslcnr-4/+37
2023-11-16recover primary span labelEsteban Küber-4/+4
2023-11-16Suggest `unwrap()` on field not found for `Result`/`Option`Esteban Küber-1/+6
When encountering a `Result<T, _>` or `Option<T>` where `T` has a field that's being accessed, suggest calling `.unwrap()` to get to the field.
2023-11-16Suggest field typo through derefsEsteban Küber-4/+4
Take into account implicit dereferences when suggesting fields. ``` error[E0609]: no field `longname` on type `Arc<S>` --> $DIR/suggest-field-through-deref.rs:10:15 | LL | let _ = x.longname; | ^^^^^^^^ help: a field with a similar name exists: `long_name` ``` CC https://github.com/rust-lang/rust/issues/78374#issuecomment-719564114
2023-11-04Rollup merge of #117343 - Nadrieril:cleanup_check_match, r=davidtwcoTakayuki Maeda-3/+3
Cleanup `rustc_mir_build/../check_match.rs` The file had become pretty unwieldy, with a fair amount of duplication. As a bonus, I discovered that we weren't running some pattern checks in if-let chains. I recommend looking commit-by-commit. The last commit is a whim, I think it makes more sense that way but I don't hold this opinion strongly.
2023-11-04Remove support for compiler plugins.Nicholas Nethercote-16/+0
They've been deprecated for four years. This commit includes the following changes. - It eliminates the `rustc_plugin_impl` crate. - It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`. - E0457 and E0498 are no longer used. - E0463 is narrowed, now only relating to unfound crates, not plugins. - The `plugin` feature was moved from "active" to "removed". - It removes the entire plugins chapter from the unstable book. - It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`. Closes #29597.
2023-11-03Tweak spans for "adt defined here" noteNadrieril-3/+3
2023-10-30Detect object safety errors when assoc type is missingEsteban Küber-5/+5
When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
2023-10-24Use `PlaceMention` for match scrutinees.Camille GILLOT-2/+24
2023-10-21Rollup merge of #116992 - estebank:issue-69492, r=oli-obkMatthias Krüger-0/+1
Mention the syntax for `use` on `mod foo;` if `foo` doesn't exist Newcomers might get confused that `mod` is the only way of defining scopes, and that it can be used as if it were `use`. Fix #69492.
2023-10-21Mention the syntax for `use` on `mod foo;` if `foo` doesn't existEsteban Küber-0/+1
Newcomers might get confused that `mod` is the only way of defining scopes, and that it can be used as if it were `use`. Fix #69492.
2023-10-20s/Generator/Coroutine/Oli Scherer-7/+7
2023-10-17Unify suggestion wordingEsteban Küber-7/+5
2023-10-15don't UB on dangling ptr deref, instead check inbounds on projectionsRalf Jung-1/+1
2023-10-11Auto merge of #116623 - Nadrieril:validate-range-endpoints, r=oli-obkbors-2/+2
Fix overflow checking in range patterns When a range pattern contains an overflowing literal, if we're not careful we might not notice the overflow and use the wrapped value. This makes for confusing error messages because linting against overflowing literals is only done in a later pass. So when a range is invalid we check for overflows to provide a better error. This check didn't use to handle negative types; this PR fixes that. First commit adds tests, second cleans up without changing behavior, third does the fix. EDIT: while I was at it, I fixed a small annoyance about the span of the overflow lint on negated literals. Fixes https://github.com/rust-lang/rust/issues/94239
2023-10-11Fix range overflow checkingNadrieril-2/+2