-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mir constants: type traversing bye bye
- Loading branch information
Showing
12 changed files
with
26 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,15 @@ | ||
//! `TypeVisitable` implementations for MIR types | ||
use super::*; | ||
use crate::mir; | ||
|
||
impl<'tcx, R: Idx, C: Idx> TypeVisitable<'tcx> for BitMatrix<R, C> { | ||
fn visit_with<V: TypeVisitor<'tcx>>(&self, _: &mut V) -> ControlFlow<V::BreakTy> { | ||
ControlFlow::CONTINUE | ||
} | ||
} | ||
|
||
impl<'tcx> TypeVisitable<'tcx> for mir::UnevaluatedConst<'tcx> { | ||
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> { | ||
visitor.visit_mir_unevaluated(*self) | ||
} | ||
} | ||
|
||
impl<'tcx> TypeSuperVisitable<'tcx> for mir::UnevaluatedConst<'tcx> { | ||
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> { | ||
self.substs.visit_with(visitor) | ||
} | ||
} | ||
|
||
impl<'tcx> TypeVisitable<'tcx> for ConstantKind<'tcx> { | ||
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> { | ||
visitor.visit_mir_const(*self) | ||
} | ||
} | ||
|
||
impl<'tcx> TypeSuperVisitable<'tcx> for ConstantKind<'tcx> { | ||
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> { | ||
match *self { | ||
ConstantKind::Ty(c) => c.visit_with(visitor), | ||
ConstantKind::Val(_, t) => t.visit_with(visitor), | ||
ConstantKind::Unevaluated(uv, t) => { | ||
uv.visit_with(visitor)?; | ||
t.visit_with(visitor) | ||
} | ||
} | ||
impl<'tcx> TypeVisitable<'tcx> for ConstValue<'tcx> { | ||
fn visit_with<V: TypeVisitor<'tcx>>(&self, _: &mut V) -> ControlFlow<V::BreakTy> { | ||
ControlFlow::CONTINUE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.