Use correct ImplSource for alias bounds

This commit is contained in:
Michael Goulet 2024-05-06 14:11:21 -04:00
parent 207b4b8e88
commit e34723997a
2 changed files with 14 additions and 2 deletions

View File

@ -157,8 +157,7 @@ fn to_selection<'tcx>(
}) })
} }
CandidateSource::BuiltinImpl(builtin) => ImplSource::Builtin(builtin, nested), CandidateSource::BuiltinImpl(builtin) => ImplSource::Builtin(builtin, nested),
CandidateSource::ParamEnv(_) => ImplSource::Param(nested), CandidateSource::ParamEnv(_) | CandidateSource::AliasBound => ImplSource::Param(nested),
CandidateSource::AliasBound => ImplSource::Builtin(BuiltinImplSource::Misc, nested),
CandidateSource::CoherenceUnknowable => { CandidateSource::CoherenceUnknowable => {
span_bug!(span, "didn't expect to select an unknowable candidate") span_bug!(span, "didn't expect to select an unknowable candidate")
} }

View File

@ -0,0 +1,13 @@
//@ check-pass
//@ compile-flags: -Znext-solver
pub(crate) fn y() -> impl FnMut() {
|| {}
}
pub(crate) fn x(a: (), b: ()) {
let x = ();
y()()
}
fn main() {}