]> git.lizzy.rs Git - rust.git/commitdiff
Change error code number
authorEsteban Küber <esteban@kuber.com.ar>
Mon, 20 Jul 2020 20:56:50 +0000 (13:56 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Wed, 22 Jul 2020 20:12:34 +0000 (13:12 -0700)
src/librustc_error_codes/error_codes.rs
src/librustc_infer/infer/error_reporting/nice_region_error/static_impl_trait.rs
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.fixed
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr

index 7c762a3415e13d3f0aa677c6ee22d11f1d253fb1..72302962d8603a240718f9ae4dea124d34a5eab0 100644 (file)
     E0755, // `#[ffi_pure]` is only allowed on foreign functions
     E0756, // `#[ffi_const]` is only allowed on foreign functions
     E0757, // `#[ffi_const]` functions cannot be `#[ffi_pure]`
-    E0767, // `'static' obligation coming from `impl dyn Trait {}` or `impl Foo for dyn Bar {}`.
+    E0772, // `'static' obligation coming from `impl dyn Trait {}` or `impl Foo for dyn Bar {}`.
 }
index 9581ee611fce89e9c935e64513aa292fd324dbc6..4fa6d9d2394242cb56b69ad0ad19f5b3e4b4e745 100644 (file)
@@ -48,7 +48,7 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option<ErrorReported> {
                     let mut err = struct_span_err!(
                         tcx.sess,
                         cause.span,
-                        E0767,
+                        E0772,
                         "{} has {} but calling `{}` introduces an implicit `'static` lifetime \
                          requirement",
                         param
@@ -196,7 +196,7 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option<ErrorReported> {
         }
         if let (Some(ident), true) = (override_error_code, fn_returns.is_empty()) {
             // Provide a more targetted error code and description.
-            err.code(rustc_errors::error_code!(E0767));
+            err.code(rustc_errors::error_code!(E0772));
             err.set_primary_message(&format!(
                 "{} has {} but calling `{}` introduces an implicit `'static` lifetime \
                 requirement",
index 6921926590a69c33380d50d1573b9ce2cc4ccfbf..acf0c0ece402010799a0af429648e19f0d4f98a4 100644 (file)
@@ -1,5 +1,5 @@
 error[E0597]: `val` does not live long enough
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:22:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:21:9
    |
 LL |     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> {
    |               -- lifetime `'a` defined here                  ------------------- opaque type requires that `val` is borrowed for `'a`
@@ -14,7 +14,7 @@ LL |     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrai
    |                                                                                  ^^^^
 
 error[E0515]: cannot return value referencing function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:44:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
    |
 LL |         val.use_self()
    |         ---^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL |         val.use_self()
    |         `val` is borrowed here
 
 error[E0515]: cannot return value referencing function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:110:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:109:9
    |
 LL |         val.use_self()
    |         ---^^^^^^^^^^^
index ae6ffa8d93e01db2fb6a0491f8d6fdbe27c22f8f..b2dc16a27e310006490f28118a9781421bc3b9d4 100644 (file)
@@ -1,4 +1,3 @@
-
 // FIXME: the following cases need to suggest more things to make users reach a working end state.
 
 mod bav {
@@ -64,7 +63,7 @@ fn use_self(&self) -> &() { panic!() }
     impl Bar for i32 {}
 
     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32> + 'a>) -> &'a () {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
index 2fab02fd1be45f520fa2e015f07e350b70543a8a..00971b41c7ce652e5b2bffc185aab7278d7324df 100644 (file)
@@ -1,5 +1,5 @@
 error[E0597]: `val` does not live long enough
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:22:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:21:9
    |
 LL |     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> {
    |               -- lifetime `'a` defined here                  ------------------- opaque type requires that `val` is borrowed for `'a`
@@ -14,7 +14,7 @@ LL |     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrai
    |                                                                                  ^^^^
 
 error[E0515]: cannot return value referencing function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:44:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
    |
 LL |         val.use_self()
    |         ---^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL |         val.use_self()
    |         `val` is borrowed here
 
 error[E0515]: cannot return value referencing function parameter `val`
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:110:9
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:109:9
    |
 LL |         val.use_self()
    |         ---^^^^^^^^^^^
@@ -31,8 +31,8 @@ LL |         val.use_self()
    |         returns a value referencing data owned by the current function
    |         `val` is borrowed here
 
-error[E0767]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:67:13
+error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:66:13
    |
 LL |     fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32> + 'a>) -> &'a () {
    |                        -------------------------------------- this data with lifetime `'a`...
@@ -40,7 +40,7 @@ LL |         val.use_self()
    |             ^^^^^^^^ ...is captured and required to live as long as `'static` here
    |
 note: the used `impl` has a `'static` requirement
-  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:61:30
+  --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:60:30
    |
 LL |     impl MyTrait for Box<dyn ObjectTrait<Assoc = i32>> {
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
index c568738d94b455bcec06b1fb071c80eafc3e10e6..3c10f85d9423a8997ad77f5b4e10006113d118ae 100644 (file)
@@ -34,7 +34,7 @@ mod bar {
     impl Irrelevant for dyn ObjectTrait {}
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
@@ -51,7 +51,7 @@ mod baz {
     impl Irrelevant for Box<dyn ObjectTrait> {}
 
     fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
@@ -66,7 +66,7 @@ mod bat {
     }
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
index 8dd1e5d78de0983a322b4e9fc4a8e61e15d7a28c..88ab03dfc1ef1837d584cc9ffadbb40b4bf584a9 100644 (file)
@@ -34,7 +34,7 @@ fn use_self(&self) -> &() { panic!() }
     impl Irrelevant for dyn ObjectTrait {}
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
@@ -51,7 +51,7 @@ fn use_self(&self) -> &() { panic!() }
     impl Irrelevant for Box<dyn ObjectTrait> {}
 
     fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
@@ -66,7 +66,7 @@ fn use_self(&self) -> &() { panic!() }
     }
 
     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
-        val.use_self() //~ ERROR E0767
+        val.use_self() //~ ERROR E0772
     }
 }
 
index 7e814fc664625ee0dc8b3feeb89358584b54d425..2fb6c25fd17028a417650e3419660658a11fa900 100644 (file)
@@ -18,7 +18,7 @@ help: consider relaxing the implicit `'static` requirement
 LL |     impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
    |                                               ^^^^
 
-error[E0767]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
+error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
   --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:13
    |
 LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
@@ -89,7 +89,7 @@ help: consider relaxing the implicit `'static` requirement
 LL |     impl MyTrait for dyn ObjectTrait + '_ {}
    |                                      ^^^^
 
-error[E0767]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
+error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
   --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:37:13
    |
 LL |     fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
@@ -109,7 +109,7 @@ help: consider relaxing the implicit `'static` requirement
 LL |     impl MyTrait for dyn ObjectTrait + '_ {
    |                                      ^^^^
 
-error[E0767]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
+error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
   --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:54:13
    |
 LL |     fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {