about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/collect.rs
AgeCommit message (Collapse)AuthorLines
2025-09-29Make replacement suggestion `_` in type verboseEsteban Küber-2/+2
``` error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/in-signature.rs:6:21 | LL | fn arr_fn() -> [u8; _] { | ^ not allowed in type signatures | help: replace with the correct return type | LL - fn arr_fn() -> [u8; _] { LL + fn arr_fn() -> [u8; 3] { | ```
2025-08-11Propagate TraitImplHeader to hirCameron Steffen-20/+16
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-2/+2
2025-07-28use let chains in ast, borrowck, codegen, const_evalKivooeo-6/+5
2025-07-17parse `const trait Trait`Deadbeef-4/+9
2025-07-13Retire hir::*ItemRef.Camille GILLOT-10/+11
2025-07-13Remove hir::AssocItemKind.Camille GILLOT-1/+1
2025-07-09Port `#[rustc_paren_sugar]` to the new attribute systemPavel Grigorenko-1/+1
2025-07-09Port `#[fundamental]` to the new attribute systemPavel Grigorenko-1/+1
2025-07-09Port `#[marker]` to the new attribute systemPavel Grigorenko-1/+1
2025-07-09Port `#[rustc_unsafe_specialization_marker]` to the new attribute systemPavel Grigorenko-8/+7
2025-07-09Port `#[rustc_specialization_trait]` to the new attribute systemPavel Grigorenko-1/+1
2025-07-09Port `#[rustc_coinductive]` to the new attribute systemPavel Grigorenko-1/+1
2025-07-09Port `#[rustc_do_not_implement_via_object]` to the new attribute systemPavel Grigorenko-2/+1
2025-07-09Port `#[rustc_deny_explicit_impl]` to the new attribute systemPavel Grigorenko-1/+1
2025-07-09Port `#[const_trait]` to the new attribute systemPavel Grigorenko-18/+22
2025-07-06compiler: rename {ast,hir}::BareFn* to FnPtr*Jubilee Young-1/+1
Fix some comments and related types and locals where it is obvious, e.g. - bare_fn -> fn_ptr - LifetimeBinderKind::BareFnType -> LifetimeBinderKind::FnPtrType Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2025-07-05Auto merge of #139598 - compiler-errors:no-bound-var-symbol, r=WaffleLapkinbors-7/+1
Remove `Symbol` from `Named` variant of `BoundRegionKind`/`LateParamRegionKind` The `Symbol` is redundant, since we already store a `DefId` in the region variant. Instead, load the name via `item_name` when needed (which is almost always on the diagnostic path). This introduces a `BoundRegionKind::NamedAnon` which is used for giving anonymous bound regions names, but which should only be used during pretty printing and error reporting.
2025-07-04Port `#[non_exhaustive]` to the new attribute parsing infrastructureJonathan Brouwer-3/+5
2025-07-04NitsMichael Goulet-3/+1
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-5/+1
2025-07-03compiler: document all provide fn in hir_analysis and hir_typeckJubilee Young-0/+1
2025-07-01Auto merge of #142030 - oli-obk:wfck-less-hir, r=compiler-errorsbors-148/+2
Start moving wf checking away from HIR I'm trying to only access the HIR in the error path. My hope is that once we move significant portions of wfcheck off HIR that incremental will be able to cache wfcheck queries significantly better. I think I am reaching a blocker because we normally need to provide good spans to `ObligationCause`, so that the trait solver can report good errors. In some cases I have been able to use bad spans and improve them depending on the `ObligationCauseCode` (by loading HIR in the case where we actually want to error). To scale that further we'll likely need to remove spans from the `ObligationCause` entirely (leaving it to some variants of `ObligationCauseCode` to have a span when they can't recompute the information later). Unsure this is the right approach, but we've already been using it. I will create an MCP about it, but that should not affect this PR, which is fairly limited in where it does those kind of tricks. Especially https://github.com/rust-lang/rust/commit/b862d8828e375ab8c128a9d9e93bf98b77cb5928 is interesting here, because I think it improves spans in all cases
2025-06-30Replace `ItemCtxt::report_placeholder_type_error` `match` with a call to ↵Guillaume Gomez-11/+1
`TyCtxt::def_descr`
2025-06-30Merge `lower_trait_item` and `lower_impl_item` into `check_item_type`Oli Scherer-47/+0
2025-06-30Merge `lower_item` into `check_item_type`Oli Scherer-101/+2
2025-06-27Report infer ty errors during hir ty loweringOli Scherer-186/+63
This centralizes the placeholder type error reporting in one location, but it also exposes the granularity at which we convert things from hir to ty more. E.g. previously infer types in where bounds were errored together with the function signature, but now they are independent.
2025-06-23Port `#[rustc_skip_during_method_dispatch]` to the new attribute systemPavel Grigorenko-16/+6
2025-06-17Dont replace escaping bound vars in item sigsBoxy-43/+33
2025-06-17Test whether we use DeepRejectCtxtBoxy-4/+8
2025-06-17Don't build `ParamEnv` and do trait solving in `ItemCtxt`sBoxy-3/+67
2025-06-12Remove lower_arg_ty as all callers were passing `None`Oli Scherer-1/+1
2025-06-05Remove CollectItemTypesVisitorOli Scherer-34/+5
2025-06-05wfcheck closuresOli Scherer-11/+0
2025-06-05Move generic arg checks from the hir item types visitor to ty wfcheckOli Scherer-23/+0
2025-06-05Move opaque type checks from the hir item types visitor onto the wfcheck of ↵Oli Scherer-17/+0
the opaqe type itself
2025-05-30Reorder fields in `hir::ItemKind` variants.Nicholas Nethercote-11/+11
Specifically `TyAlias`, `Enum`, `Struct`, `Union`. So the fields match the textual order in the source code. The interesting part of the change is in `compiler/rustc_hir/src/hir.rs`. The rest is extremely mechanical refactoring.
2025-05-27Use more detailed spans in dyn compat errors within bodiesOli Scherer-2/+6
2025-05-23Auto merge of #140553 - BoxyUwU:defer_type_system_ctfe, r=compiler-errorsbors-0/+25
Defer evaluating type system constants when they use infers or params Split out of #137972, the parts necessary for associated const equality and min generic const args to make progress and have correct semantics around when CTFE is invoked. According to a [previous perf run](https://perf.rust-lang.org/compare.html?start=93257e2d20809d82d1bc0fcc1942480d1a66d7cd&end=01b4cbf0f47c3f782330db88fa5ba199bba1f8a2&stat=instructions:u) of adding the new `const_arg_kind` query we should expect minor regressions here. I think this is acceptable as we should be able to remove this query relatively soon once mgca is more complete as we'll then be able to implement GCE in terms of mgca and rip out `GCEConst` at which point it's trivial to determine what kind of anon const we're dealing with (either it has generics and is a repeat expr hack, or it doesnt and is a normal anon const). This should only affect unstable code as we handle repeat exprs specially and those are the only kinds of type system consts that are allowed to make use of generic parameters. Fixes #133066 Fixes #133199 Fixes #136894 Fixes #137813 r? compiler-errors
2025-05-22Review CommentsBoxy-3/+3
2025-05-21Introduce `tcx.anon_const_kind` queryBoxy-0/+25
2025-05-06Name methods pertaining to HIR ty lowering of paths more appropriatelyLeón Orell Valerian Liehr-1/+1
2025-05-06Eliminate unnecessary parameterLeón Orell Valerian Liehr-3/+1
2025-04-14Move `has_self` field to `hir::AssocKind::Fn`.Nicholas Nethercote-3/+3
`hir::AssocItem` currently has a boolean `fn_has_self_parameter` field, which is misplaced, because it's only relevant for associated fns, not for associated consts or types. This commit moves it (and renames it) to the `AssocKind::Fn` variant, where it belongs. This requires introducing a new C-style enum, `AssocTag`, which is like `AssocKind` but without the fields. This is because `AssocKind` values are passed to various functions like `find_by_ident_and_kind` to indicate what kind of associated item should be searched for, and having to specify `has_self` isn't relevant there. New methods: - Predicates `AssocItem::is_fn` and `AssocItem::is_method`. - `AssocItem::as_tag` which converts `AssocItem::kind` to `AssocTag`. Removed `find_by_name_and_kinds`, which is unused. `AssocItem::descr` can now distinguish between methods and associated functions, which slightly improves some error messages.
2025-04-10Rollup merge of #139510 - nnethercote:name-to-ident, r=fee1-deadMatthias Krüger-2/+2
Rename some `name` variables as `ident`. It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`. This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk. r? `@fee1-dead`
2025-04-10Rename some `name` variables as `ident`.Nicholas Nethercote-2/+2
It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`. This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk.
2025-04-09Auto merge of #139552 - matthiaskrgr:rollup-b194mk8, r=matthiaskrgrbors-1/+3
Rollup of 10 pull requests Successful merges: - #139494 (Restrict some queries by def-kind more) - #139496 (Revert r-a changes of rust-lang/rust#139455) - #139506 (add missing word in doc comment (part 2)) - #139515 (Improve presentation of closure signature mismatch from `Fn` trait goal) - #139520 (compiletest maintenance: sort deps and drop dep on `anyhow`) - #139523 (Rustc dev guide subtree update) - #139526 (Fix deprecation note for std::intrinsics) - #139528 (compiletest: Remove the `--logfile` flag) - #139541 (Instantiate higher-ranked transmute goal w/ placeholders before emitting sub-obligations) - #139547 (Update library tracking issue template to set S-tracking-unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-08clean code: remove Deref<Target=RegionKind> impl for Region and use `.kind()`xizheyin-1/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-07Restrict some queries by def-kind moreMichael Goulet-1/+3
2025-04-06remove compiler support for `extern "rust-intrinsic"` blocksSkgland-7/+1