]> git.lizzy.rs Git - rust.git/commitdiff
Normalise diagnostics with respect to "the X is declared/defined here"
authorvarkor <github@varkor.com>
Wed, 22 Jan 2020 01:41:44 +0000 (01:41 +0000)
committervarkor <github@varkor.com>
Fri, 24 Jan 2020 16:24:49 +0000 (16:24 +0000)
src/librustc_metadata/creader.rs
src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
src/librustc_mir/borrow_check/diagnostics/region_errors.rs
src/test/ui/allocator/two-allocators.stderr
src/test/ui/borrowck/issue-45983.nll.stderr
src/test/ui/generator/ref-escapes-but-not-over-yield.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
src/test/ui/nll/outlives-suggestion-simple.stderr

index 351e72d4678f2bed27deb2fd0a9f138012e72a5a..4c4383aa603cb075444c4e14a3888c7b652c91a5 100644 (file)
@@ -694,7 +694,7 @@ fn inject_allocator_crate(&mut self, krate: &ast::Crate) {
                 self.sess
                     .struct_span_err(*span2, "cannot define multiple global allocators")
                     .span_label(*span2, "cannot define a new global allocator")
-                    .span_label(*span1, "previous global allocator is defined here")
+                    .span_label(*span1, "previous global allocator defined here")
                     .emit();
                 true
             }
index 08333ae423da727a3bbce26beec5abf39ed705ea..89fe1883e629b6a68c9cb508494eb1f547bfcf20 100644 (file)
@@ -1259,7 +1259,7 @@ fn report_escaping_data(
 
         err.span_label(
             upvar_span,
-            format!("`{}` is declared here, outside of the {} body", upvar_name, escapes_from),
+            format!("`{}` declared here, outside of the {} body", upvar_name, escapes_from),
         );
 
         err.span_label(borrow_span, format!("borrow is only valid in the {} body", escapes_from));
index b999dfa3031035f83157f12b37fd2e0a1ea4c2f3..0e040ec7827e16573d21d3be3260ce8d73830c8c 100644 (file)
@@ -457,7 +457,7 @@ fn report_escaping_data_error(&self, errci: &ErrorConstraintInfo) -> DiagnosticB
             diag.span_label(
                 outlived_fr_span,
                 format!(
-                    "`{}` is declared here, outside of the {} body",
+                    "`{}` declared here, outside of the {} body",
                     outlived_fr_name, escapes_from
                 ),
             );
index 35d9f0f42f00164fcbdd7f30fd4bcb5f6425687d..da636a5a567f358f7b99a26b169f5dba2a77cb8f 100644 (file)
@@ -2,7 +2,7 @@ error: cannot define multiple global allocators
   --> $DIR/two-allocators.rs:6:1
    |
 LL | static A: System = System;
-   | -------------------------- previous global allocator is defined here
+   | -------------------------- previous global allocator defined here
 LL | #[global_allocator]
 LL | static B: System = System;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator
index 49d6c2473f6a3fdb97247a18073de9d837b350ef..51bb4dee6762a3a688d9b01548d77969d6bf0d94 100644 (file)
@@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of closure
   --> $DIR/issue-45983.rs:20:18
    |
 LL |     let x = None;
-   |         - `x` is declared here, outside of the closure body
+   |         - `x` declared here, outside of the closure body
 LL |     give_any(|y| x = Some(y));
    |               -  ^^^^^^^^^^^ `y` escapes the closure body here
    |               |
index de533e4d5ff7b32304e597c2d7b2788f0787918c..9986220218e28c673642b09348f5f282464f9e74 100644 (file)
@@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of generator
   --> $DIR/ref-escapes-but-not-over-yield.rs:11:9
    |
 LL |     let mut a = &3;
-   |         ----- `a` is declared here, outside of the generator body
+   |         ----- `a` declared here, outside of the generator body
 ...
 LL |         a = &b;
    |         ^^^^--
index 708e50de570dbc86f283446cda5c4eb4032976bd..f5723ba5da5ba4397bae8cc4c93cefaee36c5839 100644 (file)
@@ -19,7 +19,7 @@ error[E0521]: borrowed data escapes outside of closure
 LL |     foo(cell, |cell_a, cell_x| {
    |                ------  ------ `cell_x` is a reference that is only valid in the closure body
    |                |
-   |                `cell_a` is declared here, outside of the closure body
+   |                `cell_a` declared here, outside of the closure body
 LL |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
 
index f7603e29d488c701fd9f05f33fcc0e79c81091b2..db7f57ceccf134342a5ed88b5379afbb22a7f531 100644 (file)
@@ -99,7 +99,7 @@ error[E0521]: borrowed data escapes outside of function
 LL |     fn get_bar(&self) -> Bar2 {
    |                -----
    |                |
-   |                `self` is declared here, outside of the function body
+   |                `self` declared here, outside of the function body
    |                `self` is a reference that is only valid in the function body
 LL |         Bar2::new(&self)
    |         ^^^^^^^^^^^^^^^^ `self` escapes the function body here