about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-06-02 19:21:56 +0000
committerMichael Goulet <michael@errs.io>2023-06-02 19:22:25 +0000
commitecd7809784ddb1e96c9f292347d73d074106e4e9 (patch)
tree47a0333a790990d451627d38e9c5f226cd6800b6 /compiler
parenta9baa16482ba4100df529ccba39c787f27ad0475 (diff)
downloadrust-ecd7809784ddb1e96c9f292347d73d074106e4e9.tar.gz
rust-ecd7809784ddb1e96c9f292347d73d074106e4e9.zip
Don't ICE in new solver when auto traits have associated types
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_trait_selection/src/solve/project_goals.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/project_goals.rs b/compiler/rustc_trait_selection/src/solve/project_goals.rs
index 7d7dfa2c837..becd84e79e1 100644
--- a/compiler/rustc_trait_selection/src/solve/project_goals.rs
+++ b/compiler/rustc_trait_selection/src/solve/project_goals.rs
@@ -193,10 +193,14 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
     }
 
     fn consider_auto_trait_candidate(
-        _ecx: &mut EvalCtxt<'_, 'tcx>,
+        ecx: &mut EvalCtxt<'_, 'tcx>,
         goal: Goal<'tcx, Self>,
     ) -> QueryResult<'tcx> {
-        bug!("auto traits do not have associated types: {:?}", goal);
+        ecx.tcx().sess.delay_span_bug(
+            ecx.tcx().def_span(goal.predicate.def_id()),
+            "associated types not allowed on auto traits",
+        );
+        Err(NoSolution)
     }
 
     fn consider_trait_alias_candidate(