about summary refs log tree commit diff
path: root/tests/ui/resolve
AgeCommit message (Collapse)AuthorLines
2024-03-14fixes #121331surechen-2/+28
2024-03-08Auto merge of #122190 - matthiaskrgr:rollup-9ol4y30, r=matthiaskrgrbors-0/+108
Rollup of 8 pull requests Successful merges: - #121025 (add known-bug tests for derive failure to detect packed repr) - #121194 (Refactor pre-getopts command line argument handling) - #121563 (Use `ControlFlow` in visitors.) - #122173 (Don't ICE in CTFE if raw/fn-ptr types differ) - #122175 (Bless tidy issues order) - #122179 (rustc: Fix typo) - #122181 (Fix crash in internal late lint checking) - #122183 (interpret: update comment about read_discriminant on uninhabited variants) Failed merges: - #122076 (Tweak the way we protect in-place function arguments in interpreters) - #122132 (Diagnostic renaming 3) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-07Add known-bug tests for `derive(PartialEq)` mismatches with ↵Oli Scherer-0/+108
`#[repr(packed)]` attributes that are not visible before macro expansion
2024-03-07Merge collect_mod_item_types query into check_well_formedOli Scherer-20/+14
2024-03-01If suggestion would leave an empty line, delete itclubby789-1/+0
2024-02-29Don't cancel stashed `TraitMissingMethod` errors.Nicholas Nethercote-6/+34
This gives one extra error message on two tests, but is necessary to fix bigger problems caused by the cancellation of stashed errors. (Note: why not just avoid stashing altogether? Because that resulted in additional output changes.)
2024-02-22Deduplicate some logic and reword outputEsteban Küber-1/+1
2024-02-22Make confusable suggestions `verbose`Esteban Küber-4/+6
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-81/+81
2024-02-14Auto merge of #120847 - oli-obk:track_errors9, r=compiler-errorsbors-2/+17
Continue compilation after check_mod_type_wf errors The ICEs fixed here were probably reachable through const eval gymnastics before, but now they are easily reachable without that, too. The new errors are often bugfixes, where useful errors were missing, because they were reported after the early abort. In other cases sometimes they are just duplication of already emitted errors, which won't be user-visible due to deduplication. fixes https://github.com/rust-lang/rust/issues/120860
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-2/+17
2024-02-14remove importing suggestions when there is a shadowed typo canddiateyukang-0/+19
2024-02-07Update testsr0cky-3/+5
2024-02-06Rollup merge of #119939 - clubby789:static-const-generic-note, r=compiler-errorsMatthias Krüger-7/+31
Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items Fixes #109596 Fixes #119936
2024-02-02Suggest changing ty to const params if appropriateLeón Orell Valerian Liehr-0/+93
2024-01-14Special case 'generic param from outer item' message for `Self`clubby789-7/+7
2024-01-14Add note to resolve error about generics from inside static/constclubby789-0/+24
2024-01-05fix cycle error for "use constructor" suggestionLukas Markeffsky-11/+11
2024-01-05fix OOM when `ty::Instance` is used in query descriptionLukas Markeffsky-0/+37
2024-01-03Track `HirId` instead of `Span` in `ObligationCauseCode::SizedArgumentType`Esteban Küber-4/+0
This gets us more accurate suggestions.
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-2/+2
2023-12-06Auto merge of #118687 - matthiaskrgr:rollup-317ztgu, r=matthiaskrgrbors-0/+19
Rollup of 6 pull requests Successful merges: - #117981 (Remove deprecated `--check-cfg` syntax) - #118177 (Suppress warnings in LLVM wrapper when targeting MSVC) - #118317 (tip for define macro name after `macro_rules!`) - #118504 (Enforce `must_use` on associated types and RPITITs that have a must-use trait in bounds) - #118660 (rustc_arena: add `alloc_str`) - #118681 (Fix is_foreign_item for StableMIR instance ) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-06tip for define macro name after `macro_rules!`bohan-0/+19
2023-12-06Use the glob binding in resolve_rustdoc_path processr0cky-0/+20
2023-11-30generic_const_exprs: suggest to add the feature, not use itRalf Jung-1/+1
2023-11-27Dont suggest `!` for path in function call if it has generic argsMichael Goulet-0/+13
2023-11-24Show number in error message even for one errorNilstrieb-71/+71
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-07When not finding assoc fn on type, look for builder fnEsteban Küber-0/+26
When we have a resolution error when looking at a fully qualified path on a type, look for all associated functions on inherent impls that return `Self` and mention them to the user. Fix #69512.
2023-10-16Rollup merge of #116257 - estebank:issue-101351, r=b-naberMatthias Krüger-2/+52
Suggest trait bounds for used associated type on type param Fix #101351. When an associated type on a type parameter is used, and the type parameter isn't constrained by the correct trait, suggest the appropriate trait bound: ``` error[E0220]: associated type `Associated` not found for `T` --> file.rs:6:15 | 6 | field: T::Associated, | ^^^^^^^^^^ there is a similarly named associated type `Associated` in the trait `Foo` | help: consider restricting type parameter `T` | 5 | struct Generic<T: Foo> { | +++++ ``` When an associated type on a type parameter has a typo, suggest fixing it: ``` error[E0220]: associated type `Baa` not found for `T` --> $DIR/issue-55673.rs:9:8 | LL | T::Baa: std::fmt::Debug, | ^^^ there is a similarly named associated type `Bar` in the trait `Foo` | help: change the associated type name to use `Bar` from `Foo` | LL | T::Bar: std::fmt::Debug, | ~~~ ```
2023-10-13Stabilize AFIT and RPITITMichael Goulet-31/+2
2023-10-13Suggest trait bounds for used associated type on type paramEsteban Küber-2/+52
Fix #101351. When an associated type on a type parameter is used, and the type parameter isn't constrained by the correct trait, suggest the appropriate trait bound: ``` error[E0220]: associated type `Associated` not found for `T` --> file.rs:6:15 | 6 | field: T::Associated, | ^^^^^^^^^^ there is a similarly named associated type `Associated` in the trait `Foo` | help: consider restricting type parameter `T` | 5 | struct Generic<T: Foo> { | +++++ ``` When an associated type on a type parameter has a typo, suggest fixing it: ``` error[E0220]: associated type `Baa` not found for `T` --> $DIR/issue-55673.rs:9:8 | LL | T::Baa: std::fmt::Debug, | ^^^ there is a similarly named associated type `Bar` in the trait `Foo` | help: change the associated type name to use `Bar` from `Foo` | LL | T::Bar: std::fmt::Debug, | ~~~ ```
2023-10-02Rollup merge of #114454 - Nilstrieb:no-evil-sorting, r=cjgillotTyler Mandry-21/+21
Replace `HashMap` with `IndexMap` in pattern binding resolve fixes https://github.com/rust-lang/rust/pull/114332#discussion_r1284189179
2023-10-02Replace `HashMap` with `IndexMap` in pattern binding resolveNilstrieb-21/+21
It will be iterated over, so we should avoid using `HashMap`.
2023-10-01Auto merge of #116228 - bvanjoi:fix-116164, r=cjgillotbors-0/+33
resolve: skip underscore character during candidate lookup Fixes #116164 In use statement, an underscore is merely a placeholder symbol and does not bind to any name. Therefore, it can be safely ignored.
2023-09-28resolve: skip underscore character during candidate lookupbohan-0/+33
2023-09-25Point at field definition when unresolved name exists in `Self`Esteban Küber-14/+32
2023-09-25When suggesting `self.x` for `S { x }`, use `S { x: self.x }`Esteban Küber-37/+174
Tweak output. Fix #115992.
2023-09-24Rollup merge of #116086 - estebank:issue-115992, r=compiler-errorsMatthias Krüger-3/+39
More accurate suggestion for `self.` and `Self::` Detect that we can't suggest `self.` in an associated function without `&self` receiver. Partially address #115992. r? ``@compiler-errors``
2023-09-23Add testEsteban Küber-0/+36
2023-09-23Tweak wording and logicEsteban Küber-3/+3
2023-09-19rustc_hir_analysis: add a helper to check function the signature mismatchesEduardo Sánchez Muñoz-4/+4
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions. The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
2023-09-11Rollup merge of #115744 - fmease:fix-e0401, r=compiler-errorsMatthias Krüger-67/+168
Improve diagnostic for generic params from outer items (E0401) Generalize the wording of E0401 to talk about *outer items* instead of *outer functions* since the current phrasing is outdated. The outer item can be a function, constant, trait, ADT or impl block (see the new UI test for the more exotic examples). Further, don't suggest introducing generic parameters to constant items unless the feature `generic_const_items` is enabled. Lastly, make E0401 translatable while we're at it. Fixes #115720.
2023-09-10Do not suggest generic const items unless enabledLeón Orell Valerian Liehr-0/+101
2023-09-10Generalize E0401León Orell Valerian Liehr-67/+67
2023-09-07Find lowest span out of use + attrsMichael Goulet-1/+1
2023-09-07Test showing it doesnt workMichael Goulet-0/+45
2023-08-28Move testsCaio-0/+20
2023-08-18Bless test changesGary Guo-9/+9
2023-08-06Rollup merge of #114503 - ↵Matthias Krüger-0/+10
chenyukang:yukang-fix-114433-unused-qualifications, r=compiler-errors Remove invalid lint when there is a generic argument in prefix path Fixes #114433
2023-08-05Remove invalid lint when there is a generic argument in prefix pathyukang-0/+10