@@ -41,7 +41,7 @@ use rustc_index::vec::Idx;
4141use rustc_middle:: lint:: { in_external_macro, LintDiagnosticBuilder } ;
4242use rustc_middle:: ty:: layout:: { LayoutError , LayoutOf } ;
4343use rustc_middle:: ty:: print:: with_no_trimmed_paths;
44- use rustc_middle:: ty:: subst:: { GenericArgKind , Subst } ;
44+ use rustc_middle:: ty:: subst:: GenericArgKind ;
4545use rustc_middle:: ty:: Instance ;
4646use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
4747use rustc_session:: lint:: { BuiltinLintDiagnostics , FutureIncompatibilityReason } ;
@@ -2777,7 +2777,7 @@ impl ClashingExternDeclarations {
27772777 let mut ty = ty;
27782778 loop {
27792779 if let ty:: Adt ( def, substs) = * ty. kind ( ) {
2780- let is_transparent = def. subst ( tcx , substs ) . repr ( ) . transparent ( ) ;
2780+ let is_transparent = def. repr ( ) . transparent ( ) ;
27812781 let is_non_null = crate :: types:: nonnull_optimization_guaranteed ( tcx, def) ;
27822782 debug ! (
27832783 "non_transparent_ty({:?}) -- type is transparent? {}, type is non-null? {}" ,
@@ -2837,11 +2837,7 @@ impl ClashingExternDeclarations {
28372837
28382838 ensure_sufficient_stack ( || {
28392839 match ( a_kind, b_kind) {
2840- ( Adt ( a_def, a_substs) , Adt ( b_def, b_substs) ) => {
2841- let a = a. subst ( cx. tcx , a_substs) ;
2842- let b = b. subst ( cx. tcx , b_substs) ;
2843- debug ! ( "Comparing {:?} and {:?}" , a, b) ;
2844-
2840+ ( Adt ( a_def, _) , Adt ( b_def, _) ) => {
28452841 // We can immediately rule out these types as structurally same if
28462842 // their layouts differ.
28472843 match compare_layouts ( a, b) {
0 commit comments