diff options
| author | Michael Goulet <michael@errs.io> | 2024-07-24 17:19:41 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-07-24 17:19:44 -0400 |
| commit | 0919d0714ec49773d3a4c3a589b7651655b1b7c0 (patch) | |
| tree | 1b6c2f9c13841364ec398ae4ce0d5b9388be83e5 /compiler/rustc_trait_selection/src | |
| parent | 2ccafed862f6906707a390caf180449dd64cad2e (diff) | |
| download | rust-0919d0714ec49773d3a4c3a589b7651655b1b7c0.tar.gz rust-0919d0714ec49773d3a4c3a589b7651655b1b7c0.zip | |
Don't ICE when auto trait has assoc ty in old solver
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:?}") } |
