summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2023-01-21Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"Mark Rousskov-1/+1
This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36.
2022-12-03fix #101749, use . instead of :: when accessing a method of an objectyukang-4/+7
2022-11-18Auto merge of #104573 - matthiaskrgr:rollup-k36ybtp, r=matthiaskrgrbors-362/+182
Rollup of 8 pull requests Successful merges: - #101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1) - #103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting)) - #103405 (Detect incorrect chaining of if and if let conditions and recover) - #103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets) - #104006 (Add variant_name function to `LangItem`) - #104494 (Migrate GUI test to use functions) - #104516 (rustdoc: clean up sidebar width CSS) - #104550 (fix a typo) Failed merges: - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-17Use `ThinVec` in `ast::Path`.Nicholas Nethercote-1/+2
2022-11-13migrating rustc_resolve to SessionDiagnostic. work in progress. startRajput, Rajat-362/+182
implement binding_shadows migrate till self-in-generic-param-default use braces in fluent message as suggested by @compiler-errors. to fix lock file issue reported by CI migrate 'unreachable label' error run formatter name the variables correctly in fluent file SessionDiagnostic -> Diagnostic test "pattern/pat-tuple-field-count-cross.rs" passed test "resolve/bad-env-capture2.rs" passed test "enum/enum-in-scope.rs" and other depended on "resolve_binding_shadows_something_unacceptable" should be passed now. fix crash errors while running test-suite. there might be more. then_some(..) suits better here. all tests passed convert TraitImpl and InvalidAsm. TraitImpl is buggy yet. will fix after receiving help from Zulip migrate "Ralative-2018" migrate "ancestor only" migrate "expected found" migrate "Indeterminate" migrate "module only" revert to the older implementation for now. since this is failing at the moment. follow the convension for fluent variable order the diag attribute as suggested in review comment fix merge error. migrate trait-impl-duplicate make the changes compatible with "Flatten diagnostic slug modules #103345" fix merge remove commented code merge issues fix review comments fix tests
2022-11-11Print all labels, even if they have no span. Fall back to main item's span.Oli Scherer-4/+6
2022-11-01Rollup merge of #103760 - petrochenkov:macimp, r=cjgillotDylan DPC-15/+21
resolve: Turn the binding from `#[macro_export]` into a proper `Import` Continuation of https://github.com/rust-lang/rust/pull/91795. ```rust #[macro_export] macro_rules! m { /*...*/ } ``` is desugared to something like ```rust macro_rules! m { /*...*/ } // Non-modularized macro_rules item pub use m; // It's modularized reexport ``` This PR adjusts the internal representation to better match this model.
2022-11-01Rollup merge of #84022 - Aaron1011:remove-derive-res-fallback, r=petrochenkovDylan DPC-1/+1
Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error r? `@ghost`
2022-10-31resolve: Turn the binding from `#[macro_export]` into a proper `Import`Vadim Petrochenkov-14/+20
2022-10-31resolve: Not all imports have their own `NodeId`Vadim Petrochenkov-1/+1
2022-10-25Add Span in TypoSuggestion and TypoCandidateByron Zhong-14/+31
2022-10-24Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard errorAaron Hill-1/+1
2022-10-16Account for hygiene when suggesting typos.Camille GILLOT-5/+8
2022-10-12Rollup merge of #102913 - SparrowLii:import-candidate, r=compiler-errorsDylan DPC-35/+33
unify `IsPattern` and `IsImport` enum in `show_candidates` Follow-up of #102876 A binding cannot appear in both pattern and import at the same time, so it makes sense to unify them r? `@compiler-errors`
2022-10-12unify `IsPattern` and `IsImport` enumSparrowLii-35/+33
2022-10-11Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkovMatthias Krüger-0/+13
Check uniqueness of impl items by trait item when applicable. When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items. This means that a plain item and one generated by a macro 2.0 do not collide. This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls. This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice. There should be no stable breakage, since macros 2.0 are still unstable. r? ``@petrochenkov`` cc ``@RalfJung`` Fixes https://github.com/rust-lang/rust/issues/71614.
2022-10-11Report duplicate definitions in trait impls during resolution.Camille GILLOT-0/+13
2022-10-10suggest candidates for unresolved importSparrowLii-2/+36
2022-10-05Delay function resolution error until typeckMichael Goulet-2/+8
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-15/+10
`Res::SelfTy` currently has two `Option`s. When the second one is `Some` the first one is never consulted. So we can split it into two variants, `Res::SelfTyParam` and `Res::SelfTyAlias`, reducing the size of `Res` from 24 bytes to 12. This then shrinks `hir::Path` and `hir::PathSegment`, which are the HIR types that take up the most space.
2022-09-03more clippy::perf fixesMatthias Krüger-1/+1
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+0
by module
2022-08-28Remove `register_attr` featureYuki Okushi-10/+0
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-08-23Mark suggestion as MaybeIncorrect.Camille GILLOT-1/+1
2022-08-23Improve local generic parameter suggestions.Camille GILLOT-18/+15
2022-08-23Create specific ConstantHasGenerics for ConstantItemRibKind.Camille GILLOT-1/+1
2022-08-07Don't ICE while suggesting updating item path.Luqman Aden-6/+9
When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE. Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases.
2022-07-28Remove guess_head_span.Camille GILLOT-5/+1
2022-07-28change the type of `note` field to `Option<String>`Takayuki Maeda-17/+14
2022-07-26Rollup merge of #99729 - cjgillot:rm-unused-tuple, r=michaelwoeristerMatthias Krüger-1/+1
Remove unused tuple fields Found by https://github.com/rust-lang/rust/pull/95977
2022-07-25Unused tuple fields in rustc_resolve.Camille GILLOT-1/+1
2022-07-25avoid `&str`/`Symbol` to `String` conversionsTakayuki Maeda-2/+1
2022-07-21Rollup merge of #99528 - matthiaskrgr:2022_07_perf, r=estebankMatthias Krüger-1/+1
couple of clippy::perf fixes
2022-07-20clippy::perf fixesMatthias Krüger-1/+1
2022-07-20avoid `&str` to String conversionsTakayuki Maeda-2/+2
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-1/+1
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-1/+1
2022-07-13avoid `&str` to `String` conversionsTakayuki Maeda-2/+2
2022-07-11Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-deadDylan DPC-1/+1
Implement `SourceMap::is_span_accessible` This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.
2022-07-11rename a methodTakayuki Maeda-1/+1
2022-07-11implement `is_accessible_span`Takayuki Maeda-1/+1
2022-07-10Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obkMatthias Krüger-4/+1
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
2022-07-10avoid some `&str` to `String` conversionsTakayuki Maeda-4/+1
2022-07-09Rollup merge of #99008 - obeis:issue-98974, r=compiler-errorsDylan DPC-4/+19
Adding suggestion for E0530 Closes #98974
2022-07-08Update ui test for the new E0530 suggestionObei Sideg-2/+1
2022-07-08Check if E0530 is `rustc_resolve::late::PatternSource::Match` to emit suggestionObei Sideg-5/+8
2022-07-08Check if E0530 is `tuple variant` or `tuple struct` to emit suggestionObei Sideg-8/+14
2022-07-07Adding suggestion for E0530Obei Sideg-0/+7
2022-07-07suggest adding a derive for #[default] applied to variantsDeadbeef-4/+10
2022-07-05fix typo in note about multiple inaccessible type aliasesClementTsang-1/+3
Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope, and there are multiple inaccessible type aliases that match the missing type. In general this change would use the correct plural form in this scenario for words that end with 's'.