mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 22:13:27 +00:00
Don't subst an adt def
This commit is contained in:
parent
f9b2e3c87b
commit
cb1c0c6516
@ -41,7 +41,7 @@ use rustc_index::vec::Idx;
|
||||
use rustc_middle::lint::LintDiagnosticBuilder;
|
||||
use rustc_middle::ty::layout::{LayoutError, LayoutOf};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::subst::{GenericArgKind, Subst};
|
||||
use rustc_middle::ty::subst::GenericArgKind;
|
||||
use rustc_middle::ty::Instance;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_session::lint::{BuiltinLintDiagnostics, FutureIncompatibilityReason};
|
||||
@ -2776,7 +2776,7 @@ impl ClashingExternDeclarations {
|
||||
let mut ty = ty;
|
||||
loop {
|
||||
if let ty::Adt(def, substs) = *ty.kind() {
|
||||
let is_transparent = def.subst(tcx, substs).repr().transparent();
|
||||
let is_transparent = def.repr().transparent();
|
||||
let is_non_null = crate::types::nonnull_optimization_guaranteed(tcx, def);
|
||||
debug!(
|
||||
"non_transparent_ty({:?}) -- type is transparent? {}, type is non-null? {}",
|
||||
@ -2836,11 +2836,7 @@ impl ClashingExternDeclarations {
|
||||
|
||||
ensure_sufficient_stack(|| {
|
||||
match (a_kind, b_kind) {
|
||||
(Adt(a_def, a_substs), Adt(b_def, b_substs)) => {
|
||||
let a = a.subst(cx.tcx, a_substs);
|
||||
let b = b.subst(cx.tcx, b_substs);
|
||||
debug!("Comparing {:?} and {:?}", a, b);
|
||||
|
||||
(Adt(a_def, _), Adt(b_def, _)) => {
|
||||
// We can immediately rule out these types as structurally same if
|
||||
// their layouts differ.
|
||||
match compare_layouts(a, b) {
|
||||
|
Loading…
Reference in New Issue
Block a user