@@ -51,15 +51,13 @@ use rustc_infer::traits::{
51
51
PredicateObligations ,
52
52
} ;
53
53
use rustc_middle:: span_bug;
54
- use rustc_middle:: traits:: BuiltinImplSource ;
55
54
use rustc_middle:: ty:: adjustment:: {
56
55
Adjust , Adjustment , AllowTwoPhase , AutoBorrow , AutoBorrowMutability , PointerCoercion ,
57
56
} ;
58
57
use rustc_middle:: ty:: error:: TypeError ;
59
58
use rustc_middle:: ty:: visit:: TypeVisitableExt ;
60
59
use rustc_middle:: ty:: { self , GenericArgsRef , Ty , TyCtxt } ;
61
- use rustc_session:: parse:: feature_err;
62
- use rustc_span:: { BytePos , DUMMY_SP , DesugaringKind , Span , sym} ;
60
+ use rustc_span:: { BytePos , DUMMY_SP , DesugaringKind , Span } ;
63
61
use rustc_trait_selection:: infer:: InferCtxtExt as _;
64
62
use rustc_trait_selection:: traits:: query:: evaluate_obligation:: InferCtxtExt ;
65
63
use rustc_trait_selection:: traits:: {
@@ -610,8 +608,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
610
608
ty:: TraitRef :: new( self . tcx, coerce_unsized_did, [ coerce_source, coerce_target] )
611
609
) ] ;
612
610
613
- let mut has_unsized_tuple_coercion = false ;
614
-
615
611
// Keep resolving `CoerceUnsized` and `Unsize` predicates to avoid
616
612
// emitting a coercion in cases like `Foo<$1>` -> `Foo<$2>`, where
617
613
// inference might unify those two inner type variables later.
@@ -690,31 +686,10 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
690
686
// be silent, as it causes a type mismatch later.
691
687
}
692
688
693
- Ok ( Some ( impl_source) ) => {
694
- // Some builtin coercions are still unstable so we detect
695
- // these here and emit a feature error if coercion doesn't fail
696
- // due to another reason.
697
- match impl_source {
698
- traits:: ImplSource :: Builtin ( BuiltinImplSource :: TupleUnsizing , _) => {
699
- has_unsized_tuple_coercion = true ;
700
- }
701
- _ => { }
702
- }
703
- queue. extend ( impl_source. nested_obligations ( ) )
704
- }
689
+ Ok ( Some ( impl_source) ) => queue. extend ( impl_source. nested_obligations ( ) ) ,
705
690
}
706
691
}
707
692
708
- if has_unsized_tuple_coercion && !self . tcx . features ( ) . unsized_tuple_coercion ( ) {
709
- feature_err (
710
- & self . tcx . sess ,
711
- sym:: unsized_tuple_coercion,
712
- self . cause . span ,
713
- "unsized tuple coercion is not stable enough for use and is subject to change" ,
714
- )
715
- . emit ( ) ;
716
- }
717
-
718
693
Ok ( coercion)
719
694
}
720
695
0 commit comments