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 @@ -1883,9 +1883,9 @@ impl<'tcx> Ty<'tcx> {
18831883 // Needs normalization or revealing to determine, so no is the safe answer.
18841884 ty:: Alias ( ..) => false ,
18851885
1886- ty:: Param ( ..) | ty:: Infer ( ..) | ty:: Error ( ..) => false ,
1886+ ty:: Param ( ..) | ty:: Placeholder ( .. ) | ty :: Infer ( ..) | ty:: Error ( ..) => false ,
18871887
1888- ty:: Bound ( ..) | ty :: Placeholder ( .. ) => {
1888+ ty:: Bound ( ..) => {
18891889 bug ! ( "`is_trivially_pure_clone_copy` applied to unexpected type: {:?}" , self ) ;
18901890 }
18911891 }
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:: {
@@ -82,6 +83,21 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
8283
8384 Some ( ( ) )
8485 }
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+ }
85101 _ => None ,
86102 }
87103 }
You can’t perform that action at this time.
0 commit comments