summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/late
AgeCommit message (Collapse)AuthorLines
2022-11-29clean up pr 104954Rageking8-1/+1
2022-11-27make simple check of prinf function.Vincenzo Palazzo-0/+8
With this commit we start to make some simple check when the name resolution fails, and we generate some helper message in case the name is a C name like in the case of the `printf` and suggest the correct rust method. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-11-23resolve: Don't use constructor def ids in the map for field namesVadim Petrochenkov-2/+5
Also do some minor cleanup to insertion of those field names
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-10/+2
2022-11-17Use `ThinVec` in `ast::Path`.Nicholas Nethercote-2/+4
2022-11-17Box `ExprKind::{Closure,MethodCall}`, and `QSelf` in expressions, types, and ↵Nicholas Nethercote-10/+8
patterns.
2022-11-12Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebankDylan DPC-8/+10
Unhide unknown spans r? ```@estebank```
2022-11-11Rollup merge of #103531 - chenyukang:yukang/fix-103474, r=estebankManish Goregaokar-12/+12
Suggest calling the instance method of the same name when method not found Fixes #103474
2022-11-11Print all labels, even if they have no span. Fall back to main item's span.Oli Scherer-8/+10
2022-11-10Rollup merge of #104186 - chenyukang:yukang/fix-104086-let-binding-issue, ↵Manish Goregaokar-14/+7
r=oli-obk Tighten the 'introduce new binding' suggestion Fixes #104086
2022-11-09Make span_suggestions take IntoIteratorMichael Goulet-3/+3
2022-11-09DiagnosticBuilder -> DiagnosticMichael Goulet-5/+5
2022-11-10add 'is_assign_rhs' to avoid weird suggesting 'let'yukang-21/+7
2022-11-09fix tests and code cleanupyukang-5/+1
2022-11-09Fix #104086, Tighten the 'introduce new binding' suggestionyukang-7/+18
2022-11-05Do not make typo suggestions when suggesting pattern matchingDeadbeef-2/+13
Fixes #103909.
2022-10-30Rollup merge of #103560 - zbyrn:issue-103358-fix, r=cjgillotDylan DPC-15/+21
Point only to the identifiers in the typo suggestions of shadowed names instead of the entire struct Fixes #103358. As discussed in the issue, the `Span` of the candidate `Ident` for a typo replacement is stored alongside its `Symbol` in `TypoSuggestion`. Then, the span of the identifier is what the "you might have meant to refer to" note is pointed at, rather than the entire struct definition. Comments in #103111 and the issue both suggest that it is desirable to: 1. include names defined in the same crate as the typo, 2. ignore names defined elsewhere such as in `std`, _and_ 3. include names introduced indirectly via `use`. Since a name from another crate but introduced via `use` has non-local `def_id`, to achieve this, a suggestion is displayed if either the `def_id` of the suggested name is local, or the `span` of the suggested name is in the same file as the typo itself. Some UI tests have also been modified to reflect this change. r? `@cjgillot`
2022-10-29avoid unnecessary `&str` to `String` conversionsTakayuki Maeda-4/+1
2022-10-25Modify check to output 'you might have meant' for indirect referenceByron Zhong-2/+15
2022-10-25Add check to only output 'you might have meant' when the candidate name is ↵Byron Zhong-1/+2
in the same crate
2022-10-25Add Span in TypoSuggestion and TypoCandidateByron Zhong-16/+8
2022-10-26suggest calling the method of the same name when method not foundyukang-12/+12
2022-10-25Rollup merge of #103350 - clubby789:refer-to-assoc-method, r=wesleywiserYuki Okushi-13/+29
Change terminology for assoc method suggestions when they are not called Fixes #103325 ```@rustbot``` label +A-diagnostics
2022-10-23Rollup merge of #101908 - chenyukang:fix-101880, r=estebankDylan DPC-53/+43
Suggest let for assignment, and some code refactor Fixes #101880
2022-10-21Different suggestions for when associated functions are referred toclubby789-13/+29
2022-10-21Rollup merge of #103111 - cjgillot:shadow-label, r=estebankDylan DPC-9/+61
Account for hygiene in typo suggestions, and use them to point to shadowed names Fixes https://github.com/rust-lang/rust/issues/97459 r? `@estebank`
2022-10-20fix rust-lang#101880: suggest let for assignment, and some code refactoryukang-53/+43
2022-10-18Fix the bug of next_point in spanyukang-1/+1
2022-10-16Point to shadowed name when it exists.Camille GILLOT-5/+40
2022-10-16Account for hygiene when suggesting typos.Camille GILLOT-4/+21
2022-10-11Rollup merge of #102889 - petrochenkov:partres, r=cjgillotMatthias Krüger-22/+14
rustc_hir: Less error-prone methods for accessing `PartialRes` resolution
2022-10-11rustc_hir: Less error-prone methods for accessing `PartialRes` resolutionVadim Petrochenkov-22/+14
2022-10-10Move lifetime resolution module to rustc_hir_analysis.Camille GILLOT-1899/+0
2022-10-10Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8KiDylan DPC-2/+2
Rename `AssocItemKind::TyAlias` to `AssocItemKind::Type` Thanks `@camsteffen` for catching this in ast too, cc https://github.com/rust-lang/rust/pull/102829#issuecomment-1272649247
2022-10-10Rename AssocItemKind::TyAlias to AssocItemKind::TypeMichael Goulet-2/+2
2022-10-10Rollup merge of #102323 - Stoozy:master, r=cjgillotYuki Okushi-2/+31
Trying to suggest additional lifetime parameter ``@cjgillot`` This is what I have so far for #100615
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-1/+1
2022-10-01Removed unnecessary for loopstoozy-16/+9
2022-09-29Auto merge of #101887 - nnethercote:shrink-Res, r=spastorinobors-1/+1
Shrink `hir::def::Res` r? `@spastorino`
2022-09-29Emitting error regardless of new param suggestionstoozy-33/+33
2022-09-29Rollup merge of #102085 - chenyukang:code-refactor, r=cjgillotYuki Okushi-247/+366
Code refactoring smart_resolve_report_errors `smart_resolve_report_errors` https://github.com/rust-lang/rust/blob/4ecfdfac51b159f68fce608792affb34a70e6f73/compiler/rustc_resolve/src/late/diagnostics.rs#L143 is almost 600 lines of code, we should do some code refactoring.
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-1/+1
`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-28Proper span for new generic param suggestionstoozy-2/+7
2022-09-27Do not overwrite binders for another HirId.Camille GILLOT-20/+35
2022-09-27Properly formatting the multipart suggestionstoozy-1/+1
2022-09-26Using multipart suggestionstoozy-12/+19
2022-09-26Trying to suggest additional lifetime parameterstoozy-8/+32
2022-09-26trivial fix on fallbackyukang-3/+1
2022-09-26more code refactor on smart_resolve_report_errorsyukang-175/+207
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-16/+16
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`