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 @@ -1882,9 +1882,9 @@ impl<'tcx> Ty<'tcx> {
1882
1882
// Needs normalization or revealing to determine, so no is the safe answer.
1883
1883
ty:: Alias ( ..) => false ,
1884
1884
1885
- ty:: Param ( ..) | ty:: Infer ( ..) | ty:: Error ( ..) => false ,
1885
+ ty:: Param ( ..) | ty:: Placeholder ( .. ) | ty :: Infer ( ..) | ty:: Error ( ..) => false ,
1886
1886
1887
- ty:: Bound ( ..) | ty :: Placeholder ( .. ) => {
1887
+ ty:: Bound ( ..) => {
1888
1888
bug ! ( "`is_trivially_pure_clone_copy` applied to unexpected type: {:?}" , self ) ;
1889
1889
}
1890
1890
}
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:: {
@@ -83,6 +84,21 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
83
84
84
85
Some ( HasChanged :: No )
85
86
}
87
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( trait_pred) ) => {
88
+ match self . 0 . tcx . as_lang_item ( trait_pred. def_id ( ) ) {
89
+ Some ( LangItem :: Sized )
90
+ if trait_pred. self_ty ( ) . is_trivially_sized ( self . 0 . tcx ) =>
91
+ {
92
+ Some ( HasChanged :: No )
93
+ }
94
+ Some ( LangItem :: Copy | LangItem :: Clone )
95
+ if trait_pred. self_ty ( ) . is_trivially_pure_clone_copy ( ) =>
96
+ {
97
+ Some ( HasChanged :: No )
98
+ }
99
+ _ => None ,
100
+ }
101
+ }
86
102
_ => None ,
87
103
}
88
104
}
You can’t perform that action at this time.
0 commit comments