diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2023-04-04 05:52:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-04 05:52:35 +0900 |
| commit | 7d3207be9776d6707f77a2ce7da170ffdd4f1b0d (patch) | |
| tree | 0288e53b7f1159c06a17c8a0e8e8ccd4574a531a /compiler/rustc_trait_selection/src/traits/select/mod.rs | |
| parent | 4e25d20f957600aeae70d43f0d5fba54d9685d30 (diff) | |
| parent | ca79b82c6cff632c98ed355e7d0f554ef8b5cc5d (diff) | |
| download | rust-7d3207be9776d6707f77a2ce7da170ffdd4f1b0d.tar.gz rust-7d3207be9776d6707f77a2ce7da170ffdd4f1b0d.zip | |
Rollup merge of #109896 - Nilstrieb:integers-are-not-fn-ptrs-remember-this-dear-transmuter, r=compiler-errors
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. I'm not sure whether there could be more issues hidden in the shadows as mentioned in the issue, but this should at least fix the problematic regression immediately. fixes #109892 r? oli-obk
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/select/mod.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 3ed3dd2d20d..b58e62536d6 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -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, } |
