update TypeFlags
to deal with missing ct substs
This commit is contained in:
parent
cc47998e28
commit
ab9108b70f
44 changed files with 305 additions and 166 deletions
|
@ -242,6 +242,7 @@ pub struct Body<'tcx> {
|
|||
|
||||
impl<'tcx> Body<'tcx> {
|
||||
pub fn new(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
source: MirSource<'tcx>,
|
||||
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
|
||||
source_scopes: IndexVec<SourceScope, SourceScopeData<'tcx>>,
|
||||
|
@ -284,7 +285,7 @@ impl<'tcx> Body<'tcx> {
|
|||
predecessor_cache: PredecessorCache::new(),
|
||||
is_cyclic: GraphIsCyclicCache::new(),
|
||||
};
|
||||
body.is_polymorphic = body.has_param_types_or_consts();
|
||||
body.is_polymorphic = body.has_param_types_or_consts(tcx);
|
||||
body
|
||||
}
|
||||
|
||||
|
@ -293,7 +294,10 @@ impl<'tcx> Body<'tcx> {
|
|||
/// The returned MIR contains no `LocalDecl`s (even for the return place) or source scopes. It
|
||||
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
|
||||
/// crate.
|
||||
pub fn new_cfg_only(basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>) -> Self {
|
||||
pub fn new_cfg_only(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
|
||||
) -> Self {
|
||||
let mut body = Body {
|
||||
phase: MirPhase::Build,
|
||||
source: MirSource::item(DefId::local(CRATE_DEF_INDEX)),
|
||||
|
@ -311,7 +315,7 @@ impl<'tcx> Body<'tcx> {
|
|||
predecessor_cache: PredecessorCache::new(),
|
||||
is_cyclic: GraphIsCyclicCache::new(),
|
||||
};
|
||||
body.is_polymorphic = body.has_param_types_or_consts();
|
||||
body.is_polymorphic = body.has_param_types_or_consts(tcx);
|
||||
body
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue