File tree Expand file tree Collapse file tree
compiler/rustc_next_trait_solver/src/solve Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -663,6 +663,10 @@ where
663663 return Err ( NoSolution ) ;
664664 }
665665
666+ if goal. predicate . has_non_region_infer ( ) {
667+ return ecx. forced_ambiguity ( MaybeCause :: Ambiguity ) ;
668+ }
669+
666670 ecx. probe_builtin_trait_candidate ( BuiltinImplSource :: Misc ) . enter ( |ecx| {
667671 let assume = ecx. structurally_normalize_const (
668672 goal. param_env ,
Original file line number Diff line number Diff line change 1+ #![ feature( transmutability) ]
2+ trait OpaqueTrait { }
3+
4+ impl < T : std:: mem:: TransmuteFrom < ( ) , ( ) > > OpaqueTrait for T { }
5+ //~^ ERROR: type provided when a constant was expected
6+
7+ impl < T > OpaqueTrait for & T where T : OpaqueTrait { }
8+ //~^ ERROR: conflicting implementations of trait `OpaqueTrait` for type `&_`
9+
10+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0747]: type provided when a constant was expected
2+ --> $DIR/transmutability-coherence.rs:4:37
3+ |
4+ LL | impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
5+ | ^^
6+
7+ error[E0119]: conflicting implementations of trait `OpaqueTrait` for type `&_`
8+ --> $DIR/transmutability-coherence.rs:7:1
9+ |
10+ LL | impl<T: std::mem::TransmuteFrom<(), ()>> OpaqueTrait for T {}
11+ | ---------------------------------------------------------- first implementation here
12+ ...
13+ LL | impl<T> OpaqueTrait for &T where T: OpaqueTrait {}
14+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
15+
16+ error: aborting due to 2 previous errors
17+
18+ Some errors have detailed explanations: E0119, E0747.
19+ For more information about an error, try `rustc --explain E0119`.
You can’t perform that action at this time.
0 commit comments