+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};
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};
/// 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.
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 }
}
}