]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/fold.rs
Add `constness` field to `ty::Predicate::Trait`
[rust.git] / src / librustc / ty / fold.rs
index 53a1727d1cc136b988c63e2ae5c4fbc3b3b34e8e..0dddca98c62576842301b9dee6fec6720c9b08bd 100644 (file)
 //! These methods return true to indicate that the visitor has found what it is
 //! looking for, and does not need to visit anything else.
 
-use crate::hir::def_id::DefId;
 use crate::ty::{self, flags::FlagComputation, Binder, Ty, TyCtxt, TypeFlags};
+use rustc_hir::def_id::DefId;
 
-use crate::util::nodemap::FxHashSet;
+use rustc_data_structures::fx::FxHashSet;
 use std::collections::BTreeMap;
 use std::fmt;
 
@@ -150,6 +150,15 @@ fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
     }
 }
 
+impl TypeFoldable<'tcx> for syntax::ast::Constness {
+    fn super_fold_with<F: TypeFolder<'tcx>>(&self, _: &mut F) -> Self {
+        *self
+    }
+    fn super_visit_with<V: TypeVisitor<'tcx>>(&self, _: &mut V) -> bool {
+        false
+    }
+}
+
 /// The `TypeFolder` trait defines the actual *folding*. There is a
 /// method defined for every foldable type. Each of these has a
 /// default implementation that does an "identity" fold. Within each