remove GeneratorSubsts visitors

This commit is contained in:
csmoe 2019-10-03 21:30:26 +08:00
parent 774ea808be
commit ef9fe10280
3 changed files with 4 additions and 14 deletions

View File

@ -1,5 +1,5 @@
use crate::ty::subst::SubstsRef;
use crate::ty::{CanonicalUserTypeAnnotation, GeneratorSubsts, Ty};
use crate::ty::{CanonicalUserTypeAnnotation, Ty};
use crate::mir::*;
use syntax_pos::Span;
@ -230,12 +230,6 @@ macro_rules! make_mir_visitor {
self.super_substs(substs);
}
fn visit_generator_substs(&mut self,
substs: & $($mutability)? GeneratorSubsts<'tcx>,
_: Location) {
self.super_generator_substs(substs);
}
fn visit_local_decl(&mut self,
local: Local,
local_decl: & $($mutability)? LocalDecl<'tcx>) {
@ -628,7 +622,7 @@ macro_rules! make_mir_visitor {
generator_substs,
_movability,
) => {
self.visit_generator_substs(generator_substs, location);
self.visit_substs(generator_substs, location);
}
}
@ -846,10 +840,6 @@ macro_rules! make_mir_visitor {
fn super_substs(&mut self, _substs: & $($mutability)? SubstsRef<'tcx>) {
}
fn super_generator_substs(&mut self,
_substs: & $($mutability)? GeneratorSubsts<'tcx>) {
}
// Convenience methods
fn visit_location(&mut self, body: & $($mutability)? Body<'tcx>, location: Location) {

View File

@ -1259,7 +1259,7 @@ fn confirm_generator_candidate<'cx, 'tcx>(
obligation: &ProjectionTyObligation<'tcx>,
vtable: VtableGeneratorData<'tcx, PredicateObligation<'tcx>>,
) -> Progress<'tcx> {
let gen_sig = vtable.substs.poly_sig(vtable.generator_def_id, selcx.tcx());
let gen_sig = vtable.substs.as_generator().poly_sig(vtable.generator_def_id, selcx.tcx());
let Normalized {
value: gen_sig,
obligations

View File

@ -395,7 +395,7 @@ fn resolve_associated_item<'tcx>(
traits::VtableGenerator(generator_data) => {
Some(Instance {
def: ty::InstanceDef::Item(generator_data.generator_def_id),
substs: generator_data.substs.substs
substs: generator_data.substs
})
}
traits::VtableClosure(closure_data) => {