Skip to content

Commit

Permalink
Use correct ImplSource for alias bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed May 6, 2024
1 parent 207b4b8 commit e347239
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ fn to_selection<'tcx>(
})
}
CandidateSource::BuiltinImpl(builtin) => ImplSource::Builtin(builtin, nested),
CandidateSource::ParamEnv(_) => ImplSource::Param(nested),
CandidateSource::AliasBound => ImplSource::Builtin(BuiltinImplSource::Misc, nested),
CandidateSource::ParamEnv(_) | CandidateSource::AliasBound => ImplSource::Param(nested),
CandidateSource::CoherenceUnknowable => {
span_bug!(span, "didn't expect to select an unknowable candidate")
}
Expand Down
13 changes: 13 additions & 0 deletions tests/ui/traits/next-solver/select-alias-bound-as-param.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit e347239

Please sign in to comment.