about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2023-04-01fix clippy::iter_kv_mapMatthias Krüger-3/+3
2023-03-13resolve: Remove `struct_field_names_untracked`Vadim Petrochenkov-2/+5
2023-03-13resolve: Centralize retrieval of items span and item nameVadim Petrochenkov-20/+13
2023-03-13resolve: Partially remove `item_attrs_untracked`Vadim Petrochenkov-8/+4
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-3/+3
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-27diagnostics: avoid querying `associated_item` in the resolverMichael Howell-2/+6
Fixes #108529
2023-02-23Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, ↵bors-2/+2
r=compiler-errors,davidtwco,estebank,oli-obk diagnostics: if AssocFn has self argument, describe as method Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods. For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods> > Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html), for example, `x.foo()`, as well as the usual function call notation. In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
2023-02-22resolve: Remove `ImportResolver`Vadim Petrochenkov-21/+19
It's a trivial wrapper over `Resolver` that doesn't bring any benefits
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-2/+2
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
2023-02-21Use `source_span` query instead of passing the untracked vec aroundOli Scherer-19/+12
2023-02-21Auto merge of #105462 - oli-obk:feeding_full, r=cjgillot,petrochenkovbors-70/+81
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-20Stuff a TyCtxt into the ResolverOli Scherer-3/+3
2023-02-20Make untracked.source_span lockable so that resolution can still write to it ↵Oli Scherer-3/+3
when using TyCtxt
2023-02-20Prepare crate loader for LockGuardOli Scherer-1/+1
2023-02-20Prepare for adding a `TyCtxt` to `Resolver`Oli Scherer-66/+77
2023-02-19Make public API, docs algorithm-agnosticJacob Pratt-1/+1
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-2/+2
2023-02-02Rename `rust_2015` => `is_rust_2015`Maybe Waffle-3/+5
2023-01-31Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obkGuillaume Gomez-1/+1
`Edition` micro refactor r? ``@oli-obk``
2023-01-31Don't do `.edition().rust_*()`Maybe Waffle-1/+1
2023-01-31Use `Edition` methods a bit moreMaybe Waffle-1/+1
2023-01-30Replace enum `==`s with `match`es where it makes senseMaybe Waffle-6/+6
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