Never consider int and float vars for FnPtr candidates
This solves a regression where `0.0.cmp()` was ambiguous when a custom trait with a `cmp` method was in scope. FOr integers it shouldn't be a problem in practice so I wasn't able to add a test.
This commit is contained in:
@@ -177,14 +177,14 @@ struct TraitObligationStack<'prev, 'tcx> {
|
||||
}
|
||||
|
||||
struct SelectionCandidateSet<'tcx> {
|
||||
// A list of candidates that definitely apply to the current
|
||||
// obligation (meaning: types unify).
|
||||
/// A list of candidates that definitely apply to the current
|
||||
/// obligation (meaning: types unify).
|
||||
vec: Vec<SelectionCandidate<'tcx>>,
|
||||
|
||||
// If `true`, then there were candidates that might or might
|
||||
// not have applied, but we couldn't tell. This occurs when some
|
||||
// of the input types are type variables, in which case there are
|
||||
// various "builtin" rules that might or might not trigger.
|
||||
/// If `true`, then there were candidates that might or might
|
||||
/// not have applied, but we couldn't tell. This occurs when some
|
||||
/// of the input types are type variables, in which case there are
|
||||
/// various "builtin" rules that might or might not trigger.
|
||||
ambiguous: bool,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user