about summary refs log tree commit diff
path: root/compiler/rustc_resolve
AgeCommit message (Collapse)AuthorLines
2024-04-27Rollup merge of #124382 - petrochenkov:itemvisit, r=lcnrMatthias Krüger-7/+5
ast: Generalize item kind visiting And avoid duplicating logic for visiting `Item`s with different kinds (regular, associated, foreign). The diff is better viewed with whitespace ignored.
2024-04-26Rollup merge of #124391 - nnethercote:builtin_macros-cleanups, r=fee1-deadJacob Pratt-10/+10
`rustc_builtin_macros` cleanups Some improvements I found while looking over this code. r? ``@fee1-dead``
2024-04-26Introduce `DeriveResolution`.Nicholas Nethercote-10/+10
Making this a proper struct, and giving its fields names, makes things easier to understand.
2024-04-25ast: Generalize item kind visitingVadim Petrochenkov-7/+5
And avoid duplicating logic for visiting `Item`s with different kinds (regular, associated, foreign).
2024-04-24resolve: Remove two cases of misleading macro call visitingVadim Petrochenkov-12/+3
Macro calls are ephemeral, they should not add anything to the definition tree, even if their AST could contains something with identity. Thankfully, macro call AST cannot contain anything like that, so these walks are just noops. In majority of other places in def_collector / build_reduced_graph they are already not visited. (Also, a minor match reformatting is included.)
2024-04-23delegation: Support async, const, extern "ABI" and C-variadic functionsVadim Petrochenkov-18/+19
Also allow `impl Trait` in delegated functions. The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created.
2024-04-23Rollup merge of #124218 - Xiretza:subsubdiagnostics, r=davidtwcoLeón Orell Valerian Liehr-8/+8
Allow nesting subdiagnostics in #[derive(Subdiagnostic)]
2024-04-23Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwcoMatthias Krüger-1/+1
weak lang items are not allowed to be #[track_caller] For instance the panic handler will be called via this import ```rust extern "Rust" { #[lang = "panic_impl"] fn panic_impl(pi: &PanicInfo<'_>) -> !; } ``` A `#[track_caller]` would add an extra argument and thus make this the wrong signature. The 2nd commit is a consistency rename; based on the docs [here](https://doc.rust-lang.org/unstable-book/language-features/lang-items.html) and [here](https://rustc-dev-guide.rust-lang.org/lang-items.html) I figured "lang item" is more widely used. (In the compiler output, "lang item" and "language item" seem to be pretty even.)
2024-04-21Move "elided lifetime in path" to subdiagnostic structXiretza-8/+8
This requires nested subdiagnostics.
2024-04-17Rename `BindingAnnotation` to `BindingMode`Jules Bertholet-3/+3
2024-04-17consistency rename: language item -> lang itemRalf Jung-1/+1
2024-04-15More polishingMichael Goulet-0/+6
2024-04-15Use a path instead of an ident (and stop manually resolving)Michael Goulet-54/+12
2024-04-15Validation and other thingsMichael Goulet-0/+35
2024-04-15Implement resolution, parse use<Self>Michael Goulet-2/+22
2024-04-15Use dedicated PreciseCapturingArg for representing what goes in use<>Michael Goulet-0/+10
2024-04-15Parsing , pre-lowering support for precise capturesMichael Goulet-2/+2
2024-04-13Reorder error messagesJean CASPAR-14/+6
2024-04-13Migrate more diagnosticsJean CASPAR-174/+537
2024-04-13Migrate some diagnosticsJean CASPAR-70/+48
2024-04-13Port build_reduce_graphJeanCASPAR-51/+235
2024-04-12Rollup merge of #123204 - notriddle:notriddle/include-str-span, r=pnkfelixMatthias Krüger-7/+38
rustdoc: point at span in `include_str!`-ed md file Fixes #118549
2024-04-11Silence unused_imports lint for redundant importsMichael Goulet-1/+3
2024-04-03Rollup merge of #123307 - tgross35:f16-f128-feature-gate-fix, r=petrochenkovJacob Pratt-0/+2
Fix f16 and f128 feature gating on different editions Apply the fix from https://github.com/rust-lang/rust/issues/123282#issuecomment-2035063388 to correctly gates `f16` and `f128` in editions other than 2015
2024-04-03Fix f16 and f128 feature gates in editions other than 2015Trevor Gross-0/+2
Fixes https://github.com/rust-lang/rust/issues/123282 Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2024-04-03rustc_index: Add a `ZERO` constant to index typesVadim Petrochenkov-3/+3
It is commonly used.
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