]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_hir/print.rs
Auto merge of #69482 - lqd:poloniusup, r=nikomatsakis
[rust.git] / src / librustc_hir / print.rs
index 92bd8b1ba5f8484b889af0a43ca6ba9145f18816..8cbbef959ce75ca4d40f26e4c8c49749cc59120b 100644 (file)
@@ -1,3 +1,5 @@
+use rustc_ast::ast;
+use rustc_ast::util::parser::{self, AssocOp, Fixity};
 use rustc_ast_pretty::pp::Breaks::{Consistent, Inconsistent};
 use rustc_ast_pretty::pp::{self, Breaks};
 use rustc_ast_pretty::pprust::{Comments, PrintState};
@@ -5,8 +7,6 @@
 use rustc_span::symbol::{kw, IdentPrinter};
 use rustc_span::{self, BytePos, FileName};
 use rustc_target::spec::abi::Abi;
-use syntax::ast;
-use syntax::util::parser::{self, AssocOp, Fixity};
 
 use crate::hir;
 use crate::hir::{GenericArg, GenericParam, GenericParamKind, Node};
@@ -140,13 +140,13 @@ fn print_generic_args(&mut self, _: &ast::GenericArgs, _colons_before_params: bo
 /// Requires you to pass an input filename and reader so that
 /// it can scan the input text for comments to copy forward.
 pub fn print_crate<'a>(
-    cm: &'a SourceMap,
+    sm: &'a SourceMap,
     krate: &hir::Crate<'_>,
     filename: FileName,
     input: String,
     ann: &'a dyn PpAnn,
 ) -> String {
-    let mut s = State::new_from_input(cm, filename, input, ann);
+    let mut s = State::new_from_input(sm, filename, input, ann);
 
     // When printing the AST, we sometimes need to inject `#[no_std]` here.
     // Since you can't compile the HIR, it's not necessary.
@@ -158,12 +158,12 @@ pub fn print_crate<'a>(
 
 impl<'a> State<'a> {
     pub fn new_from_input(
-        cm: &'a SourceMap,
+        sm: &'a SourceMap,
         filename: FileName,
         input: String,
         ann: &'a dyn PpAnn,
     ) -> State<'a> {
-        State { s: pp::mk_printer(), comments: Some(Comments::new(cm, filename, input)), ann }
+        State { s: pp::mk_printer(), comments: Some(Comments::new(sm, filename, input)), ann }
     }
 }