about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
AgeCommit message (Collapse)AuthorLines
2024-03-29rustdoc: point at span in `include_str!`-ed md fileMichael Howell-7/+38
2024-03-28remove `def_id_to_node_id` in ast loweringbohan-1/+0
2024-03-27Do not sort `DefId`s in diagnosticsOli Scherer-11/+9
2024-03-26Rollup merge of #123091 - Bryanskiy:delegation-fixes, r=petrochenkovMatthias Krüger-11/+42
Delegation: fix ICE on wrong `self` resolution fixes https://github.com/rust-lang/rust/issues/122874 Delegation item should be wrapped in a `rib` to behave like a regular function during name resolution. r? `@petrochenkov`
2024-03-26Rollup merge of #122766 - bvanjoi:fix-115185, r=petrochenkovMatthias Krüger-16/+52
store segment and module in `UnresolvedImportError` Fixes #115185 An easy fix. r? `@Nilstrieb`
2024-03-26Delegation: fix ICE on wrong `self` resolutionBryanskiy-11/+42
2024-03-21Don't suggest deref macro since it's unstableMichael Goulet-1/+6
2024-03-21Auto merge of #121587 - ShoyuVanilla:fix-issue-121267, r=TaKO8Kibors-36/+22
Fix bad span for explicit lifetime suggestions Fixes #121267 Current explicit lifetime suggestions are not showing correct spans for some lifetimes - e.g. elided lifetime generic parameters; This should be done correctly regarding elided lifetime kind like the following code https://github.com/rust-lang/rust/blob/43fdd4916d19f4004e23d422b5547637ad67ab21/compiler/rustc_resolve/src/late/diagnostics.rs#L3015-L3044
2024-03-21Fix bad span for explicit lifetime suggestionShoyu Vanilla-36/+22
Move verbose logic to a function Minor renaming
2024-03-20Ignore paths from expansion in `unused_qualifications`Alex Macleod-1/+3
2024-03-20store segment and module in `UnresolvedImportError`bohan-16/+52
2024-03-19Rollup merge of #122435 - jieyouxu:unused_qualifications_global_paths, ↵Matthias Krüger-0/+7
r=petrochenkov Don't trigger `unused_qualifications` on global paths Fixes #122374.
2024-03-16Auto merge of #121926 - tgross35:f16-f128-step3-feature-gate, ↵bors-1/+51
r=compiler-errors,petrochenkov `f16` and `f128` step 3: compiler support & feature gate Continuation of https://github.com/rust-lang/rust/pull/121841, another portion of https://github.com/rust-lang/rust/pull/114607 This PR exposes the new types to the world and adds a feature gate. Marking this as a draft because I need some feedback on where I did the feature gate check. It also does not yet catch type via suffixed literals (so the feature gate test will fail, probably some others too because I haven't belssed). If there is a better place to check all types after resolution, I can do that. If not, I figure maybe I can add a second gate location in AST when it checks numeric suffixes. Unfortunately I still don't think there is much testing to be done for correctness (codegen tests or parsed value checks) until we have basic library support. I think that will be the next step. Tracking issue: https://github.com/rust-lang/rust/issues/116909 r? `@compiler-errors` cc `@Nilstrieb` `@rustbot` label +F-f16_and_f128
2024-03-15Rollup merge of #122530 - klensy:as_str, r=fee1-deadGuillaume Gomez-3/+4
less symbol interner locks This reduces instructions under 1% (in rustdoc run), but essentially free.
2024-03-15Don't trigger `unused_qualifications` on global paths许杰友 Jieyou Xu (Joe)-0/+7
# Conflicts: # tests/ui/lint/lint-qualification.stderr
2024-03-15less symbols interner locksklensy-3/+4
2024-03-14Rollup merge of #122373 - surechen:fix_121331, r=petrochenkovMatthias Krüger-22/+85
Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification` and `unused_imports` fixes #121331 For an `item` that triggers lint unnecessary_qualification, if the `use item` which imports this item is also trigger unused import, fixing the two lints at the same time may lead to the problem that the `item` cannot be found. This PR will avoid reporting lint unnecessary_qualification when conflict occurs. r? ``@petrochenkov``
2024-03-14Add feature gates for `f16` and `f128`Trevor Gross-1/+51
Includes related tests and documentation pages. Michael Goulet: Don't issue feature error in resolver for f16/f128 unless finalize Co-authored-by: Michael Goulet <michael@errs.io>
2024-03-14fixes #121331surechen-22/+85
2024-03-13delay expand macro bang when there has indeterminate pathbohan-34/+51
2024-03-12Manual rustfmtOli Scherer-2/+2
2024-03-12s/mt/mutability/Oli Scherer-2/+4
2024-03-12Add `nested` bool to `DefKind::Static`.Oli Scherer-2/+2
Will be used in the next commit
2024-03-12Change `DefKind::Static` to a struct variantOli Scherer-6/+6
2024-03-11Rename `IntoDiagnosticArg` as `IntoDiagArg`.Nicholas Nethercote-3/+3
Also rename `into_diagnostic_arg` as `into_diag_arg`, and `NotIntoDiagnosticArg` as `NotInotDiagArg`.
2024-03-11Remove `Default` derive from `MacroExpectedFound`.Nicholas Nethercote-2/+3
It's the only diagnostic in the entire project that impls `Default`, and the code is clearer without it.
2024-03-08Rollup merge of #119365 - nbdd0121:asm-goto, r=AmanieuMatthias Krüger-0/+1
Add asm goto support to `asm!` Tracking issue: #119364 This PR implements asm-goto support, using the syntax described in "future possibilities" section of [RFC2873](https://rust-lang.github.io/rfcs/2873-inline-asm.html#asm-goto). Currently I have only implemented the `label` part, not the `fallthrough` part (i.e. fallthrough is implicit). This doesn't reduce the expressive though, since you can use label-break to get arbitrary control flow or simply set a value and rely on jump threading optimisation to get the desired control flow. I can add that later if deemed necessary. r? ``@Amanieu`` cc ``@ojeda``
2024-03-07Rollup merge of #121089 - oli-obk:create_def_feed, r=petrochenkovGuillaume Gomez-54/+89
Remove `feed_local_def_id` best reviewed commit by commit Basically I returned `TyCtxtFeed` from `create_def` and then preserved that in the local caches based on https://github.com/rust-lang/rust/pull/121084 r? ````@petrochenkov````
2024-03-07Merge `check_mod_impl_wf` and `check_mod_type_wf`Oli Scherer-4/+13
2024-03-07Auto merge of #122113 - matthiaskrgr:rollup-5d1jnwi, r=matthiaskrgrbors-71/+77
Rollup of 9 pull requests Successful merges: - #121958 (Fix redundant import errors for preload extern crate) - #121976 (Add an option to have an external download/bootstrap cache) - #122022 (loongarch: add frecipe and relax target feature) - #122026 (Do not try to format removed files) - #122027 (Uplift some feeding out of `associated_type_for_impl_trait_in_impl` and into queries) - #122063 (Make the lowering of `thir::ExprKind::If` easier to follow) - #122074 (Add missing PartialOrd trait implementation doc for array) - #122082 (remove outdated fixme comment) - #122091 (Note why we're using a new thread in `test_get_os_named_thread`) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-06Rollup merge of #122038 - Alexendoo:unused-qualifications, r=petrochenkovMatthias Krüger-33/+37
Fix linting paths with qself in `unused_qualifications` Fixes #121999 `resolve_qpath` ends up being called again with `qself` set to `None` to check trait items from fully qualified paths. To avoid this the lint is moved to a place that accounts for this already https://github.com/rust-lang/rust/blob/96561a8fd134e8f2b205769a4fca03b392d9f484/compiler/rustc_resolve/src/late.rs#L4074-L4088 r? `````@petrochenkov`````
2024-03-06Fix redundant import errors for preload extern crateyukang-71/+77
2024-03-06avoid overlapping privacy suggestion for single nested importsbohan-25/+44
2024-03-06Auto merge of #122041 - matthiaskrgr:rollup-imsmdke, r=matthiaskrgrbors-4/+6
Rollup of 8 pull requests Successful merges: - #121202 (Limit the number of names and values in check-cfg diagnostics) - #121301 (errors: share `SilentEmitter` between rustc and rustfmt) - #121658 (Hint user to update nightly on ICEs produced from outdated nightly) - #121846 (only compare ambiguity item that have hard error) - #121961 (add test for #78894 #71450) - #121975 (hir_analysis: enums return `None` in `find_field`) - #121978 (Fix duplicated path in the "not found dylib" error) - #121991 (Merge impl_trait_in_assoc_types_defined_by query back into `opaque_types_defined_by`) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-05Rollup merge of #121846 - bvanjoi:fix-121760, r=petrochenkovMatthias Krüger-4/+6
only compare ambiguity item that have hard error Fixes #121760 An easy fix, r? ``@petrochenkov``
2024-03-05Fix linting paths with qself in `unused_qualifications`Alex Macleod-33/+37
2024-03-05Move visitor utils to `rustc_ast_ir`Jason Newcomb-1/+1
2024-03-05Remove a use of feed_local_crate and make it fail if used within queriesOli Scherer-7/+11
2024-03-05Prevent feeding `CRATE_DEF_ID` queries outside the resolverOli Scherer-2/+5
2024-03-05Get rid of `feed_local_def_id`Oli Scherer-1/+1
2024-03-05Eliminate all non-CRATE_DEF_ID uses of `feed_def_id`Oli Scherer-28/+39
2024-03-05Preserve the `Feed` in local tablesOli Scherer-9/+23
2024-03-05Bubble up the TyCtxtFeedOli Scherer-12/+15
2024-03-05Rename `DiagnosticMetadata` as `DiagMetadata`.Nicholas Nethercote-92/+86
2024-03-05Rename `BuiltinLintDiagnostics` as `BuiltinLintDiag`.Nicholas Nethercote-22/+22
Not the dropping of the trailing `s` -- this type describes a single diagnostic and its name should be singular.
2024-03-05Rename `DiagnosticMode` as `DiagMode`.Nicholas Nethercote-22/+19
2024-03-04Rollup merge of #121969 - nnethercote:ParseSess-cleanups, r=wesleywiserMatthias Krüger-2/+2
`ParseSess` cleanups The main change here is to rename all `ParseSess` values as `psess`. Plus a few other small cleanups. r? `@wesleywiser`
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-2/+2
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
2024-03-04Rollup merge of #121130 - chenyukang:yukang-fix-121061-macro-later, ↵Matthias Krüger-1/+37
r=matthiaskrgr Suggest moving definition if non-found macro_rules! is defined later Fixes #121061
2024-03-03Rollup merge of #121528 - Alexendoo:unused_qualifications, r=petrochenkovMatthias Krüger-22/+24
Consider middle segments of paths in `unused_qualifications` Currently `unused_qualifications` looks at the last segment of a path to see if it can be trimmed, this PR extends the check to the middle segments also ```rust // currently linted use std::env::args(); std::env::args(); // Removes `std::env::` ``` ```rust // newly linted use std::env; std::env::args(); // Removes `std::` ``` Paths with generics in them are now linted as long as the part being trimmed is before any generic args, e.g. it will now suggest trimming `std::vec::` from `std::vec::Vec<usize>` Paths with any segments that are from an expansion are no longer linted Fixes #100979 Fixes #96698