diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index 0f93ef6b1a9e4..3ff5b2521ae81 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -463,7 +463,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { &self, err: &mut DiagnosticBuilder<'_>, terr: &TypeError<'tcx>, - sp: Span, ) { use hir::def_id::CrateNum; use hir::map::DisambiguatedDefPathData; @@ -577,14 +576,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { }; if same_path().unwrap_or(false) { let crate_name = self.tcx.crate_name(did1.krate); - err.span_note( - sp, - &format!( - "Perhaps two different versions \ - of crate `{}` are being used?", - crate_name - ), - ); + err.note(&format!( + "perhaps two different versions of crate `{}` are being used?", + crate_name + )); } } }; @@ -1263,7 +1258,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { .unwrap_or_else(|| { self.tcx.hir().body_owner_def_id(hir::BodyId { hir_id: cause.body_id }) }); - self.check_and_note_conflicting_crates(diag, terr, span); + self.check_and_note_conflicting_crates(diag, terr); self.tcx.note_and_explain_type_err(diag, terr, span, body_owner_def_id); // It reads better to have the error origin as the final diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index a721e381b4e99..7b54b98cbc13c 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -698,7 +698,9 @@ impl<'a> CrateLoader<'a> { let has_global_allocator = match &*global_allocator_spans(krate) { [span1, span2, ..] => { self.sess.struct_span_err(*span2, "cannot define multiple global allocators") - .span_note(*span1, "the previous global allocator is defined here").emit(); + .span_label(*span2, "cannot define a new global allocator") + .span_label(*span1, "previous global allocator is defined here") + .emit(); true } spans => !spans.is_empty() diff --git a/src/librustc_mir/borrow_check/conflict_errors.rs b/src/librustc_mir/borrow_check/conflict_errors.rs index ebc25138a0619..b78d3475a413c 100644 --- a/src/librustc_mir/borrow_check/conflict_errors.rs +++ b/src/librustc_mir/borrow_check/conflict_errors.rs @@ -1256,23 +1256,17 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { Applicability::MachineApplicable, ); - match category { - ConstraintCategory::Return => { - err.span_note(constraint_span, "closure is returned here"); - } - ConstraintCategory::OpaqueType => { - err.span_note(constraint_span, "generator is returned here"); - } + let msg = match category { + ConstraintCategory::Return => "closure is returned here".to_string(), + ConstraintCategory::OpaqueType => "generator is returned here".to_string(), ConstraintCategory::CallArgument => { fr_name.highlight_region_name(&mut err); - err.span_note( - constraint_span, - &format!("function requires argument type to outlive `{}`", fr_name), - ); + format!("function requires argument type to outlive `{}`", fr_name) } _ => bug!("report_escaping_closure_capture called with unexpected constraint \ category: `{:?}`", category), - } + }; + err.span_note(constraint_span, &msg); err } diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs index d9e958d945001..21191792b8237 100644 --- a/src/librustc_mir/borrow_check/move_errors.rs +++ b/src/librustc_mir/borrow_check/move_errors.rs @@ -555,7 +555,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { err: &mut DiagnosticBuilder<'a>, binds_to: &[Local], ) { - let mut noncopy_var_spans = Vec::new(); for (j, local) in binds_to.into_iter().enumerate() { let bind_to = &self.body.local_decls[*local]; let binding_span = bind_to.source_info.span; @@ -573,16 +572,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { bind_to.ty, Some(binding_span) ); - } else { - noncopy_var_spans.push(binding_span); } } if binds_to.len() > 1 { - err.span_note( - noncopy_var_spans, - "move occurs because these variables have types that \ - don't implement the `Copy` trait", + err.note("move occurs because these variables have types that \ + don't implement the `Copy` trait", ); } } diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs index 20b96d5cd62f6..199125125c64e 100644 --- a/src/librustc_parse/parser/item.rs +++ b/src/librustc_parse/parser/item.rs @@ -490,9 +490,12 @@ impl<'a> Parser<'a> { } /// Parses a macro invocation inside a `trait`, `impl` or `extern` block. - fn parse_assoc_macro_invoc(&mut self, item_kind: &str, vis: Option<&Visibility>, - at_end: &mut bool) -> PResult<'a, Option> - { + fn parse_assoc_macro_invoc( + &mut self, + item_kind: &str, + vis: Option<&Visibility>, + at_end: &mut bool, + ) -> PResult<'a, Option> { if self.token.is_path_start() && !(self.is_async_fn() && self.token.span.rust_2015()) { let prev_span = self.prev_span; @@ -531,9 +534,11 @@ impl<'a> Parser<'a> { } } - fn missing_assoc_item_kind_err(&self, item_type: &str, prev_span: Span) - -> DiagnosticBuilder<'a> - { + fn missing_assoc_item_kind_err( + &self, + item_type: &str, + prev_span: Span, + ) -> DiagnosticBuilder<'a> { let expected_kinds = if item_type == "extern" { "missing `fn`, `type`, or `static`" } else { diff --git a/src/librustc_passes/loops.rs b/src/librustc_passes/loops.rs index 6140d0438d8a7..50f0d66b5e3fd 100644 --- a/src/librustc_passes/loops.rs +++ b/src/librustc_passes/loops.rs @@ -144,8 +144,8 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> { "`continue` pointing to a labeled block") .span_label(e.span, "labeled blocks cannot be `continue`'d") - .span_note(block.span, - "labeled block the continue points to") + .span_label(block.span, + "labeled block the `continue` points to") .emit(); } } diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index 5c8e79096312f..3ad53737f4969 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -1160,8 +1160,10 @@ impl<'a, 'b> ImportResolver<'a, 'b> { .emit(); } else { let msg = format!("`{}` is private, and cannot be re-exported", ident); - let note_msg = - format!("consider marking `{}` as `pub` in the imported module", ident); + let note_msg = format!( + "consider marking `{}` as `pub` in the imported module", + ident, + ); struct_span_err!(self.r.session, directive.span, E0364, "{}", &msg) .span_note(directive.span, ¬e_msg) .emit(); diff --git a/src/librustdoc/passes/mod.rs b/src/librustdoc/passes/mod.rs index f6560218a78c8..0a95d4209ac6a 100644 --- a/src/librustdoc/passes/mod.rs +++ b/src/librustdoc/passes/mod.rs @@ -344,7 +344,7 @@ pub fn look_for_tests<'tcx>( lint::builtin::MISSING_DOC_CODE_EXAMPLES, hir_id, sp, - "Missing code example in this documentation"); + "missing code example in this documentation"); diag.emit(); } else if check_missing_code == false && tests.found_tests > 0 && @@ -353,7 +353,7 @@ pub fn look_for_tests<'tcx>( lint::builtin::PRIVATE_DOC_TESTS, hir_id, span_of_attrs(&item.attrs).unwrap_or(item.source.span()), - "Documentation test in private item"); + "documentation test in private item"); diag.emit(); } } @@ -367,7 +367,7 @@ crate fn span_of_attrs(attrs: &clean::Attributes) -> Option { if start == DUMMY_SP { return None; } - let end = attrs.doc_strings.last().expect("No doc strings provided").span(); + let end = attrs.doc_strings.last().expect("no doc strings provided").span(); Some(start.to(end)) } diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs index f966850254f9a..d37f48f9a4f90 100644 --- a/src/libsyntax/feature_gate/check.rs +++ b/src/libsyntax/feature_gate/check.rs @@ -688,10 +688,9 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], crate_edition: Edition, allow_features: &Option>) -> Features { fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) { let mut err = struct_span_err!(span_handler, span, E0557, "feature has been removed"); + err.span_label(span, "feature has been removed"); if let Some(reason) = reason { - err.span_note(span, reason); - } else { - err.span_label(span, "feature has been removed"); + err.note(reason); } err.emit(); } diff --git a/src/libsyntax_expand/mbe/macro_check.rs b/src/libsyntax_expand/mbe/macro_check.rs index 25754ed42177f..837e04afd3401 100644 --- a/src/libsyntax_expand/mbe/macro_check.rs +++ b/src/libsyntax_expand/mbe/macro_check.rs @@ -269,7 +269,8 @@ fn check_binders( // for nested macro definitions. sess.span_diagnostic .struct_span_err(span, "duplicate matcher binding") - .span_note(prev_info.span, "previous declaration was here") + .span_label(span, "duplicate binding") + .span_label(prev_info.span, "previous binding") .emit(); *valid = false; } else { diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 25daca9237fd6..0a19d64200ce7 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -172,7 +172,8 @@ fn parse_args<'a>( let e = p.parse_expr()?; if let Some(prev) = names.get(&name) { ecx.struct_span_err(e.span, &format!("duplicate argument named `{}`", name)) - .span_note(args[*prev].span, "previously here") + .span_label(args[*prev].span, "previously here") + .span_label(e.span, "duplicate argument") .emit(); continue; } diff --git a/src/libsyntax_ext/proc_macro_harness.rs b/src/libsyntax_ext/proc_macro_harness.rs index fbded7dc130eb..604400c3cc2ff 100644 --- a/src/libsyntax_ext/proc_macro_harness.rs +++ b/src/libsyntax_ext/proc_macro_harness.rs @@ -270,7 +270,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { }; self.handler.struct_span_err(attr.span, &msg) - .span_note(prev_attr.span, "previous attribute here") + .span_label(prev_attr.span, "previous attribute here") .emit(); return; diff --git a/src/test/rustdoc-ui/doc-without-codeblock.rs b/src/test/rustdoc-ui/doc-without-codeblock.rs index 4b2a91e9c8127..5ad8e8a826f05 100644 --- a/src/test/rustdoc-ui/doc-without-codeblock.rs +++ b/src/test/rustdoc-ui/doc-without-codeblock.rs @@ -1,13 +1,13 @@ -#![deny(missing_doc_code_examples)] //~ ERROR Missing code example in this documentation +#![deny(missing_doc_code_examples)] //~ ERROR missing code example in this documentation /// Some docs. -//~^ ERROR Missing code example in this documentation +//~^ ERROR missing code example in this documentation pub struct Foo; /// And then, the princess died. -//~^ ERROR Missing code example in this documentation +//~^ ERROR missing code example in this documentation pub mod foo { /// Or maybe not because she saved herself! - //~^ ERROR Missing code example in this documentation + //~^ ERROR missing code example in this documentation pub fn bar() {} } diff --git a/src/test/rustdoc-ui/doc-without-codeblock.stderr b/src/test/rustdoc-ui/doc-without-codeblock.stderr index 23c07c4d32d64..bf65fcf19a0d6 100644 --- a/src/test/rustdoc-ui/doc-without-codeblock.stderr +++ b/src/test/rustdoc-ui/doc-without-codeblock.stderr @@ -1,4 +1,4 @@ -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/doc-without-codeblock.rs:1:1 | LL | / #![deny(missing_doc_code_examples)] @@ -16,19 +16,19 @@ note: lint level defined here LL | #![deny(missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/doc-without-codeblock.rs:3:1 | LL | /// Some docs. | ^^^^^^^^^^^^^^ -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/doc-without-codeblock.rs:7:1 | LL | /// And then, the princess died. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/doc-without-codeblock.rs:10:5 | LL | /// Or maybe not because she saved herself! diff --git a/src/test/rustdoc-ui/lint-group.rs b/src/test/rustdoc-ui/lint-group.rs index 0e0ebd9ce7080..06766db5335a1 100644 --- a/src/test/rustdoc-ui/lint-group.rs +++ b/src/test/rustdoc-ui/lint-group.rs @@ -14,11 +14,11 @@ pub fn link_error() {} //~^^^^^ ERROR cannot be resolved, ignoring it /// wait, this doesn't have a doctest? -pub fn no_doctest() {} //~^ ERROR Missing code example in this documentation +pub fn no_doctest() {} //~^ ERROR missing code example in this documentation /// wait, this *does* have a doctest? /// /// ``` /// println!("sup"); /// ``` -fn private_doctest() {} //~^^^^^ ERROR Documentation test in private item +fn private_doctest() {} //~^^^^^ ERROR documentation test in private item diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr index cd523b227deb1..63274ae2be4f6 100644 --- a/src/test/rustdoc-ui/lint-group.stderr +++ b/src/test/rustdoc-ui/lint-group.stderr @@ -1,4 +1,4 @@ -error: Documentation test in private item +error: documentation test in private item --> $DIR/lint-group.rs:19:1 | LL | / /// wait, this *does* have a doctest? @@ -29,7 +29,7 @@ LL | #![deny(rustdoc)] = note: `#[deny(intra_doc_link_resolution_failure)]` implied by `#[deny(rustdoc)]` = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]` -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/lint-group.rs:16:1 | LL | /// wait, this doesn't have a doctest? diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr index 97a52a13e3f65..179dba17c6d81 100644 --- a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr +++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr @@ -1,4 +1,4 @@ -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/lint-missing-doc-code-example.rs:19:1 | LL | / mod module1 { @@ -11,7 +11,7 @@ note: lint level defined here LL | #![deny(missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Missing code example in this documentation +error: missing code example in this documentation --> $DIR/lint-missing-doc-code-example.rs:37:3 | LL | /// doc diff --git a/src/test/rustdoc-ui/private-item-doc-test.rs b/src/test/rustdoc-ui/private-item-doc-test.rs index 20ac292aeaf80..2f1bddc7c75cc 100644 --- a/src/test/rustdoc-ui/private-item-doc-test.rs +++ b/src/test/rustdoc-ui/private-item-doc-test.rs @@ -6,6 +6,6 @@ mod foo { /// ``` /// assert!(false); /// ``` - //~^^^^^ ERROR Documentation test in private item + //~^^^^^ ERROR documentation test in private item fn bar() {} } diff --git a/src/test/rustdoc-ui/private-item-doc-test.stderr b/src/test/rustdoc-ui/private-item-doc-test.stderr index 20f3eb8b12025..8abbdb31ec91a 100644 --- a/src/test/rustdoc-ui/private-item-doc-test.stderr +++ b/src/test/rustdoc-ui/private-item-doc-test.stderr @@ -1,4 +1,4 @@ -error: Documentation test in private item +error: documentation test in private item --> $DIR/private-item-doc-test.rs:4:5 | LL | / /// private doc test diff --git a/src/test/ui/allocator/two-allocators.stderr b/src/test/ui/allocator/two-allocators.stderr index ed0aa13eb8078..35d9f0f42f001 100644 --- a/src/test/ui/allocator/two-allocators.stderr +++ b/src/test/ui/allocator/two-allocators.stderr @@ -1,14 +1,11 @@ error: cannot define multiple global allocators --> $DIR/two-allocators.rs:6:1 | -LL | static B: System = System; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the previous global allocator is defined here - --> $DIR/two-allocators.rs:4:1 - | LL | static A: System = System; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | -------------------------- previous global allocator is defined here +LL | #[global_allocator] +LL | static B: System = System; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr index d56b9f562c932..26de39101f211 100644 --- a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr +++ b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr @@ -10,15 +10,7 @@ LL | num2) => (), LL | Foo::Foo2(num) => (), | --- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/borrowck-move-error-with-note.rs:12:19 - | -LL | Foo::Foo1(num1, - | ^^^^ -LL | num2) => (), - | ^^^^ -LL | Foo::Foo2(num) => (), - | ^^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0509]: cannot move out of type `S`, which implements the `Drop` trait --> $DIR/borrowck-move-error-with-note.rs:28:11 @@ -31,13 +23,7 @@ LL | f: _s, LL | g: _t | -- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/borrowck-move-error-with-note.rs:31:16 - | -LL | f: _s, - | ^^ -LL | g: _t - | ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of `a.a` which is behind a shared reference --> $DIR/borrowck-move-error-with-note.rs:46:11 diff --git a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr index 9f0670c6bc72d..8fb4c062c0363 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr @@ -9,13 +9,7 @@ LL | &[Foo { string: a }, LL | Foo { string: b }] => { | - ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/borrowck-move-out-of-vec-tail.rs:21:33 - | -LL | &[Foo { string: a }, - | ^ -LL | Foo { string: b }] => { - | ^ + = note: move occurs because these variables have types that don't implement the `Copy` trait help: consider removing the `&` | LL | [Foo { string: a }, diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs index a215305f684dd..e274d105e0503 100644 --- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs +++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs @@ -75,12 +75,12 @@ fn e() { match vec { //~^ ERROR cannot move out //~| NOTE cannot move out + //~| NOTE move occurs because these variables have types &mut [_a, _b, _c] => {} //~^ NOTE data moved here //~| NOTE and here //~| NOTE and here //~| HELP consider removing the `&mut` - //~| NOTE move occurs because these variables have types _ => {} } let a = vec[0]; //~ ERROR cannot move out diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr index ad5e206a9a1be..a3324f25d0bb5 100644 --- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr +++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr @@ -97,11 +97,7 @@ LL | &mut [_a, _b, _c] => {} | | data moved here | help: consider removing the `&mut`: `[_a, _b, _c]` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/borrowck-vec-pattern-nesting.rs:78:15 - | -LL | &mut [_a, _b, _c] => {} - | ^^ ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:86:13 diff --git a/src/test/ui/if/ifmt-bad-arg.stderr b/src/test/ui/if/ifmt-bad-arg.stderr index 07917c2a540d5..c024094dd5610 100644 --- a/src/test/ui/if/ifmt-bad-arg.stderr +++ b/src/test/ui/if/ifmt-bad-arg.stderr @@ -138,13 +138,9 @@ error: duplicate argument named `foo` --> $DIR/ifmt-bad-arg.rs:40:33 | LL | format!("{foo}", foo=1, foo=2); - | ^ - | -note: previously here - --> $DIR/ifmt-bad-arg.rs:40:26 - | -LL | format!("{foo}", foo=1, foo=2); - | ^ + | - ^ duplicate argument + | | + | previously here error: positional arguments cannot follow named arguments --> $DIR/ifmt-bad-arg.rs:41:35 diff --git a/src/test/ui/issues/issue-12567.stderr b/src/test/ui/issues/issue-12567.stderr index 1de29dc8c6108..9d9a88f4f9b06 100644 --- a/src/test/ui/issues/issue-12567.stderr +++ b/src/test/ui/issues/issue-12567.stderr @@ -10,14 +10,7 @@ LL | => println!("one empty"), LL | (&[hd1, ..], &[hd2, ..]) | --- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/issue-12567.rs:8:17 - | -LL | (&[], &[hd, ..]) | (&[hd, ..], &[]) - | ^^ -LL | => println!("one empty"), -LL | (&[hd1, ..], &[hd2, ..]) - | ^^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0508]: cannot move out of type `[T]`, a non-copy slice --> $DIR/issue-12567.rs:4:11 @@ -31,14 +24,7 @@ LL | => println!("one empty"), LL | (&[hd1, ..], &[hd2, ..]) | --- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/issue-12567.rs:8:17 - | -LL | (&[], &[hd, ..]) | (&[hd, ..], &[]) - | ^^ -LL | => println!("one empty"), -LL | (&[hd1, ..], &[hd2, ..]) - | ^^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.stderr b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.stderr index e547ec7e4754c..d0a4097de6816 100644 --- a/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.stderr +++ b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.stderr @@ -7,11 +7,7 @@ LL | let (a, b) = x[0]; | | ...and here | data moved here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/issue-40402-2.rs:5:10 - | -LL | let (a, b) = x[0]; - | ^ ^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/label/label_break_value_continue.stderr b/src/test/ui/label/label_break_value_continue.stderr index b3c0b421023ac..c5f79ed6333ee 100644 --- a/src/test/ui/label/label_break_value_continue.stderr +++ b/src/test/ui/label/label_break_value_continue.stderr @@ -7,16 +7,11 @@ LL | continue; error[E0696]: `continue` pointing to a labeled block --> $DIR/label_break_value_continue.rs:14:9 | -LL | continue 'b; - | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d - | -note: labeled block the continue points to - --> $DIR/label_break_value_continue.rs:13:5 - | LL | / 'b: { LL | | continue 'b; + | | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d LL | | } - | |_____^ + | |_____- labeled block the `continue` points to error[E0695]: unlabeled `continue` inside of a labeled block --> $DIR/label_break_value_continue.rs:22:13 diff --git a/src/test/ui/macros/macro-multiple-matcher-bindings.stderr b/src/test/ui/macros/macro-multiple-matcher-bindings.stderr index 65362388d7de1..3ad1297ffb2f3 100644 --- a/src/test/ui/macros/macro-multiple-matcher-bindings.stderr +++ b/src/test/ui/macros/macro-multiple-matcher-bindings.stderr @@ -2,49 +2,33 @@ error: duplicate matcher binding --> $DIR/macro-multiple-matcher-bindings.rs:7:16 | LL | ($a:ident, $a:ident) => {}; - | ^^^^^^^^ - | -note: previous declaration was here - --> $DIR/macro-multiple-matcher-bindings.rs:7:6 - | -LL | ($a:ident, $a:ident) => {}; - | ^^^^^^^^ + | -------- ^^^^^^^^ duplicate binding + | | + | previous binding error: duplicate matcher binding --> $DIR/macro-multiple-matcher-bindings.rs:8:16 | LL | ($a:ident, $a:path) => {}; - | ^^^^^^^ - | -note: previous declaration was here - --> $DIR/macro-multiple-matcher-bindings.rs:8:6 - | -LL | ($a:ident, $a:path) => {}; - | ^^^^^^^^ + | -------- ^^^^^^^ duplicate binding + | | + | previous binding error: duplicate matcher binding --> $DIR/macro-multiple-matcher-bindings.rs:17:18 | LL | ($a:ident, $($a:ident),*) => {}; - | ^^^^^^^^ - | -note: previous declaration was here - --> $DIR/macro-multiple-matcher-bindings.rs:17:6 - | -LL | ($a:ident, $($a:ident),*) => {}; - | ^^^^^^^^ + | -------- ^^^^^^^^ duplicate binding + | | + | previous binding error: duplicate matcher binding --> $DIR/macro-multiple-matcher-bindings.rs:18:25 | LL | ($($a:ident)+ # $($($a:path),+);*) => {}; - | ^^^^^^^ - | -note: previous declaration was here - --> $DIR/macro-multiple-matcher-bindings.rs:18:8 - | -LL | ($($a:ident)+ # $($($a:path),+);*) => {}; - | ^^^^^^^^ + | -------- ^^^^^^^ duplicate binding + | | + | previous binding error: aborting due to 4 previous errors diff --git a/src/test/ui/macros/macro-reexport-removed.stderr b/src/test/ui/macros/macro-reexport-removed.stderr index 4bec70850aff7..475a586ddc083 100644 --- a/src/test/ui/macros/macro-reexport-removed.stderr +++ b/src/test/ui/macros/macro-reexport-removed.stderr @@ -2,13 +2,9 @@ error[E0557]: feature has been removed --> $DIR/macro-reexport-removed.rs:3:12 | LL | #![feature(macro_reexport)] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ feature has been removed | -note: subsumed by `pub use` - --> $DIR/macro-reexport-removed.rs:3:12 - | -LL | #![feature(macro_reexport)] - | ^^^^^^^^^^^^^^ + = note: subsumed by `pub use` error: cannot find attribute `macro_reexport` in this scope --> $DIR/macro-reexport-removed.rs:5:3 diff --git a/src/test/ui/nll/move-errors.stderr b/src/test/ui/nll/move-errors.stderr index 7139617a97a4f..d4a0e45648c25 100644 --- a/src/test/ui/nll/move-errors.stderr +++ b/src/test/ui/nll/move-errors.stderr @@ -83,13 +83,7 @@ LL | B::U(d) => (), LL | B::V(s) => (), | - ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/move-errors.rs:76:14 - | -LL | B::U(d) => (), - | ^ -LL | B::V(s) => (), - | ^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0509]: cannot move out of type `D`, which implements the `Drop` trait --> $DIR/move-errors.rs:83:11 @@ -138,11 +132,7 @@ LL | F(s, mut t) => (), | | | data moved here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/move-errors.rs:104:11 - | -LL | F(s, mut t) => (), - | ^ ^^^^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of `x.0` which is behind a shared reference --> $DIR/move-errors.rs:110:11 diff --git a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr index c0b7a5a5b6250..1f1211aa198f8 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr @@ -8,11 +8,7 @@ LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); | | data moved here | help: consider removing the `&`: `(X(_t), X(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:39:13 - | -LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/duplicate-suggestions.rs:43:50 @@ -24,11 +20,7 @@ LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { | | data moved here | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:43:26 - | -LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/duplicate-suggestions.rs:47:53 @@ -40,11 +32,7 @@ LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) | | data moved here | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:47:29 - | -LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/duplicate-suggestions.rs:51:11 @@ -60,14 +48,7 @@ LL | &(Either::One(_t), Either::Two(_u)) => (), LL | &(Either::Two(_t), Either::One(_u)) => (), | -- ...and here -- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:53:23 - | -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ -... -LL | &(Either::Two(_t), Either::One(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait help: consider removing the `&` | LL | (Either::One(_t), Either::Two(_u)) => (), @@ -90,11 +71,7 @@ LL | &(Either::One(_t), Either::Two(_u)) | | data moved here | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:63:23 - | -LL | &(Either::One(_t), Either::Two(_u)) - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/duplicate-suggestions.rs:70:11 @@ -109,11 +86,7 @@ LL | &(Either::One(_t), Either::Two(_u)) => (), | | data moved here | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:72:23 - | -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/duplicate-suggestions.rs:78:11 @@ -128,11 +101,7 @@ LL | &(Either::One(_t), Either::Two(_u)) => (), | | data moved here | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:80:23 - | -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:91:31 @@ -144,11 +113,7 @@ LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); | | data moved here | help: consider removing the `&mut`: `(X(_t), X(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:91:17 - | -LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:95:54 @@ -160,11 +125,7 @@ LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.c | | data moved here | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:95:30 - | -LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:99:57 @@ -176,11 +137,7 @@ LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), e | | data moved here | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:99:33 - | -LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:103:11 @@ -196,14 +153,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), LL | &mut (Either::Two(_t), Either::One(_u)) => (), | -- ...and here -- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:105:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ -... -LL | &mut (Either::Two(_t), Either::One(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait help: consider removing the `&mut` | LL | (Either::One(_t), Either::Two(_u)) => (), @@ -226,11 +176,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) | | data moved here | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:115:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:122:11 @@ -245,11 +191,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), | | data moved here | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:124:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:130:11 @@ -264,11 +206,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), | | data moved here | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:132:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:138:11 @@ -283,11 +221,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), | | data moved here | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:140:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/duplicate-suggestions.rs:86:11 @@ -299,11 +233,7 @@ LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } | | data moved here | help: consider removing the `&`: `(X(_t), X(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:86:15 - | -LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a mutable reference --> $DIR/duplicate-suggestions.rs:146:11 @@ -315,11 +245,7 @@ LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } | | data moved here | help: consider removing the `&mut`: `(X(_t), X(_u))` | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:146:19 - | -LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } - | ^^ ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error: aborting due to 17 previous errors diff --git a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr index cb3ce5991aeee..ac91ac43736f9 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr @@ -337,14 +337,7 @@ LL | &mut Either::One(_t) => (), LL | &mut Either::Two(_t) => (), | -- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/simple.rs:221:26 - | -LL | &mut Either::One(_t) => (), - | ^^ -... -LL | &mut Either::Two(_t) => (), - | ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait help: consider removing the `&mut` | LL | Either::One(_t) => (), @@ -470,13 +463,7 @@ LL | (&mut Either::One(_t),) => (), LL | (&mut Either::Two(_t),) => (), | -- ...and here | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/simple.rs:280:27 - | -LL | (&mut Either::One(_t),) => (), - | ^^ -LL | (&mut Either::Two(_t),) => (), - | ^^ + = note: move occurs because these variables have types that don't implement the `Copy` trait error[E0507]: cannot move out of a shared reference --> $DIR/simple.rs:288:18 diff --git a/src/test/ui/type/type-mismatch-same-crate-name.rs b/src/test/ui/type/type-mismatch-same-crate-name.rs index b1f9a28e16d56..eeda5460ac36a 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.rs +++ b/src/test/ui/type/type-mismatch-same-crate-name.rs @@ -15,11 +15,11 @@ fn main() { extern crate crate_a1 as a; a::try_foo(foo2); //~^ ERROR mismatched types - //~| Perhaps two different versions of crate `crate_a1` + //~| perhaps two different versions of crate `crate_a1` //~| expected struct `main::a::Foo` a::try_bar(bar2); //~^ ERROR mismatched types - //~| Perhaps two different versions of crate `crate_a1` + //~| perhaps two different versions of crate `crate_a1` //~| expected trait `main::a::Bar` //~| expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>` //~| found struct `std::boxed::Box` diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr index 91bbe9c1fbe2a..be5406696b7de 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.stderr +++ b/src/test/ui/type/type-mismatch-same-crate-name.stderr @@ -4,11 +4,7 @@ error[E0308]: mismatched types LL | a::try_foo(foo2); | ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` | -note: Perhaps two different versions of crate `crate_a1` are being used? - --> $DIR/type-mismatch-same-crate-name.rs:16:20 - | -LL | a::try_foo(foo2); - | ^^^^ + = note: perhaps two different versions of crate `crate_a1` are being used? error[E0308]: mismatched types --> $DIR/type-mismatch-same-crate-name.rs:20:20 @@ -18,11 +14,7 @@ LL | a::try_bar(bar2); | = note: expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>` found struct `std::boxed::Box` -note: Perhaps two different versions of crate `crate_a1` are being used? - --> $DIR/type-mismatch-same-crate-name.rs:20:20 - | -LL | a::try_bar(bar2); - | ^^^^ + = note: perhaps two different versions of crate `crate_a1` are being used? error: aborting due to 2 previous errors