about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs2
-rw-r--r--tests/ui/transmutability/issue-110467.rs17
2 files changed, 18 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
index 1f5bbc178f7..a019d00461b 100644
--- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
@@ -775,7 +775,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         obligation: &TraitObligation<'tcx>,
         candidates: &mut SelectionCandidateSet<'tcx>,
     ) {
-        if obligation.has_non_region_param() {
+        if obligation.predicate.has_non_region_param() {
             return;
         }
 
diff --git a/tests/ui/transmutability/issue-110467.rs b/tests/ui/transmutability/issue-110467.rs
new file mode 100644
index 00000000000..358733b9832
--- /dev/null
+++ b/tests/ui/transmutability/issue-110467.rs
@@ -0,0 +1,17 @@
+// check-pass
+#![crate_type = "lib"]
+#![feature(transmutability)]
+use std::mem::BikeshedIntrinsicFrom;
+pub struct Context;
+
+pub fn is_maybe_transmutable<Src, Dst>()
+where
+    Dst: BikeshedIntrinsicFrom<Src, Context>,
+{
+}
+
+// The `T` here should not have any effect on checking
+// if transmutability is allowed or not.
+fn function_with_generic<T>() {
+    is_maybe_transmutable::<(), ()>();
+}