diff options
| author | Lukas Markeffsky <@> | 2025-02-21 18:34:14 +0100 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2025-02-21 20:32:37 +0100 |
| commit | 7fea935ec5e2e5ab7f0c86e3b4f89c0da8d646c6 (patch) | |
| tree | b9cb0c4867dcff0a6ed0a3696d9175486ba1b5dd /compiler/rustc_traits/src/codegen.rs | |
| parent | a825e37fe4dba0e8b33ed05611ba130d396a5509 (diff) | |
| download | rust-7fea935ec5e2e5ab7f0c86e3b4f89c0da8d646c6.tar.gz rust-7fea935ec5e2e5ab7f0c86e3b4f89c0da8d646c6.zip | |
don't leave assoc const unnormalized due to unconstrained params
Diffstat (limited to 'compiler/rustc_traits/src/codegen.rs')
| -rw-r--r-- | compiler/rustc_traits/src/codegen.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_traits/src/codegen.rs b/compiler/rustc_traits/src/codegen.rs index e5276e6d515..cc329ca3328 100644 --- a/compiler/rustc_traits/src/codegen.rs +++ b/compiler/rustc_traits/src/codegen.rs @@ -80,16 +80,14 @@ pub(crate) fn codegen_select_candidate<'tcx>( // but never resolved, causing the return value of a query to contain inference // vars. We do not have a concept for this and will in fact ICE in stable hashing // of the return value. So bail out instead. - match impl_source { - ImplSource::UserDefined(impl_) => { - tcx.dcx().span_delayed_bug( - tcx.def_span(impl_.impl_def_id), - "this impl has unconstrained generic parameters", - ); - } + let guar = match impl_source { + ImplSource::UserDefined(impl_) => tcx.dcx().span_delayed_bug( + tcx.def_span(impl_.impl_def_id), + "this impl has unconstrained generic parameters", + ), _ => unreachable!(), - } - return Err(CodegenObligationError::FulfillmentError); + }; + return Err(CodegenObligationError::UnconstrainedParam(guar)); } Ok(&*tcx.arena.alloc(impl_source)) |
