about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/late
AgeCommit message (Collapse)AuthorLines
2023-03-15error-msg: impl better suggestion for `E0532`Ezra Shaw-16/+32
2023-03-13resolve: Remove `struct_field_names_untracked`Vadim Petrochenkov-17/+27
2023-03-13resolve: Centralize retrieval of items span and item nameVadim Petrochenkov-31/+16
2023-03-13resolve: Remove `fn_has_self_parameter_untracked`Vadim Petrochenkov-1/+11
2023-03-13resolve: Remove `struct_field_visibilities_untracked`Vadim Petrochenkov-12/+31
2023-03-07Simplify `sort_by` callsMaybe Waffle-1/+1
2023-03-05Auto merge of #108351 - petrochenkov:rmdit, r=cjgillotbors-3/+2
rustc_middle: Remove trait `DefIdTree` This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-03Match unmatched backticks in comments in compiler/est31-1/+1
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-3/+2
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-21Auto merge of #105462 - oli-obk:feeding_full, r=cjgillot,petrochenkovbors-30/+41
give the resolver access to TyCtxt The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR. Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes. ### PRs split out of this one and leading up to it: * https://github.com/rust-lang/rust/pull/105423 * https://github.com/rust-lang/rust/pull/105357 * https://github.com/rust-lang/rust/pull/105603 * https://github.com/rust-lang/rust/pull/106776 * https://github.com/rust-lang/rust/pull/106810 * https://github.com/rust-lang/rust/pull/106812 * https://github.com/rust-lang/rust/pull/108032
2023-02-20Prepare crate loader for LockGuardOli Scherer-2/+1
2023-02-20Prepare for adding a `TyCtxt` to `Resolver`Oli Scherer-28/+40
2023-02-19Make public API, docs algorithm-agnosticJacob Pratt-3/+3
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-5/+3
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-2/+2
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-2/+2
2023-02-03unused-lifetimes: don't warn about lifetimes originating from expanded codeMatthias Krüger-12/+16
previously, we would warn like this: ```` warning: lifetime parameter `'s` never used --> /tmp/unusedlif/code.rs:6:62 | 5 | #[derive(Clone)] | - help: elide the unused lifetime 6 | struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As)); | ^^ | = note: requested on the command line with `-W unused-lifetimes` ```` Fixes #104432
2023-02-02Rename `rust_2015` => `is_rust_2015`Maybe Waffle-1/+1
2023-01-25suggest qualifying bare associated constantsAndy Russell-5/+12
2023-01-16fix #104440Takayuki Maeda-3/+19
2023-01-12Don't suggest dyn as parameter to addMichael Goulet-1/+5
2023-01-11review comments: Tweak outputEsteban Küber-12/+3
* Account for `struct S(pub(super)Ty);` in suggestion * Suggest changing field visibility in E0603 too
2023-01-11review commentEsteban Küber-1/+1
2023-01-11Suggest making private tuple struct field publicEsteban Küber-0/+20
Fix #52144.
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-2/+2
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-18use &str / String literals instead of format!()Matthias Krüger-6/+2
2022-12-13Rollup merge of #104864 - chenyukang:yukang/fix-104700-binding, r=estebankMatthias Krüger-0/+16
Account for item-local in inner scope for E0425 Fixes #104700
2022-12-09Generate crate loaders on the flyOli Scherer-4/+5
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-25fix the crossing function issueyukang-1/+1
2022-11-25fix #104700, account for item-local in inner scope for E0425yukang-0/+16
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