File tree 2 files changed +18
-2
lines changed
rustc_trait_selection/src/solve
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1883,9 +1883,9 @@ impl<'tcx> Ty<'tcx> {
1883
1883
// Needs normalization or revealing to determine, so no is the safe answer.
1884
1884
ty:: Alias ( ..) => false ,
1885
1885
1886
- ty:: Param ( ..) | ty:: Infer ( ..) | ty:: Error ( ..) => false ,
1886
+ ty:: Param ( ..) | ty:: Placeholder ( .. ) | ty :: Infer ( ..) | ty:: Error ( ..) => false ,
1887
1887
1888
- ty:: Bound ( ..) | ty :: Placeholder ( .. ) => {
1888
+ ty:: Bound ( ..) => {
1889
1889
bug ! ( "`is_trivially_pure_clone_copy` applied to unexpected type: {:?}" , self ) ;
1890
1890
}
1891
1891
}
Original file line number Diff line number Diff line change 1
1
use std:: ops:: Deref ;
2
2
3
3
use rustc_data_structures:: fx:: FxHashSet ;
4
+ use rustc_hir:: LangItem ;
4
5
use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId } ;
5
6
use rustc_infer:: infer:: canonical:: query_response:: make_query_region_constraints;
6
7
use rustc_infer:: infer:: canonical:: {
@@ -82,6 +83,21 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
82
83
83
84
Some ( ( ) )
84
85
}
86
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( trait_pred) ) => {
87
+ match self . 0 . tcx . as_lang_item ( trait_pred. def_id ( ) ) {
88
+ Some ( LangItem :: Sized )
89
+ if trait_pred. self_ty ( ) . is_trivially_sized ( self . 0 . tcx ) =>
90
+ {
91
+ Some ( ( ) )
92
+ }
93
+ Some ( LangItem :: Copy | LangItem :: Clone )
94
+ if trait_pred. self_ty ( ) . is_trivially_pure_clone_copy ( ) =>
95
+ {
96
+ Some ( ( ) )
97
+ }
98
+ _ => None ,
99
+ }
100
+ }
85
101
_ => None ,
86
102
}
87
103
}
You can’t perform that action at this time.
0 commit comments