mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
fix new usage of type_of
This commit is contained in:
parent
8e92849cbb
commit
f6c3469aa2
@ -414,7 +414,7 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
|
||||
// Check that sym actually points to a function. Later passes
|
||||
// depend on this.
|
||||
hir::InlineAsmOperand::SymFn { anon_const } => {
|
||||
let ty = self.tcx.type_of(anon_const.def_id);
|
||||
let ty = self.tcx.type_of(anon_const.def_id).subst_identity();
|
||||
match ty.kind() {
|
||||
ty::Never | ty::Error(_) => {}
|
||||
ty::FnDef(..) => {}
|
||||
|
@ -1710,7 +1710,7 @@ fn resolution_failure(
|
||||
Res::Primitive(_) => None,
|
||||
};
|
||||
let is_struct_variant = |did| {
|
||||
if let ty::Adt(def, _) = tcx.type_of(did).kind()
|
||||
if let ty::Adt(def, _) = tcx.type_of(did).subst_identity().kind()
|
||||
&& def.is_enum()
|
||||
&& let Some(variant) = def.variants().iter().find(|v| v.name == res.name(tcx)) {
|
||||
// ctor is `None` if variant is a struct
|
||||
|
Loading…
Reference in New Issue
Block a user