-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use crate::rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
-use crate::rustc::{declare_tool_lint, lint_array};
-use crate::rustc_errors::Applicability;
-use crate::syntax::ast::*;
-use crate::syntax::parse::{parser, token};
-use crate::syntax::tokenstream::{ThinTokenStream, TokenStream};
use crate::utils::{snippet_with_applicability, span_lint, span_lint_and_sugg};
+use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
+use rustc::{declare_tool_lint, lint_array};
+use rustc_errors::Applicability;
use std::borrow::Cow;
+use syntax::ast::*;
+use syntax::parse::{parser, token};
+use syntax::tokenstream::TokenStream;
/// **What it does:** This lint warns when you use `println!("")` to
/// print a newline.
/// ```rust,ignore
/// (Some("string to write: {}"), Some(buf))
/// ```
-fn check_tts<'a>(cx: &EarlyContext<'a>, tts: &ThinTokenStream, is_write: bool) -> (Option<String>, Option<Expr>) {
- use crate::fmt_macros::*;
- let tts = TokenStream::from(tts.clone());
+fn check_tts<'a>(cx: &EarlyContext<'a>, tts: &TokenStream, is_write: bool) -> (Option<String>, Option<Expr>) {
+ use fmt_macros::*;
+ let tts = tts.clone();
let mut parser = parser::Parser::new(&cx.sess.parse_sess, tts, None, false, false);
let mut expr: Option<Expr> = None;
if is_write {
};
let tmp = fmtstr.clone();
let mut args = vec![];
- let mut fmt_parser = Parser::new(&tmp, None);
+ let mut fmt_parser = Parser::new(&tmp, None, Vec::new(), false);
while let Some(piece) = fmt_parser.next() {
if !fmt_parser.errors.is_empty() {
return (None, expr);