]> git.lizzy.rs Git - rust.git/commitdiff
Revert "Add a `constness` field to `ast::TraitRef`"
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Tue, 14 Jan 2020 04:30:29 +0000 (20:30 -0800)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Mon, 20 Jan 2020 08:00:08 +0000 (00:00 -0800)
This reverts commit fd4a6a12136c5b5d6bce4081e95890df1fd1febd.

src/librustc_expand/build.rs
src/libsyntax/ast.rs
src/libsyntax/mut_visit.rs

index bd3d6b589d00acfb210de183690e5f1f95fdae5d..11f94ab2e627980b0445e92a50967bc442e46b68 100644 (file)
@@ -110,7 +110,7 @@ pub fn typaram(
     }
 
     pub fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
-        ast::TraitRef { path, constness: None, ref_id: ast::DUMMY_NODE_ID }
+        ast::TraitRef { path, ref_id: ast::DUMMY_NODE_ID }
     }
 
     pub fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
index ce4d9cca81eb38856c7cd391027f5c48c268ade9..7c2608a0c2a31f58aeeceae52243e6289fe3f05b 100644 (file)
@@ -1040,7 +1040,7 @@ pub fn returns(&self) -> bool {
     pub fn to_bound(&self) -> Option<GenericBound> {
         match &self.kind {
             ExprKind::Path(None, path) => Some(GenericBound::Trait(
-                PolyTraitRef::new(Vec::new(), path.clone(), None, self.span),
+                PolyTraitRef::new(Vec::new(), path.clone(), self.span),
                 TraitBoundModifier::None,
             )),
             _ => None,
@@ -2383,15 +2383,6 @@ pub enum AttrKind {
 pub struct TraitRef {
     pub path: Path,
     pub ref_id: NodeId,
-
-    /// The `const` modifier, if any, that appears before this trait.
-    ///
-    /// |                | `constness`                 |
-    /// |----------------|-----------------------------|
-    /// | `Trait`        | `None`                      |
-    /// | `const Trait`  | `Some(Constness::Const)`    |
-    /// | `?const Trait` | `Some(Constness::NotConst)` |
-    pub constness: Option<Constness>,
 }
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
@@ -2406,15 +2397,10 @@ pub struct PolyTraitRef {
 }
 
 impl PolyTraitRef {
-    pub fn new(
-        generic_params: Vec<GenericParam>,
-        path: Path,
-        constness: Option<Constness>,
-        span: Span,
-    ) -> Self {
+    pub fn new(generic_params: Vec<GenericParam>, path: Path, span: Span) -> Self {
         PolyTraitRef {
             bound_generic_params: generic_params,
-            trait_ref: TraitRef { path, constness, ref_id: DUMMY_NODE_ID },
+            trait_ref: TraitRef { path, ref_id: DUMMY_NODE_ID },
             span,
         }
     }
index 8f82ff6b040a67533c8a533cc3e2e840b3ad9990..4a460c5d7b24c17cdf1e854a2f209840473787ea 100644 (file)
@@ -838,8 +838,7 @@ pub fn noop_visit_variant_data<T: MutVisitor>(vdata: &mut VariantData, vis: &mut
     }
 }
 
-pub fn noop_visit_trait_ref<T: MutVisitor>(tr: &mut TraitRef, vis: &mut T) {
-    let TraitRef { path, ref_id, constness: _ } = tr;
+pub fn noop_visit_trait_ref<T: MutVisitor>(TraitRef { path, ref_id }: &mut TraitRef, vis: &mut T) {
     vis.visit_path(path);
     vis.visit_id(ref_id);
 }