]> git.lizzy.rs Git - rust.git/commitdiff
Extend support to `get_generics` for all `NodeItem`s
authorEsteban Küber <esteban@kuber.com.ar>
Wed, 27 Jun 2018 23:44:39 +0000 (16:44 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Thu, 28 Jun 2018 18:12:43 +0000 (11:12 -0700)
src/librustc/hir/map/mod.rs
src/test/ui/associated-const-impl-wrong-lifetime.stderr
src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr
src/test/ui/error-codes/E0478.stderr
src/test/ui/issue-27942.stderr
src/test/ui/issue-37884.stderr
src/test/ui/nll/issue-47470.stderr
src/test/ui/nll/trait-associated-constant.stderr
src/test/ui/region-borrow-params-issue-29793-small.nll.stderr
src/test/ui/static-lifetime.stderr

index 33cae96dd07a266c93678033415e16d2461e3f81..dbf99cf30e56b58416bf35013139b77d27f3011b 100644 (file)
@@ -671,7 +671,14 @@ pub fn get_generics(&self, id: DefId) -> Option<&'hir Generics> {
                 NodeTraitItem(ref trait_item) => Some(&trait_item.generics),
                 NodeItem(ref item) => {
                     match item.node {
-                        ItemFn(_, _, ref generics, _) => Some(generics),
+                        ItemFn(_, _, ref generics, _) |
+                        ItemTy(_, ref generics) |
+                        ItemEnum(_, ref generics) |
+                        ItemStruct(_, ref generics) |
+                        ItemUnion(_, ref generics) |
+                        ItemTrait(_, _, ref generics, ..) |
+                        ItemTraitAlias(ref generics, _) |
+                        ItemImpl(_, _, _, ref generics, ..) => Some(generics),
                         _ => None,
                     }
                 }
index d800f4c727d704eeb4195928dc0582b471b2aea3..f8375899e3e01cbee946b13024a6d3aca1d99095 100644 (file)
@@ -6,11 +6,11 @@ LL |     const NAME: &'a str = "unit";
    |
    = note: expected type `&'static str`
               found type `&'a str`
-note: the lifetime 'a as defined on the impl at 17:1...
-  --> $DIR/associated-const-impl-wrong-lifetime.rs:17:1
+note: the lifetime 'a as defined on the impl at 17:6...
+  --> $DIR/associated-const-impl-wrong-lifetime.rs:17:6
    |
 LL | impl<'a> Foo for &'a () {
-   | ^^^^^^^^^^^^^^^^^^^^^^^
+   |      ^^
    = note: ...does not necessarily outlive the static lifetime
 
 error: aborting due to previous error
index deab39b99246c7ff72af890eff6b263060bbb26c..86dad34586d687899ee2e475220a65db41bdf11b 100644 (file)
@@ -55,7 +55,7 @@ LL |     fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0195]: lifetime parameters or bounds on method `wrong_bound2` do not match the trait declaration
-  --> $DIR/regions-bound-missing-bound-in-impl.rs:51:5
+  --> $DIR/regions-bound-missing-bound-in-impl.rs:52:5
    |
 LL |     fn wrong_bound2<'b,'c,'d:'a+'b>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>);
    |                    ---------------- lifetimes in impl do not match this method in trait
@@ -64,7 +64,7 @@ LL |     fn wrong_bound2(self, b: Inv, c: Inv, d: Inv) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait
 
 error[E0276]: impl has stricter requirements than trait
-  --> $DIR/regions-bound-missing-bound-in-impl.rs:58:5
+  --> $DIR/regions-bound-missing-bound-in-impl.rs:59:5
    |
 LL |     fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
    |     ------------------------------------------------------- definition of `another_bound` from trait
index 44d8151303f7247efe891ec9518fcb01fe8e87ae..0e778908058e02609438cbd38b0dbf0b63e83953 100644 (file)
@@ -4,16 +4,16 @@ error[E0478]: lifetime bound not satisfied
 LL |     child: Box<Wedding<'kiss> + 'SnowWhite>, //~ ERROR E0478
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: lifetime parameter instantiated with the lifetime 'SnowWhite as defined on the struct at 13:1
-  --> $DIR/E0478.rs:13:1
+note: lifetime parameter instantiated with the lifetime 'SnowWhite as defined on the struct at 13:22
+  --> $DIR/E0478.rs:13:22
    |
 LL | struct Prince<'kiss, 'SnowWhite> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: but lifetime parameter must outlive the lifetime 'kiss as defined on the struct at 13:1
-  --> $DIR/E0478.rs:13:1
+   |                      ^^^^^^^^^^
+note: but lifetime parameter must outlive the lifetime 'kiss as defined on the struct at 13:15
+  --> $DIR/E0478.rs:13:15
    |
 LL | struct Prince<'kiss, 'SnowWhite> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |               ^^^^^
 
 error: aborting due to previous error
 
index 879eda0f8564005e10b8e91995bd57f74f26794b..5e2ecbb05aebc98e404888458cd7a23b37c83449 100644 (file)
@@ -11,11 +11,11 @@ note: the anonymous lifetime #1 defined on the method body at 15:5...
    |
 LL |     fn select(&self) -> BufferViewHandle<R>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...does not necessarily outlive the lifetime 'a as defined on the trait at 13:1
-  --> $DIR/issue-27942.rs:13:1
+note: ...does not necessarily outlive the lifetime 'a as defined on the trait at 13:18
+  --> $DIR/issue-27942.rs:13:18
    |
 LL | pub trait Buffer<'a, R: Resources<'a>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                  ^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-27942.rs:15:5
@@ -25,11 +25,11 @@ LL |     fn select(&self) -> BufferViewHandle<R>;
    |
    = note: expected type `Resources<'_>`
               found type `Resources<'a>`
-note: the lifetime 'a as defined on the trait at 13:1...
-  --> $DIR/issue-27942.rs:13:1
+note: the lifetime 'a as defined on the trait at 13:18...
+  --> $DIR/issue-27942.rs:13:18
    |
 LL | pub trait Buffer<'a, R: Resources<'a>> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                  ^^
 note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 15:5
   --> $DIR/issue-27942.rs:15:5
    |
index 73fbb2d3203880868ff0892f57ab51026e7e0668..f01b623aced4225404b32e96dda2e3ef699eaa4a 100644 (file)
@@ -21,11 +21,11 @@ LL | |     {
 LL | |         Some(&mut self.0)
 LL | |     }
    | |_____^
-note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:1
-  --> $DIR/issue-37884.rs:13:1
+note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:6
+  --> $DIR/issue-37884.rs:13:6
    |
 LL | impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |      ^^
 
 error: aborting due to previous error
 
index f84a68d85b95f193c2ad6c5b718eb5257b407451..a89e186540a47c74f1f9abf056528e9be4c8352d 100644 (file)
@@ -6,11 +6,11 @@ LL |         &local //~ ERROR `local` does not live long enough
 LL |     }
    |     - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the impl at 23:1...
-  --> $DIR/issue-47470.rs:23:1
+note: borrowed value must be valid for the lifetime 'a as defined on the impl at 23:6...
+  --> $DIR/issue-47470.rs:23:6
    |
 LL | impl<'a> Bar for Foo<'a> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
+   |      ^^
 
 error: aborting due to previous error
 
index 2c3fd091f9a0d1370f0cbbdcf91d74a0b93a7cff..07972ecced313abf7e46f70b5f49e60bf7c8a408 100644 (file)
@@ -6,16 +6,16 @@ LL |     const AC: Option<&'c str> = None;
    |
    = note: expected type `std::option::Option<&'b str>`
               found type `std::option::Option<&'c str>`
-note: the lifetime 'c as defined on the impl at 30:1...
-  --> $DIR/trait-associated-constant.rs:30:1
+note: the lifetime 'c as defined on the impl at 30:18...
+  --> $DIR/trait-associated-constant.rs:30:18
    |
 LL | impl<'a: 'b, 'b, 'c> Anything<'a, 'b> for FailStruct1 {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 30:1
-  --> $DIR/trait-associated-constant.rs:30:1
+   |                  ^^
+note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 30:14
+  --> $DIR/trait-associated-constant.rs:30:14
    |
 LL | impl<'a: 'b, 'b, 'c> Anything<'a, 'b> for FailStruct1 {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0308]: mismatched types
   --> $DIR/trait-associated-constant.rs:38:5
@@ -25,16 +25,16 @@ LL |     const AC: Option<&'a str> = None;
    |
    = note: expected type `std::option::Option<&'b str>`
               found type `std::option::Option<&'a str>`
-note: the lifetime 'a as defined on the impl at 37:1...
-  --> $DIR/trait-associated-constant.rs:37:1
+note: the lifetime 'a as defined on the impl at 37:6...
+  --> $DIR/trait-associated-constant.rs:37:6
    |
 LL | impl<'a: 'b, 'b> Anything<'a, 'b> for FailStruct2 {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 37:1
-  --> $DIR/trait-associated-constant.rs:37:1
+   |      ^^
+note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 37:14
+  --> $DIR/trait-associated-constant.rs:37:14
    |
 LL | impl<'a: 'b, 'b> Anything<'a, 'b> for FailStruct2 {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error: aborting due to 2 previous errors
 
index 1a53c033baa532cddb26dfccb7b05622eaa510cb..443af08e1cc7ccdfe3687fa5e14b271c6e38a7d5 100644 (file)
@@ -43,11 +43,11 @@ LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x
 LL |     };
    |     - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 64:5...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:64:5
+note: borrowed value must be valid for the lifetime 'a as defined on the function body at 64:10...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:64:10
    |
 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |          ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:65:17
@@ -58,11 +58,11 @@ LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x
 LL |     };
    |     - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 64:5...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:64:5
+note: borrowed value must be valid for the lifetime 'a as defined on the function body at 64:10...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:64:10
    |
 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |          ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:76:17
@@ -73,11 +73,11 @@ LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x
 LL |     };
    |     - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 75:5...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:75:5
+note: borrowed value must be valid for the lifetime 'a as defined on the function body at 75:10...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:75:10
    |
 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |          ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:76:17
@@ -88,11 +88,11 @@ LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x
 LL |     };
    |     - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 75:5...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:75:5
+note: borrowed value must be valid for the lifetime 'a as defined on the function body at 75:10...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:75:10
    |
 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |          ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:100:21
@@ -103,11 +103,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 99:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:99:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 99:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:99:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:100:21
@@ -118,11 +118,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 99:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:99:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 99:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:99:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:114:21
@@ -133,11 +133,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 113:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:113:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 113:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:113:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:114:21
@@ -148,11 +148,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 113:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:113:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 113:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:113:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:142:21
@@ -163,11 +163,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 141:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:141:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 141:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:141:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:142:21
@@ -178,11 +178,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 141:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:141:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 141:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:141:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:157:21
@@ -193,11 +193,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 156:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:156:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 156:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:156:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:157:21
@@ -208,11 +208,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 156:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:156:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 156:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:156:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:185:21
@@ -223,11 +223,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 184:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:184:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 184:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:184:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:185:21
@@ -238,11 +238,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 184:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:184:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 184:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:184:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:199:21
@@ -253,11 +253,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 198:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:198:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 198:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:198:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/region-borrow-params-issue-29793-small.rs:199:21
@@ -268,11 +268,11 @@ LL |             let f = |t: bool| if t { x } else { y }; // (separate errors fo
 LL |         }
    |         - borrowed value only lives until here
    |
-note: borrowed value must be valid for the lifetime 'a as defined on the method body at 198:9...
-  --> $DIR/region-borrow-params-issue-29793-small.rs:198:9
+note: borrowed value must be valid for the lifetime 'a as defined on the method body at 198:14...
+  --> $DIR/region-borrow-params-issue-29793-small.rs:198:14
    |
 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              ^^
 
 error: aborting due to 20 previous errors
 
index 4fe4e569df9542ab4dc99beddcb04169b17dceb2..c38b8a96f9fc27f7379d9b9132a6918f5323e3c3 100644 (file)
@@ -4,11 +4,11 @@ error[E0478]: lifetime bound not satisfied
 LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {} //~ ERROR lifetime bound
    |                    ^^^^^^^^^
    |
-note: lifetime parameter instantiated with the lifetime 'a as defined on the impl at 13:1
-  --> $DIR/static-lifetime.rs:13:1
+note: lifetime parameter instantiated with the lifetime 'a as defined on the impl at 13:6
+  --> $DIR/static-lifetime.rs:13:6
    |
 LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {} //~ ERROR lifetime bound
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |      ^^
    = note: but lifetime parameter must outlive the static lifetime
 
 error: aborting due to previous error