Rename TraitTyParamBound to ParamBound::Trait

This commit is contained in:
varkor
2018-06-14 11:25:14 +01:00
parent 8bc3a35576
commit 7de6ed06a5
17 changed files with 57 additions and 64 deletions

View File

@@ -283,14 +283,14 @@ pub enum TraitBoundModifier {
/// detects Copy, Send and Sync.
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum ParamBound {
TraitTyParamBound(PolyTraitRef, TraitBoundModifier),
Trait(PolyTraitRef, TraitBoundModifier),
Outlives(Lifetime)
}
impl ParamBound {
pub fn span(&self) -> Span {
match self {
&TraitTyParamBound(ref t, ..) => t.span,
&Trait(ref t, ..) => t.span,
&Outlives(ref l) => l.ident.span,
}
}
@@ -930,7 +930,7 @@ impl Expr {
fn to_bound(&self) -> Option<ParamBound> {
match &self.node {
ExprKind::Path(None, path) =>
Some(TraitTyParamBound(PolyTraitRef::new(Vec::new(), path.clone(), self.span),
Some(Trait(PolyTraitRef::new(Vec::new(), path.clone(), self.span),
TraitBoundModifier::None)),
_ => None,
}