]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/rustfmt/src/rewrite.rs
Rollup merge of #100653 - cuviper:fptoint_sat, r=michaelwoerister,antoyo
[rust.git] / src / tools / rustfmt / src / rewrite.rs
index f97df70cc6a7b3f3688d586e657637d2fab1889b..4a3bd129d16f5ad62b017f0ba277c87c8a80968d 100644 (file)
@@ -12,7 +12,6 @@
 use crate::skip::SkipContext;
 use crate::visitor::SnippetProvider;
 use crate::FormatReport;
-use rustc_data_structures::stable_map::FxHashMap;
 
 pub(crate) trait Rewrite {
     /// Rewrite self into shape.
@@ -25,22 +24,10 @@ fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String>
     }
 }
 
-#[derive(Clone, PartialEq, Eq, Hash)]
-pub(crate) struct QueryId {
-    pub(crate) shape: Shape,
-    pub(crate) span: Span,
-}
-
-// We use Option<HashMap> instead of HashMap, because in case of `None`
-// the function clean the memoize map, but it doesn't clean when
-// there is `Some(empty)`, so they are different.
-pub(crate) type Memoize = Rc<Cell<Option<FxHashMap<QueryId, Option<String>>>>>;
-
 #[derive(Clone)]
 pub(crate) struct RewriteContext<'a> {
     pub(crate) parse_sess: &'a ParseSess,
     pub(crate) config: &'a Config,
-    pub(crate) memoize: Memoize,
     pub(crate) inside_macro: Rc<Cell<bool>>,
     // Force block indent style even if we are using visual indent style.
     pub(crate) use_block: Cell<bool>,