From d938a8079f8f220e35f091754e8241f526f4e25b Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 30 Sep 2019 01:03:41 +0100 Subject: [PATCH 1/6] Fixed grammar for some `time` fn calls and a diagnostic. --- src/librustc_interface/passes.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 8474bae5a71d2..9874c0673cfc9 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -247,7 +247,7 @@ pub fn register_plugins<'a>( rustc_incremental::prepare_session_directory(sess, &crate_name, disambiguator); if sess.opts.incremental.is_some() { - time(sess, "garbage collect incremental cache directory", || { + time(sess, "garbage-collect incremental cache directory", || { if let Err(e) = rustc_incremental::garbage_collect_session_directories(sess) { warn!( "Error while trying to garbage collect incremental \ @@ -318,7 +318,7 @@ fn configure_and_expand_inner<'a>( crate_loader: &'a mut CrateLoader<'a>, plugin_info: PluginInfo, ) -> Result<(ast::Crate, Resolver<'a>)> { - time(sess, "pre ast expansion lint checks", || { + time(sess, "pre-AST-expansion lint checks", || { lint::check_ast_crate( sess, &krate, @@ -536,8 +536,8 @@ pub fn lower_to_hir( dep_graph: &DepGraph, krate: &ast::Crate, ) -> Result { - // Lower ast -> hir - let hir_forest = time(sess, "lowering ast -> hir", || { + // Lower AST to HIR. + let hir_forest = time(sess, "lowering AST -> HIR", || { let hir_crate = lower_crate(sess, cstore, &dep_graph, &krate, resolver); if sess.opts.debugging_opts.hir_stats { @@ -757,7 +757,7 @@ pub fn prepare_outputs( if !only_dep_info { if let Some(ref dir) = compiler.output_dir { if fs::create_dir_all(dir).is_err() { - sess.err("failed to find or create the directory specified by --out-dir"); + sess.err("failed to find or create the directory specified by `--out-dir`"); return Err(ErrorReported); } } @@ -830,8 +830,8 @@ pub fn create_global_ctxt( let global_ctxt: Option>; let arenas = AllArenas::new(); - // Construct the HIR map - let hir_map = time(sess, "indexing hir", || { + // Construct the HIR map. + let hir_map = time(sess, "indexing HIR", || { hir::map::map_crate(sess, cstore, &mut hir_forest, &defs) }); @@ -942,7 +942,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> { tcx.par_body_owners(|def_id| tcx.ensure().mir_borrowck(def_id)); }); - time(sess, "dumping chalk-like clauses", || { + time(sess, "dumping Chalk-like clauses", || { rustc_traits::lowering::dump_program_clauses(tcx); }); From fdd1a62a453dd41b75bc1b3a992c35292b853877 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 30 Sep 2019 01:05:00 +0100 Subject: [PATCH 2/6] Added backticks for one diagnostic message. --- src/libsyntax/parse/lexer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 66add869359d8..ac3feadce3ae6 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -47,7 +47,7 @@ impl<'a> StringReader<'a> { source_file: Lrc, override_span: Option) -> Self { if source_file.src.is_none() { - sess.span_diagnostic.bug(&format!("Cannot lex source_file without source: {}", + sess.span_diagnostic.bug(&format!("cannot lex `source_file` without source: {}", source_file.name)); } From 8a4af2f69936a23ee2fad48d36fdd955afb06a2c Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 30 Sep 2019 01:06:00 +0100 Subject: [PATCH 3/6] Fixed weird non-sequential indices for serialisation of `SourceFile` type. --- src/libsyntax_pos/lib.rs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index 674f17de618e9..6e83e1d3f8d4f 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -884,7 +884,7 @@ pub struct OffsetOverflowError; /// A single source in the `SourceMap`. #[derive(Clone)] pub struct SourceFile { - /// The name of the file that the source came from, source that doesn't + /// The name of the file that the source came from. Source that doesn't /// originate from files has names between angle brackets by convention /// (e.g., ``). pub name: FileName, @@ -922,9 +922,9 @@ impl Encodable for SourceFile { s.emit_struct_field("name", 0, |s| self.name.encode(s))?; s.emit_struct_field("name_was_remapped", 1, |s| self.name_was_remapped.encode(s))?; s.emit_struct_field("src_hash", 2, |s| self.src_hash.encode(s))?; - s.emit_struct_field("start_pos", 4, |s| self.start_pos.encode(s))?; - s.emit_struct_field("end_pos", 5, |s| self.end_pos.encode(s))?; - s.emit_struct_field("lines", 6, |s| { + s.emit_struct_field("start_pos", 3, |s| self.start_pos.encode(s))?; + s.emit_struct_field("end_pos", 4, |s| self.end_pos.encode(s))?; + s.emit_struct_field("lines", 5, |s| { let lines = &self.lines[..]; // Store the length. s.emit_u32(lines.len() as u32)?; @@ -970,13 +970,13 @@ impl Encodable for SourceFile { Ok(()) })?; - s.emit_struct_field("multibyte_chars", 7, |s| { + s.emit_struct_field("multibyte_chars", 6, |s| { self.multibyte_chars.encode(s) })?; - s.emit_struct_field("non_narrow_chars", 8, |s| { + s.emit_struct_field("non_narrow_chars", 7, |s| { self.non_narrow_chars.encode(s) })?; - s.emit_struct_field("name_hash", 9, |s| { + s.emit_struct_field("name_hash", 8, |s| { self.name_hash.encode(s) }) }) @@ -985,7 +985,6 @@ impl Encodable for SourceFile { impl Decodable for SourceFile { fn decode(d: &mut D) -> Result { - d.read_struct("SourceFile", 8, |d| { let name: FileName = d.read_struct_field("name", 0, |d| Decodable::decode(d))?; let name_was_remapped: bool = @@ -993,9 +992,9 @@ impl Decodable for SourceFile { let src_hash: u128 = d.read_struct_field("src_hash", 2, |d| Decodable::decode(d))?; let start_pos: BytePos = - d.read_struct_field("start_pos", 4, |d| Decodable::decode(d))?; - let end_pos: BytePos = d.read_struct_field("end_pos", 5, |d| Decodable::decode(d))?; - let lines: Vec = d.read_struct_field("lines", 6, |d| { + d.read_struct_field("start_pos", 3, |d| Decodable::decode(d))?; + let end_pos: BytePos = d.read_struct_field("end_pos", 4, |d| Decodable::decode(d))?; + let lines: Vec = d.read_struct_field("lines", 5, |d| { let num_lines: u32 = Decodable::decode(d)?; let mut lines = Vec::with_capacity(num_lines as usize); @@ -1024,18 +1023,18 @@ impl Decodable for SourceFile { Ok(lines) })?; let multibyte_chars: Vec = - d.read_struct_field("multibyte_chars", 7, |d| Decodable::decode(d))?; + d.read_struct_field("multibyte_chars", 6, |d| Decodable::decode(d))?; let non_narrow_chars: Vec = - d.read_struct_field("non_narrow_chars", 8, |d| Decodable::decode(d))?; + d.read_struct_field("non_narrow_chars", 7, |d| Decodable::decode(d))?; let name_hash: u128 = - d.read_struct_field("name_hash", 9, |d| Decodable::decode(d))?; + d.read_struct_field("name_hash", 8, |d| Decodable::decode(d))?; Ok(SourceFile { name, name_was_remapped, unmapped_path: None, // `crate_of_origin` has to be set by the importer. - // This value matches up with rustc::hir::def_id::INVALID_CRATE. - // That constant is not available here unfortunately :( + // This value matches up with `rustc::hir::def_id::INVALID_CRATE`. + // That constant is not available here, unfortunately. crate_of_origin: std::u32::MAX - 1, start_pos, end_pos, From 13b61b50d98af081bb5fdd6037fea5a1cf4138c5 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 30 Sep 2019 00:58:05 +0100 Subject: [PATCH 4/6] Fixed grammar in one diagnostic and blessed tests. --- src/librustc_typeck/check/method/suggest.rs | 34 +++++++++++-------- .../coherence/coherence_inherent.old.stderr | 2 +- .../ui/coherence/coherence_inherent.re.stderr | 2 +- .../coherence_inherent_cc.old.stderr | 2 +- .../coherence/coherence_inherent_cc.re.stderr | 2 +- .../ui/hygiene/no_implicit_prelude.stderr | 2 +- src/test/ui/hygiene/trait_items.stderr | 2 +- .../no-method-suggested-traits.stderr | 12 +++---- src/test/ui/issues/issue-10465.stderr | 2 +- src/test/ui/issues/issue-39175.stderr | 2 +- src/test/ui/issues/issue-43189.stderr | 2 +- .../rust-2018/trait-import-suggestions.stderr | 6 ++-- .../ui/shadowed/shadowed-trait-methods.stderr | 2 +- src/test/ui/traits/trait-item-privacy.stderr | 6 ++-- .../ui/traits/trait-method-private.stderr | 2 +- src/test/ui/underscore-imports/shadow.stderr | 2 +- 16 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 2d4d2e32f23db..2b34c24b266d0 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -631,26 +631,30 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - fn suggest_valid_traits(&self, - err: &mut DiagnosticBuilder<'_>, - valid_out_of_scope_traits: Vec) -> bool { + fn suggest_valid_traits( + &self, + err: &mut DiagnosticBuilder<'_>, + valid_out_of_scope_traits: Vec, + ) -> bool { if !valid_out_of_scope_traits.is_empty() { let mut candidates = valid_out_of_scope_traits; candidates.sort(); candidates.dedup(); err.help("items from traits can only be used if the trait is in scope"); - let msg = format!("the following {traits_are} implemented but not in scope, \ - perhaps add a `use` for {one_of_them}:", - traits_are = if candidates.len() == 1 { - "trait is" - } else { - "traits are" - }, - one_of_them = if candidates.len() == 1 { - "it" - } else { - "one of them" - }); + let msg = format!( + "the following {traits_are} implemented but not in scope; \ + perhaps add a `use` for {one_of_them}:", + traits_are = if candidates.len() == 1 { + "trait is" + } else { + "traits are" + }, + one_of_them = if candidates.len() == 1 { + "it" + } else { + "one of them" + }, + ); self.suggest_use_candidates(err, msg, candidates); true diff --git a/src/test/ui/coherence/coherence_inherent.old.stderr b/src/test/ui/coherence/coherence_inherent.old.stderr index 750d243480638..e71547cb89f9c 100644 --- a/src/test/ui/coherence/coherence_inherent.old.stderr +++ b/src/test/ui/coherence/coherence_inherent.old.stderr @@ -5,7 +5,7 @@ LL | s.the_fn(); | ^^^^^^ method not found in `&Lib::TheStruct` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use Lib::TheTrait;` error: aborting due to previous error diff --git a/src/test/ui/coherence/coherence_inherent.re.stderr b/src/test/ui/coherence/coherence_inherent.re.stderr index 750d243480638..e71547cb89f9c 100644 --- a/src/test/ui/coherence/coherence_inherent.re.stderr +++ b/src/test/ui/coherence/coherence_inherent.re.stderr @@ -5,7 +5,7 @@ LL | s.the_fn(); | ^^^^^^ method not found in `&Lib::TheStruct` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use Lib::TheTrait;` error: aborting due to previous error diff --git a/src/test/ui/coherence/coherence_inherent_cc.old.stderr b/src/test/ui/coherence/coherence_inherent_cc.old.stderr index 59166a4609406..3683943c5c819 100644 --- a/src/test/ui/coherence/coherence_inherent_cc.old.stderr +++ b/src/test/ui/coherence/coherence_inherent_cc.old.stderr @@ -5,7 +5,7 @@ LL | s.the_fn(); | ^^^^^^ method not found in `&coherence_inherent_cc_lib::TheStruct` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use coherence_inherent_cc_lib::TheTrait;` error: aborting due to previous error diff --git a/src/test/ui/coherence/coherence_inherent_cc.re.stderr b/src/test/ui/coherence/coherence_inherent_cc.re.stderr index 59166a4609406..3683943c5c819 100644 --- a/src/test/ui/coherence/coherence_inherent_cc.re.stderr +++ b/src/test/ui/coherence/coherence_inherent_cc.re.stderr @@ -5,7 +5,7 @@ LL | s.the_fn(); | ^^^^^^ method not found in `&coherence_inherent_cc_lib::TheStruct` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use coherence_inherent_cc_lib::TheTrait;` error: aborting due to previous error diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index bc0ce746be925..736369dab8354 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -25,7 +25,7 @@ LL | ().clone() | ^^^^^ method not found in `()` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use std::clone::Clone;` error: aborting due to 3 previous errors diff --git a/src/test/ui/hygiene/trait_items.stderr b/src/test/ui/hygiene/trait_items.stderr index 39e32522c7a76..c3ce484edf7a9 100644 --- a/src/test/ui/hygiene/trait_items.stderr +++ b/src/test/ui/hygiene/trait_items.stderr @@ -8,7 +8,7 @@ LL | pub macro m() { ().f() } | ^ method not found in `()` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use foo::T;` error: aborting due to previous error diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr index be8f3ab1b72e8..f0a03e1be82ac 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr +++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr @@ -5,7 +5,7 @@ LL | 1u32.method(); | ^^^^^^ method not found in `u32` | = help: items from traits can only be used if the trait is in scope -help: the following traits are implemented but not in scope, perhaps add a `use` for one of them: +help: the following traits are implemented but not in scope; perhaps add a `use` for one of them: | LL | use foo::Bar; | @@ -23,7 +23,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1u32)).method(); | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u32>>` | = help: items from traits can only be used if the trait is in scope -help: the following traits are implemented but not in scope, perhaps add a `use` for one of them: +help: the following traits are implemented but not in scope; perhaps add a `use` for one of them: | LL | use foo::Bar; | @@ -41,7 +41,7 @@ LL | 'a'.method(); | ^^^^^^ method not found in `char` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use foo::Bar; | @@ -61,7 +61,7 @@ LL | std::rc::Rc::new(&mut Box::new(&'a')).method(); | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&char>>` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use foo::Bar; | @@ -73,7 +73,7 @@ LL | 1i32.method(); | ^^^^^^ method not found in `i32` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use no_method_suggested_traits::foo::PubPub; | @@ -85,7 +85,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1i32)).method(); | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&i32>>` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use no_method_suggested_traits::foo::PubPub; | diff --git a/src/test/ui/issues/issue-10465.stderr b/src/test/ui/issues/issue-10465.stderr index 413daa6db6787..80ca051ceff0d 100644 --- a/src/test/ui/issues/issue-10465.stderr +++ b/src/test/ui/issues/issue-10465.stderr @@ -5,7 +5,7 @@ LL | b.foo(); | ^^^ method not found in `&b::B` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use a::A;` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-39175.stderr b/src/test/ui/issues/issue-39175.stderr index 66680b9936e68..8b173e1b50c1e 100644 --- a/src/test/ui/issues/issue-39175.stderr +++ b/src/test/ui/issues/issue-39175.stderr @@ -5,7 +5,7 @@ LL | Command::new("echo").arg("hello").exec(); | ^^^^ method not found in `&mut std::process::Command` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use std::os::unix::process::CommandExt; | diff --git a/src/test/ui/issues/issue-43189.stderr b/src/test/ui/issues/issue-43189.stderr index 33c3f18650a80..4dae6c1cd158e 100644 --- a/src/test/ui/issues/issue-43189.stderr +++ b/src/test/ui/issues/issue-43189.stderr @@ -5,7 +5,7 @@ LL | ().a(); | ^ method not found in `()` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use xcrate_issue_43189_b::xcrate_issue_43189_a::A; | diff --git a/src/test/ui/rust-2018/trait-import-suggestions.stderr b/src/test/ui/rust-2018/trait-import-suggestions.stderr index 19f758fd8da77..4b1898345a32e 100644 --- a/src/test/ui/rust-2018/trait-import-suggestions.stderr +++ b/src/test/ui/rust-2018/trait-import-suggestions.stderr @@ -5,7 +5,7 @@ LL | x.foobar(); | ^^^^^^ method not found in `u32` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use crate::foo::foobar::Foobar;` error[E0599]: no method named `bar` found for type `u32` in the current scope @@ -15,7 +15,7 @@ LL | x.bar(); | ^^^ method not found in `u32` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use crate::foo::Bar; | @@ -33,7 +33,7 @@ LL | let y = u32::from_str("33"); | ^^^^^^^^ function or associated item not found in `u32` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use std::str::FromStr; | diff --git a/src/test/ui/shadowed/shadowed-trait-methods.stderr b/src/test/ui/shadowed/shadowed-trait-methods.stderr index 190159ec7b88d..3597cc53420aa 100644 --- a/src/test/ui/shadowed/shadowed-trait-methods.stderr +++ b/src/test/ui/shadowed/shadowed-trait-methods.stderr @@ -5,7 +5,7 @@ LL | ().f() | ^ method not found in `()` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use foo::T; | diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/trait-item-privacy.stderr index 39cc66d275c24..64a92c6b0b478 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/trait-item-privacy.stderr @@ -28,7 +28,7 @@ LL | S.b(); | ^ method not found in `S` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use method::B; | @@ -62,7 +62,7 @@ LL | S::b(&S); | ^ function or associated item not found in `S` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use method::B; | @@ -96,7 +96,7 @@ LL | S::B; | ^ associated item not found in `S` | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use assoc_const::B; | diff --git a/src/test/ui/traits/trait-method-private.stderr b/src/test/ui/traits/trait-method-private.stderr index c1dd9387ebc48..10552acb348be 100644 --- a/src/test/ui/traits/trait-method-private.stderr +++ b/src/test/ui/traits/trait-method-private.stderr @@ -5,7 +5,7 @@ LL | foo.method(); | ^^^^^^ | = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope, perhaps add a `use` for it: +help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use inner::Bar; | diff --git a/src/test/ui/underscore-imports/shadow.stderr b/src/test/ui/underscore-imports/shadow.stderr index 63262d0dc326d..102c17f6f5618 100644 --- a/src/test/ui/underscore-imports/shadow.stderr +++ b/src/test/ui/underscore-imports/shadow.stderr @@ -5,7 +5,7 @@ LL | x.deref(); | ^^^^^ method not found in `&()` | = help: items from traits can only be used if the trait is in scope - = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use std::ops::Deref;` error: aborting due to previous error From 49c6c86faf91365a0e9162ed277d907a22d2420e Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 30 Sep 2019 01:00:20 +0100 Subject: [PATCH 5/6] Fixed stylistic convention for one diagnostic and blessed tests. --- src/librustc_typeck/astconv.rs | 4 ++-- src/test/ui/issues/issue-37534.stderr | 2 +- src/test/ui/maybe-bounds-where.stderr | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index fd6744da06067..b8e2700803a5d 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -952,8 +952,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { tcx.sess.span_warn( span, "default bound relaxed for a type parameter, but \ - this does nothing because the given bound is not \ - a default. Only `?Sized` is supported", + this does nothing because the given bound is not \ + a default; only `?Sized` is supported", ); } } diff --git a/src/test/ui/issues/issue-37534.stderr b/src/test/ui/issues/issue-37534.stderr index 3a0ab32dcc66b..2ea9dcbe9d0a4 100644 --- a/src/test/ui/issues/issue-37534.stderr +++ b/src/test/ui/issues/issue-37534.stderr @@ -8,7 +8,7 @@ help: possible better candidate is found in another module, you can import it in LL | use std::hash::Hash; | -warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default. Only `?Sized` is supported +warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported --> $DIR/issue-37534.rs:1:12 | LL | struct Foo { } diff --git a/src/test/ui/maybe-bounds-where.stderr b/src/test/ui/maybe-bounds-where.stderr index 78524cbabecd7..15cbce46f0a9b 100644 --- a/src/test/ui/maybe-bounds-where.stderr +++ b/src/test/ui/maybe-bounds-where.stderr @@ -34,7 +34,7 @@ error[E0203]: type parameter has more than one relaxed default bound, only one i LL | struct S5(*const T) where T: ?Trait<'static> + ?Sized; | ^ -warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default. Only `?Sized` is supported +warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported --> $DIR/maybe-bounds-where.rs:15:11 | LL | struct S5(*const T) where T: ?Trait<'static> + ?Sized; From 33ed03fea0106ad76314aa7e616c199996418737 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 30 Sep 2019 01:08:15 +0100 Subject: [PATCH 6/6] Cleaned up a few doc comments in libfmt_macros. --- src/libfmt_macros/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index f9c1be20b8bc1..d22420e76dcd4 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -410,7 +410,7 @@ impl<'a> Parser<'a> { &self.input[start..self.input.len()] } - /// Parses an Argument structure, or what's contained within braces inside the format string + /// Parses an `Argument` structure, or what's contained within braces inside the format string. fn argument(&mut self) -> Argument<'a> { let pos = self.position(); let format = self.format(); @@ -464,7 +464,7 @@ impl<'a> Parser<'a> { } /// Parses a format specifier at the current position, returning all of the - /// relevant information in the FormatSpec struct. + /// relevant information in the `FormatSpec` struct. fn format(&mut self) -> FormatSpec<'a> { let mut spec = FormatSpec { fill: None, @@ -571,7 +571,7 @@ impl<'a> Parser<'a> { spec } - /// Parses a Count parameter at the current position. This does not check + /// Parses a `Count` parameter at the current position. This does not check /// for 'CountIsNextParam' because that is only used in precision, not /// width. fn count(&mut self, start: usize) -> (Count, Option) {