diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-25 04:43:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-25 04:43:20 +0200 |
| commit | 1fda084290b52e7eb8b70d4e03ad5735120699c9 (patch) | |
| tree | 97c8fba9ccd711650934cf525394f4a7a21147d1 /compiler/rustc_trait_selection/src | |
| parent | 40557c80491174f97808fca6866951984ad0c24d (diff) | |
| parent | 0919d0714ec49773d3a4c3a589b7651655b1b7c0 (diff) | |
| download | rust-1fda084290b52e7eb8b70d4e03ad5735120699c9.tar.gz rust-1fda084290b52e7eb8b70d4e03ad5735120699c9.zip | |
Rollup merge of #128160 - compiler-errors:auto, r=jackh726
Don't ICE when auto trait has assoc ty in old solver Kinda a pointless change to make, but it's observable w/o the feature gate, so let's just fix it. I reintroduced this ICE when I removed the "auto impl" kind from `ImplSource` in #112687. Fixes #117829 Fixes #127746
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 1d7a0515044..b96e0c8a977 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -1202,6 +1202,12 @@ fn assemble_candidates_from_impls<'cx, 'tcx>( false } } + } else if tcx.trait_is_auto(trait_ref.def_id) { + tcx.dcx().span_delayed_bug( + tcx.def_span(obligation.predicate.def_id), + "associated types not allowed on auto traits", + ); + false } else { bug!("unexpected builtin trait with associated type: {trait_ref:?}") } |
