This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
rustc_trait_selection/src/solve Expand file tree Collapse file tree 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> {
18821882 // Needs normalization or revealing to determine, so no is the safe answer.
18831883 ty:: Alias ( ..) => false ,
18841884
1885- ty:: Param ( ..) | ty:: Infer ( ..) | ty:: Error ( ..) => false ,
1885+ ty:: Param ( ..) | ty:: Placeholder ( .. ) | ty :: Infer ( ..) | ty:: Error ( ..) => false ,
18861886
1887- ty:: Bound ( ..) | ty :: Placeholder ( .. ) => {
1887+ ty:: Bound ( ..) => {
18881888 bug ! ( "`is_trivially_pure_clone_copy` applied to unexpected type: {:?}" , self ) ;
18891889 }
18901890 }
Original file line number Diff line number Diff line change 11use std:: ops:: Deref ;
22
33use rustc_data_structures:: fx:: FxHashSet ;
4+ use rustc_hir:: LangItem ;
45use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId } ;
56use rustc_infer:: infer:: canonical:: query_response:: make_query_region_constraints;
67use rustc_infer:: infer:: canonical:: {
@@ -83,6 +84,21 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
8384
8485 Some ( HasChanged :: No )
8586 }
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+ }
86102 _ => None ,
87103 }
88104 }
You can’t perform that action at this time.
0 commit comments