File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
compiler/rustc_trait_selection/src/traits
tests/ui/traits/const-traits/effects Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ pub fn evaluate_host_effect_obligation<'tcx>(
2727 ) ;
2828 }
2929
30+ // Force ambiguity for infer self ty.
31+ if obligation. predicate . self_ty ( ) . is_ty_var ( ) {
32+ return Err ( EvaluationFailure :: Ambiguous ) ;
33+ }
34+
3035 match evaluate_host_effect_from_bounds ( selcx, obligation) {
3136 Ok ( result) => return Ok ( result) ,
3237 Err ( EvaluationFailure :: Ambiguous ) => return Err ( EvaluationFailure :: Ambiguous ) ,
Original file line number Diff line number Diff line change 1+ //@ check-pass
2+
3+ #![ feature( const_trait_impl) ]
4+
5+ #[ const_trait]
6+ trait Foo { }
7+
8+ impl < T > const Foo for ( T , ) where T : ~const Foo { }
9+
10+ const fn needs_const_foo ( _: impl ~const Foo + Copy ) { }
11+
12+ const fn test < T : ~const Foo + Copy > ( t : T ) {
13+ needs_const_foo ( ( t, ) ) ;
14+ }
15+
16+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments