about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/coherence
AgeCommit message (Collapse)AuthorLines
2025-10-01added error for closures case in implKivooeo-9/+10
2025-09-15Remove UnsizedConstParamTy trait and make it into an unstable impltiif-12/+3
2025-09-09erase_regions to erase_and_anonymize_regionsBoxy-1/+1
2025-08-11Propagate TraitImplHeader to hirCameron Steffen-4/+6
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-1/+2
2025-07-18Rollup merge of #143699 - compiler-errors:async-drop-fund, r=oli-obkMatthias Krüger-1/+5
Make `AsyncDrop` check that it's being implemented on a local ADT Fixes https://github.com/rust-lang/rust/issues/143691
2025-07-09Make AsyncDrop check that it's being implemented on a local ADTMichael Goulet-1/+5
2025-07-09Port `#[rustc_allow_incoherent_impl]` to the new attribute systemPavel Grigorenko-2/+9
2025-07-04Fix elided lifetimes in rustdocMichael Goulet-1/+1
2025-07-04Rollup merge of #143308 - compiler-errors:no-pointer-like, r=oli-obkMatthias Krüger-99/+0
Remove `PointerLike` trait r? oli-obk
2025-07-03compiler: document all provide fn in hir_analysis and hir_typeckJubilee Young-0/+1
2025-07-03Remove PointerLike traitMichael Goulet-99/+0
2025-06-25Remove some glob imports from the type systemMichael Goulet-2/+2
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-5/+5
2025-05-13Some require_lang_item -> is_lang_item replacementsOli Scherer-4/+2
2025-04-24Remove `weak` alias terminologyBoxy-3/+3
2025-04-22Use `is_lang_item` and `as_lang_item` instead of handrolling their logicOli Scherer-1/+1
2025-04-15Move `name` field from `AssocItem` to `AssocKind` variants.Nicholas Nethercote-4/+4
To accurately reflect that RPITIT assoc items don't have a name. This avoids the use of `kw::Empty` to mean "no name", which is error prone. Helps with #137978.
2025-04-15Move two methods from `AssocKind` to `AssocItem`.Nicholas Nethercote-1/+1
Because all the other similar methods are on `AssocItem`.
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-01Decouple trait impls of different traits wrt incrementalOli Scherer-1/+4
2025-03-20Do not rely on type_var_origin in OrphanCheckErr::NonLocalInputTypeMichael Goulet-47/+16
2025-03-15Stop relying on rustc_type_ir in non-type-system cratesMichael Goulet-6/+8
2025-03-12Move methods from `Map` to `TyCtxt`, part 4.Nicholas Nethercote-11/+11
Continuing the work from #137350. Removes the unused methods: `expect_variant`, `expect_field`, `expect_foreign_item`. Every method gains a `hir_` prefix.
2025-03-04Ensure that negative auto impls are always applicableMichael Goulet-9/+17
2025-02-24Rollup merge of #137289 - compiler-errors:coerce-unsized-errors, r=oli-obkMichael Goulet-77/+93
Consolidate and improve error messaging for `CoerceUnsized` and `DispatchFromDyn` Firstly, this PR consolidates and reworks the error diagnostics for `CoercePointee` and `DispatchFromDyn`. There was a ton of duplication for no reason -- this reworks both the errors and also the error codes, since they can be shared between both traits since they report the same thing. Secondly, when encountering a struct with multiple fields that must be coerced, point out the field spans, rather than mentioning the fields by name. This makes the error message clearer, but also means that we don't mention the `__S` dummy parameter for `derive(CoercePointee)`. Thirdly, emit a custom error message when we encounter a trait error that comes from the recursive field `CoerceUnsized`/`DispatchFromDyn` trait check. **Note:** This is the only one I'm not too satisfied with -- I think it could use some more refinement, but ideally it explains that the field must be an unsize-able pointer... Feedback welcome. Finally, don't emit `DispatchFromDyn` validity errors if we detect `CoerceUnsized` validity errors from an impl of the same ADT. This is best reviewed per commit. r? `@oli-obk` perhaps? cc `@dingxiangfei2009` -- sorry for making my own attempt at this PR, but I wanted to see if I could implement a fix for #136796 in a less complicated way, since communicating over github review comments can be a bit slow. I'll leave comments inline to explain my thinking about the diagnostics changes.
2025-02-24Deduplicate CoerceUnsized and DispatchFromDyn impl errorsMichael Goulet-3/+13
2025-02-24Simplify trait error message for CoercePointee validationMichael Goulet-47/+69
2025-02-24Consolidate and rework CoercePointee and DispatchFromDyn errorsMichael Goulet-40/+27
2025-02-24More eagerly bail in DispatchFromDyn validationMichael Goulet-25/+22
2025-02-24Remove dyn_compatible_for_dispatchMichael Goulet-5/+1
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-1/+1
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-02-17Move some `Map` methods onto `TyCtxt`.Nicholas Nethercote-3/+3
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exceptions are `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`, and `items` which became `hir_free_items` for consistency with `hir_module_free_items`.
2025-02-11Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, ↵Matthias Krüger-0/+33
r=compiler-errors Introduce CoercePointeeWellformed for coherence checks at typeck stage Fix #135206 This is the first PR to introduce the "wellformedness" check for `derive(CoercePointee)`. This patch introduces a new error code to cover all the prerequisites of the said macro. The checks that is enforced with this patch is whether the data is indeed `struct` and whether the layout is set to `repr(transparent)`. A following series of patch will arrive later to address the following concern. 1. #135217 so that we would only admit one single coercion on one type parameter, and leave the rest for future consideration in tandem of development of other coercion rules. 1. Enforcement of data field requirements. **An open question** is whether there is a good schema to encode the `#[pointee]` as well, so that we could also check if the `#[pointee]` type parameter is indeed `?Sized`. ``@rustbot`` label F-derive_coerce_pointee
2025-02-09move repr(transparent) checks to coherenceDing Xiang Fei-0/+3
2025-02-09rename the trait to validity and place a feature gate afrontDing Xiang Fei-8/+10
2025-02-09introduce CoercePointeeWellformed for coherence checks at typeck stageDing Xiang Fei-0/+28
2025-02-08Rustfmtbjorn3-8/+12
2025-02-01Rename `tcx.ensure()` to `tcx.ensure_ok()`Zalathar-3/+3
2025-01-31Auto merge of #136350 - matthiaskrgr:rollup-6eqfyvh, r=matthiaskrgrbors-2/+1
Rollup of 9 pull requests Successful merges: - #134531 ([rustdoc] Add `--extract-doctests` command-line flag) - #135860 (Compiler: Finalize dyn compatibility renaming) - #135992 (Improve documentation when adding a new target) - #136194 (Support clobber_abi in BPF inline assembly) - #136325 (Delay a bug when indexing unsized slices) - #136326 (Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef`) - #136330 (Remove unnecessary hooks) - #136336 (Overhaul `rustc_middle::util`) - #136341 (Remove myself from vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Rollup merge of #135860 - fmease:compiler-mv-obj-save-dyn-compat-ii, r=jieyouxuMatthias Krüger-2/+1
Compiler: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #130826. Part of #130852. ~~Blocking it on #133372.~~ (merged) r? ghost
2025-01-31Use `.and` chaining to improve readability.Nicholas Nethercote-6/+6
2025-01-31Merge two `match` arms that are identical.Nicholas Nethercote-11/+6
Also rewrite the merged arm slightly to more closely match the arm above it.
2025-01-28Consolidate OutlivesEnv construction with resolve_regionsMichael Goulet-5/+2
2025-01-27Use identifiers in diagnostics more oftenMichael Goulet-4/+4
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-2/+1
2025-01-22Rollup merge of #135816 - BoxyUwU:root_normalizes_to_goal_ice, r=lcnrMatthias Krüger-1/+1
Use `structurally_normalize` instead of manual `normalizes-to` goals in alias relate errors r? `@lcnr` I added `structurally_normalize_term` so that code that is generic over ty or const can use the structurally normalize helpers. See `tests/ui/traits/next-solver/diagnostics/alias_relate_error_uses_structurally_normalize.rs` for a description of the reason for the (now fixed) ICEs
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-1/+1
This CL makes a number of small changes to dyn compatibility errors: - "object safety" has been renamed to "dyn-compatibility" throughout - "Convert to enum" suggestions are no longer generated when there exists a type-generic impl of the trait or an impl for `dyn OtherTrait` - Several error messages are reorganized for user readability Additionally, the dyn compatibility error creation code has been split out into functions. cc #132713 cc #133267
2025-01-22Rename `structurally_normalize` to `structurally_normalize_ty`Boxy-1/+1
2025-01-21Move supertrait_def_ids into the elaborate module like all other fnsMichael Goulet-1/+2