mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Teach typeck about auto trait
This commit is contained in:
parent
1f4b630899
commit
00be060daf
@ -1742,8 +1742,8 @@ impl<'a> LoweringContext<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn lower_is_auto(&mut self, u: IsAuto) -> hir::IsAuto {
|
||||
match u {
|
||||
fn lower_is_auto(&mut self, a: IsAuto) -> hir::IsAuto {
|
||||
match a {
|
||||
IsAuto::Yes => hir::IsAuto::Yes,
|
||||
IsAuto::No => hir::IsAuto::No,
|
||||
}
|
||||
|
@ -730,11 +730,14 @@ fn trait_def<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
}
|
||||
|
||||
let def_path_hash = tcx.def_path_hash(def_id);
|
||||
let has_auto_impl = tcx.hir.trait_is_auto(def_id);
|
||||
let is_auto = match item.node {
|
||||
hir::ItemTrait(hir::IsAuto::Yes, ..) => true,
|
||||
_ => tcx.hir.trait_is_auto(def_id),
|
||||
};
|
||||
let def = ty::TraitDef::new(def_id,
|
||||
unsafety,
|
||||
paren_sugar,
|
||||
has_auto_impl,
|
||||
is_auto,
|
||||
def_path_hash);
|
||||
tcx.alloc_trait_def(def)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user