diff options
| author | Taiki Endo <te316e89@gmail.com> | 2019-02-07 02:33:01 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2019-02-07 02:33:01 +0900 |
| commit | 7bb082d27fe472f52b103de0ae9fc6fa7e6546cc (patch) | |
| tree | dfed08e00fc6e88022fd7249bd5017e5d57110a7 /src/libsyntax/print | |
| parent | 2596bc1368d1e3d34c9a7841ad87a3100f01cbad (diff) | |
| download | rust-7bb082d27fe472f52b103de0ae9fc6fa7e6546cc.tar.gz rust-7bb082d27fe472f52b103de0ae9fc6fa7e6546cc.zip | |
libsyntax => 2018
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pp.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 45 |
2 files changed, 25 insertions, 23 deletions
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 5232b8333e6..2d837cb565b 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -138,6 +138,7 @@ use std::collections::VecDeque; use std::fmt; use std::io; use std::borrow::Cow; +use log::debug; /// How to break. Described in more detail in the module docs. #[derive(Clone, Copy, PartialEq)] @@ -192,7 +193,7 @@ impl Token { } impl fmt::Display for Token { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { Token::String(ref s, len) => write!(f, "STR({},{})", s, len), Token::Break(_) => f.write_str("BREAK"), diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 7cecf4b9af7..c7c4c4f1620 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1,21 +1,22 @@ +use crate::ast::{self, BlockCheckMode, PatKind, RangeEnd, RangeSyntax}; +use crate::ast::{SelfKind, GenericBound, TraitBoundModifier}; +use crate::ast::{Attribute, MacDelimiter, GenericArg}; +use crate::util::parser::{self, AssocOp, Fixity}; +use crate::attr; +use crate::source_map::{self, SourceMap, Spanned}; +use crate::parse::token::{self, BinOpToken, Token}; +use crate::parse::lexer::comments; +use crate::parse::{self, ParseSess}; +use crate::print::pp::{self, Breaks}; +use crate::print::pp::Breaks::{Consistent, Inconsistent}; +use crate::ptr::P; +use crate::std_inject; +use crate::symbol::keywords; +use crate::tokenstream::{self, TokenStream, TokenTree}; + use rustc_target::spec::abi::{self, Abi}; -use ast::{self, BlockCheckMode, PatKind, RangeEnd, RangeSyntax}; -use ast::{SelfKind, GenericBound, TraitBoundModifier}; -use ast::{Attribute, MacDelimiter, GenericArg}; -use util::parser::{self, AssocOp, Fixity}; -use attr; -use source_map::{self, SourceMap, Spanned}; use syntax_pos::{self, BytePos}; -use parse::token::{self, BinOpToken, Token}; -use parse::lexer::comments; -use parse::{self, ParseSess}; -use print::pp::{self, Breaks}; -use print::pp::Breaks::{Consistent, Inconsistent}; -use ptr::P; -use std_inject; -use symbol::keywords; use syntax_pos::{DUMMY_SP, FileName}; -use tokenstream::{self, TokenStream, TokenTree}; use std::ascii; use std::borrow::Cow; @@ -34,8 +35,8 @@ pub enum AnnNode<'a> { } pub trait PpAnn { - fn pre(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> { Ok(()) } - fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> { Ok(()) } + fn pre(&self, _state: &mut State<'_>, _node: AnnNode<'_>) -> io::Result<()> { Ok(()) } + fn post(&self, _state: &mut State<'_>, _node: AnnNode<'_>) -> io::Result<()> { Ok(()) } } #[derive(Copy, Clone)] @@ -150,7 +151,7 @@ impl<'a> State<'a> { } pub fn to_string<F>(f: F) -> String where - F: FnOnce(&mut State) -> io::Result<()>, + F: FnOnce(&mut State<'_>) -> io::Result<()>, { let mut wr = Vec::new(); { @@ -969,7 +970,7 @@ impl<'a> State<'a> { elts: &[T], mut op: F, mut get_span: G) -> io::Result<()> where - F: FnMut(&mut State, &T) -> io::Result<()>, + F: FnMut(&mut State<'_>, &T) -> io::Result<()>, G: FnMut(&T) -> syntax_pos::Span, { self.rbox(0, b)?; @@ -3210,10 +3211,10 @@ impl<'a> State<'a> { mod tests { use super::*; - use ast; - use source_map; + use crate::ast; + use crate::source_map; + use crate::with_globals; use syntax_pos; - use with_globals; #[test] fn test_fun_to_string() { |
