summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2023-01-22Auto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, ↵bors-1/+1
r=Mark-Simulacrum Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error" This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36 aka PR #84022 I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.
2023-01-20Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"Felix S. Klock II-1/+1
This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36. I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.
2023-01-20diagnostics: remvoe unnecessary use of `source_map.start_point`Michael Howell-1/+1
2023-01-20diagnostics: use `module_path` to check crate import instead of stringsMichael Howell-20/+4
2023-01-20diagnostics: add `};` only if `{` was added tooMichael Howell-5/+5
2023-01-20diagnostics: suggest changing `s@self::{macro}@::macro` for exportedMichael Howell-1/+29
Fixes #99695
2023-01-17note -> helpMichael Goulet-1/+1
2023-01-17Fix use suggestion spanMichael Goulet-7/+9
2023-01-12Render missing generics suggestion verboselyMichael Goulet-1/+1
2023-01-11review comments: Tweak outputEsteban Küber-1/+13
* Account for `struct S(pub(super)Ty);` in suggestion * Suggest changing field visibility in E0603 too
2023-01-09review commentMichael Goulet-6/+5
2022-12-27Dont clobber `as ..` rename in import suggestionMichael Goulet-1/+8
2022-12-27Note alternative import candidates in nested use treeMichael Goulet-2/+3
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-1/+2
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-3/+3
2022-12-09Generate crate loaders on the flyOli Scherer-1/+1
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