diff options
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index 44bc09d07fe..785a60e9978 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -49,16 +49,16 @@ impl<'a, T: ?Sized> Captures<'a> for T {} /// Context that provides type information about constructors. /// /// Most of the crate is parameterized on a type that implements this trait. -pub trait MatchCx: Sized + Clone + fmt::Debug { +pub trait TypeCx: Sized + Clone + fmt::Debug { /// The type of a pattern. type Ty: Copy + Clone + fmt::Debug; // FIXME: remove Copy /// The index of an enum variant. type VariantIdx: Clone + Idx; /// A string literal type StrLit: Clone + PartialEq + fmt::Debug; - /// Extra data to store on a match arm. + /// Extra data to store in a match arm. type ArmData: Copy + Clone + fmt::Debug; - /// Extra data to store on a pattern. `Default` needed when we create fictitious wildcard + /// Extra data to store in a pattern. `Default` needed when we create fictitious wildcard /// patterns during analysis. type PatData: Clone + Default; @@ -86,24 +86,24 @@ pub trait MatchCx: Sized + Clone + fmt::Debug { /// Context that provides information global to a match. #[derive(Clone)] -pub struct MatchCtxt<'a, 'p, Cx: MatchCx> { +pub struct MatchCtxt<'a, 'p, Cx: TypeCx> { /// The context for type information. pub tycx: &'a Cx, /// An arena to store the wildcards we produce during analysis. pub wildcard_arena: &'a TypedArena<DeconstructedPat<'p, Cx>>, } -impl<'a, 'p, Cx: MatchCx> Copy for MatchCtxt<'a, 'p, Cx> {} +impl<'a, 'p, Cx: TypeCx> Copy for MatchCtxt<'a, 'p, Cx> {} /// The arm of a match expression. #[derive(Clone, Debug)] -pub struct MatchArm<'p, Cx: MatchCx> { +pub struct MatchArm<'p, Cx: TypeCx> { pub pat: &'p DeconstructedPat<'p, Cx>, pub has_guard: bool, pub arm_data: Cx::ArmData, } -impl<'p, Cx: MatchCx> Copy for MatchArm<'p, Cx> {} +impl<'p, Cx: TypeCx> Copy for MatchArm<'p, Cx> {} /// The entrypoint for this crate. Computes whether a match is exhaustive and which of its arms are /// useful, and runs some lints. |
