AwaitDesugar,
}
+impl MatchSource {
+ pub fn name(self) -> &'static str {
+ use MatchSource::*;
+ match self {
+ Normal => "match",
+ IfDesugar { .. } | IfLetDesugar { .. } => "if",
+ WhileDesugar | WhileLetDesugar => "while",
+ ForLoopDesugar => "for",
+ TryDesugar => "?",
+ AwaitDesugar => ".await",
+ }
+ }
+}
+
/// The loop type that yielded an `ExprKind::Loop`.
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
pub enum LoopSource {
pub fn name(self) -> &'static str {
match self {
LoopSource::Loop => "loop",
- LoopSource::While => "while",
- LoopSource::WhileLet => "while let",
+ LoopSource::While | LoopSource::WhileLet => "while",
LoopSource::ForLoop => "for",
}
}
/// Bindings like `A: Debug` are represented as a special type `A =
/// $::Debug` that is understood by the astconv code.
///
-/// FIXME(alexreg) -- why have a separate type for the binding case,
-/// wouldn't it be better to make the `ty` field an enum like:
+/// FIXME(alexreg): why have a separate type for the binding case,
+/// wouldn't it be better to make the `ty` field an enum like the
+/// following?
///
/// ```
/// enum TypeBindingKind {
Err,
}
-#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, HashStable)]
+#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, HashStable, PartialEq)]
pub struct InlineAsmOutput {
pub constraint: Symbol,
pub is_rw: bool,
// NOTE(eddyb) This is used within MIR as well, so unlike the rest of the HIR,
// it needs to be `Clone` and use plain `Vec<T>` instead of `HirVec<T>`.
-#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable)]
+#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable, PartialEq)]
pub struct InlineAsmInner {
pub asm: Symbol,
pub asm_str_style: StrStyle,