diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 0ad75c5ec8cbc..78f06ce5fd5d0 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -238,7 +238,7 @@ pub fn name_to_dummy_lifetime(name: Name) -> Lifetime { pub fn impl_pretty_name(trait_ref: &Option, ty: Option<&Ty>) -> Ident { let mut pretty = match ty { Some(t) => pprust::ty_to_string(t), - None => String::from_str("..") + None => String::from("..") }; match *trait_ref { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index dfdaa47d8b925..0ad70c3379b98 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -557,9 +557,9 @@ impl CodeMap { // FIXME #12884: no efficient/safe way to remove from the start of a string // and reuse the allocation. let mut src = if src.starts_with("\u{feff}") { - String::from_str(&src[3..]) + String::from(&src[3..]) } else { - String::from_str(&src[..]) + String::from(&src[..]) }; // Append '\n' in case it's not already there. diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 620a8927134ba..a7453636c445c 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -644,7 +644,7 @@ fn highlight_lines(err: &mut EmitterWriter, } try!(write!(&mut err.dst, "{}", s)); - let mut s = String::from_str("^"); + let mut s = String::from("^"); let count = match lastc { // Most terminals have a tab stop every eight columns by default '\t' => 8 - col%8, diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index bda01d5a6541c..02f1a52aaf339 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -246,7 +246,7 @@ fn read_block_comment(rdr: &mut StringReader, rdr.bump(); rdr.bump(); - let mut curr_line = String::from_str("/*"); + let mut curr_line = String::from("/*"); // doc-comments are not really comments, they are attributes if (rdr.curr_is('*') && !rdr.nextch_is('*')) || rdr.curr_is('!') { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index dd00ad313215d..0fcf47d9e711d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4834,7 +4834,7 @@ impl<'a> Parser<'a> { let mut included_mod_stack = self.sess.included_mod_stack.borrow_mut(); match included_mod_stack.iter().position(|p| *p == path) { Some(i) => { - let mut err = String::from_str("circular modules: "); + let mut err = String::from("circular modules: "); let len = included_mod_stack.len(); for p in &included_mod_stack[i.. len] { err.push_str(&p.to_string_lossy()); diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 3fd4e31b4771e..15aaf9cf390fd 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -131,7 +131,7 @@ pub fn buf_str(toks: &[Token], assert_eq!(n, szs.len()); let mut i = left; let mut l = lim; - let mut s = string::String::from_str("["); + let mut s = string::String::from("["); while i != right && l != 0 { l -= 1; if i != left { diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 3ccc8f2619f2d..5a57e09fcfff2 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2794,13 +2794,13 @@ impl<'a> State<'a> { match lit.node { ast::LitStr(ref st, style) => self.print_string(&st, style), ast::LitByte(byte) => { - let mut res = String::from_str("b'"); + let mut res = String::from("b'"); res.extend(ascii::escape_default(byte).map(|c| c as char)); res.push('\''); word(&mut self.s, &res[..]) } ast::LitChar(ch) => { - let mut res = String::from_str("'"); + let mut res = String::from("'"); res.extend(ch.escape_default()); res.push('\''); word(&mut self.s, &res[..])