about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
AgeCommit message (Collapse)AuthorLines
2024-07-14find_field does not need to be a query.Camille GILLOT-19/+0
2024-07-11Auto merge of #127575 - chenyukang:yukang-fix-struct-fields-ice, ↵bors-1/+4
r=compiler-errors Avoid "no field" error and ICE on recovered ADT variant Fixes https://github.com/rust-lang/rust/issues/126744 Fixes https://github.com/rust-lang/rust/issues/126344, a more general fix compared with https://github.com/rust-lang/rust/pull/127426 r? `@oli-obk` From `@compiler-errors` 's comment https://github.com/rust-lang/rust/pull/127502#discussion_r1669538204 Seems most of the ADTs don't have taint, so maybe it's not proper to change `TyCtxt::type_of` query.
2024-07-11report pat no field error no recoverd struct variantyukang-1/+4
2024-07-10Rollup merge of #127094 - Borgerr:E0191-suggestion-correction, r=fmeaseMatthias Krüger-1/+13
E0191 suggestion correction, inserts turbofish closes #91997
2024-07-09E0191 suggestion correction, inserts turbofish without dyn (#91997)Ashton Hunt-1/+13
2024-07-09Auto merge of #127358 - oli-obk:taint_itemctxt, r=fmeasebors-182/+194
Automatically taint when reporting errors from ItemCtxt This isn't very robust yet, as you need to use `itemctxt.dcx()` instead of `tcx.dcx()` for it to take effect, but it's at least more convenient than sprinkling `set_tainted_by_errors` calls in individual places. based on https://github.com/rust-lang/rust/pull/127357 r? `@fmease`
2024-07-09Auto merge of #127493 - compiler-errors:crate-level-import, r=lcnrbors-13/+13
Move trait selection error reporting to its own top-level module This effectively moves `rustc_trait_selection::traits::error_reporting` to `rustc_trait_selection::error_reporting::traits`. There are only a couple of actual changes to the code, like moving the `pretty_impl_header` fn out of the specialization module for privacy reasons. This is quite pointless on its own, but having `error_reporting` as a top-level module in `rustc_trait_selection` is very important to make sure we have a meaningful file structure for when we move **type** error reporting (and region error reporting, with which it's incredibly entangled currently) into `rustc_trait_selection`. I've opened a tracking issue here: #127492 r? lcnr
2024-07-09Remove HirTyLowerer::set_tainted_by_errors, since it is now redundantOli Scherer-91/+96
2024-07-09Automatically taint when reporting errors from ItemCtxtOli Scherer-94/+101
2024-07-09Auto merge of #127200 - fee1-dead-contrib:trait_def_const_trait, ↵bors-12/+12
r=compiler-errors Add `constness` to `TraitDef` Second attempt at fixing the regression @ https://github.com/rust-lang/rust/pull/120639#issuecomment-2198373716 r? project-const-traits
2024-07-08Move trait selection error reporting to its own top-level moduleMichael Goulet-13/+13
2024-07-08Remove `structured_errors` moduleOli Scherer-5/+2
2024-07-08Remove `StructuredDiag`Oli Scherer-78/+43
2024-07-08Remove another `StructuredDiag` implOli Scherer-73/+1
2024-07-08Rollup merge of #127452 - fee1-dead-contrib:fx-intrinsic-counting, r=fmease许杰友 Jieyou Xu (Joe)-6/+12
Fix intrinsic const parameter counting with `effects` r? project-const-traits
2024-07-08Rollup merge of #127439 - compiler-errors:uplift-elaborate, r=lcnr许杰友 Jieyou Xu (Joe)-12/+11
Uplift elaboration into `rustc_type_ir` Allows us to deduplicate and consolidate elaboration (including these stupid elaboration duplicate fns i added for pretty printing like 3 years ago) so I'm pretty hyped about this change :3 r? lcnr
2024-07-08Rollup merge of #127437 - compiler-errors:uplift-trait-ref-is-knowable, r=lcnr许杰友 Jieyou Xu (Joe)-8/+10
Uplift trait ref is knowable into `rustc_next_trait_solver` Self-explanatory. Eliminates one more delegate method. r? lcnr cc ``@fmease``
2024-07-07Auto merge of #127172 - compiler-errors:full-can_eq-everywhere, r=lcnrbors-49/+44
Make `can_eq` process obligations (almost) everywhere Move `can_eq` to an extension trait on `InferCtxt` in `rustc_trait_selection`, and change it so that it processes obligations. This should strengthen it to be more accurate in some cases, but is most important for the new trait solver which delays relating aliases to `AliasRelate` goals. Without this, we always basically just return true when passing aliases to `can_eq`, which can lead to weird errors, for example #127149. I'm not actually certain if we should *have* `can_eq` be called on the good path. In cases where we need `can_eq`, we probably should just be using a regular probe. Fixes #127149 r? lcnr
2024-07-07Uplift trait_ref_is_knowable and friendsMichael Goulet-8/+8
2024-07-07Add fundamental to trait defMichael Goulet-0/+2
2024-07-07Fix intrinsic const parameter counting with `effects`Deadbeef-6/+12
2024-07-07iter_identity is a better nameMichael Goulet-12/+11
2024-07-06Import via rustc_type_ir::outlivesMichael Goulet-1/+1
We could use rustc_middle::ty::outlives I guess?
2024-07-05Rollup merge of #127392 - estebank:arg-type, r=jieyouxuJubilee-3/+3
Use verbose suggestion for changing arg type
2024-07-05Use verbose suggestion for changing arg typeEsteban Küber-3/+3
2024-07-05Rework receiver_is_validMichael Goulet-50/+42
2024-07-05Actually just make can_eq process obligations (almost) everywhereMichael Goulet-9/+4
2024-07-05Process alias-relate obligations when proving receiver_is_validMichael Goulet-1/+9
2024-07-05Use `ControlFlow` results for visitors that are only looking for a single valueOli Scherer-42/+32
2024-07-04Rollup merge of #127319 - oli-obk:fail2taint, r=compiler-errorsMatthias Krüger-69/+1
Remove a use of `StructuredDiag`, which is incompatible with automatic error tainting and error translations fixes #127219 I want to remove all of `StructuredDiag`, but it's a bit more involved as it is also used from the `ItemCtxt`, which doesn't support tainting yet.
2024-07-04Remove a use of `StructuredDiag`, which is incompatible with automatic error ↵Oli Scherer-69/+1
tainting and error translations
2024-07-04Better suggestion span for missing type parameterEsteban Küber-4/+3
2024-07-03Add `constness` to `TraitDef`Deadbeef-12/+12
2024-07-02Rewrite dropckBoxy-9/+25
2024-07-01Rollup merge of #127181 - BoxyUwU:dump_def_parents, r=compiler-errorsMatthias Krüger-1/+50
Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId` We've run into a bunch of issues with anon consts having the wrong generics and it would have been incredibly helpful to be able to quickly slap a `rustc_` attribute to check what `tcx.parent(` will return on the relevant DefIds. I wasn't sure of a better way to make this work for anon consts than requiring the attribute to be on the enclosing item and then walking the inside of it to look for any anon consts. This particular method will honestly break at some point when we stop having a `DefId` available for anon consts in hir but that's for another day... r? ``@compiler-errors``
2024-06-30add `rustc_dump_def_parents` attributeBoxy-1/+50
2024-06-30Make `feature(effects)` require `-Znext-solver`Deadbeef-0/+12
2024-06-30Auto merge of #127133 - matthiaskrgr:rollup-jxkp3yf, r=matthiaskrgrbors-1/+18
Rollup of 9 pull requests Successful merges: - #123237 (Various rustc_codegen_ssa cleanups) - #126960 (Improve error message in tidy) - #127002 (Implement `x perf` as a separate tool) - #127081 (Add a run-make test that LLD is not being used by default on the x64 beta/stable channel) - #127106 (Improve unsafe extern blocks diagnostics) - #127110 (Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.) - #127114 (fix: prefer `(*p).clone` to `p.clone` if the `p` is a raw pointer) - #127118 (Show `used attribute`'s kind for user when find it isn't applied to a `static` variable.) - #127122 (Remove uneccessary condition in `div_ceil`) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-29Rollup merge of #127110 - surechen:fix_125488_06, r=compiler-errorsMatthias Krüger-1/+18
Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. Recommit after refactoring based on comment: https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361 But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message. ```rust fn test11(x: &usize) -> &_ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear) } ``` fixes #125488 r? ``@pnkfelix``
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-67/+224
Implement new effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide Fixes #119717 Fixes #123664 Fixes #124857 Fixes #126148
2024-06-29Fix a error suggestion for E0121 when using placeholder _ as return types on ↵surechen-1/+18
function signature. Recommit after refactoring based on comment: https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361 But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message. ```rust fn test11(x: &usize) -> &_ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear) } ```
2024-06-28address review commentsDeadbeef-24/+30
2024-06-28general fixups and turn `TODO`s into `FIXME`sDeadbeef-9/+14
2024-06-28Implement `Self::Effects: Compat<HOST>` desugaringDeadbeef-3/+20
2024-06-28bless tests part 1Deadbeef-0/+4
2024-06-28temporarily disable effects on specialization testsDeadbeef-0/+1
2024-06-28move desugaring to item boundsDeadbeef-31/+26
2024-06-28Implement `Min` trait in new solverDeadbeef-1/+1
2024-06-28implement new effects desugaringDeadbeef-67/+196
2024-06-27Make queries more explicitMichael Goulet-14/+14