Skip to content

Commit ff71b80

Browse files
committed
Change compare mode to use -Zborrowck=mir
1 parent 0df1e57 commit ff71b80

File tree

197 files changed

+4503
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+4503
-10
lines changed

src/test/incremental/hashes/closure_expressions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ pub fn add_parameter() {
4949
// Change parameter pattern ----------------------------------------------------
5050
#[cfg(cfail1)]
5151
pub fn change_parameter_pattern() {
52-
let _ = |x: &u32| x;
52+
let _ = |x: (u32,)| x;
5353
}
5454

5555
#[cfg(not(cfail1))]
5656
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")]
5757
#[rustc_clean(cfg="cfail3")]
5858
pub fn change_parameter_pattern() {
59-
let _ = |&x: &u32| x;
59+
let _ = |(x,): (u32,)| x;
6060
}
6161

6262

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:29
3+
|
4+
LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
...
9+
LL | let z: I::A = if cond { x } else { y };
10+
| ^ assignment requires that `'a` must outlive `'b`
11+
12+
error: lifetime may not live long enough
13+
--> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:40
14+
|
15+
LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
16+
| -- -- lifetime `'b` defined here
17+
| |
18+
| lifetime `'a` defined here
19+
...
20+
LL | let z: I::A = if cond { x } else { y };
21+
| ^ assignment requires that `'b` must outlive `'a`
22+
23+
error: aborting due to 2 previous errors
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/associated-types-subtyping-1.rs:24:12
3+
|
4+
LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
...
9+
LL | let a: <T as Trait<'a>>::Type = make_any();
10+
| ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
11+
12+
error: lifetime may not live long enough
13+
--> $DIR/associated-types-subtyping-1.rs:35:13
14+
|
15+
LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
16+
| -- -- lifetime `'b` defined here
17+
| |
18+
| lifetime `'a` defined here
19+
...
20+
LL | let _c: <T as Trait<'a>>::Type = b;
21+
| ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
22+
23+
error: aborting due to 2 previous errors
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/project-fn-ret-contravariant.rs:45:4
3+
|
4+
LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
...
9+
LL | (a, b)
10+
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
11+
12+
error: lifetime may not live long enough
13+
--> $DIR/project-fn-ret-contravariant.rs:45:4
14+
|
15+
LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
16+
| -- -- lifetime `'b` defined here
17+
| |
18+
| lifetime `'a` defined here
19+
...
20+
LL | (a, b)
21+
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
22+
23+
error: aborting due to 2 previous errors
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/project-fn-ret-contravariant.rs:38:4
3+
|
4+
LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
5+
| -- lifetime `'a` defined here
6+
LL | bar(foo, x)
7+
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
8+
9+
error: aborting due to previous error
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/project-fn-ret-invariant.rs:55:4
3+
|
4+
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
...
9+
LL | (a, b)
10+
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
11+
12+
error: lifetime may not live long enough
13+
--> $DIR/project-fn-ret-invariant.rs:55:4
14+
|
15+
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
16+
| -- -- lifetime `'b` defined here
17+
| |
18+
| lifetime `'a` defined here
19+
...
20+
LL | (a, b)
21+
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
22+
23+
error: aborting due to 2 previous errors
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/project-fn-ret-invariant.rs:38:12
3+
|
4+
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
9+
LL | let a = bar(f, x);
10+
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
11+
12+
error: lifetime may not live long enough
13+
--> $DIR/project-fn-ret-invariant.rs:39:12
14+
|
15+
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
16+
| -- -- lifetime `'b` defined here
17+
| |
18+
| lifetime `'a` defined here
19+
...
20+
LL | let b = bar(f, y);
21+
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
22+
23+
error: aborting due to 2 previous errors
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/project-fn-ret-invariant.rs:48:4
3+
|
4+
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
5+
| -- lifetime `'a` defined here
6+
...
7+
LL | bar(foo, x)
8+
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
9+
10+
error: aborting due to previous error
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
error[E0503]: cannot use `y` because it was mutably borrowed
2+
--> $DIR/borrowck-anon-fields-variant.rs:17:7
3+
|
4+
LL | Foo::Y(ref mut a, _) => a,
5+
| --------- borrow of `y.0` occurs here
6+
...
7+
LL | Foo::Y(_, ref mut b) => b,
8+
| ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
9+
...
10+
LL | *a += 1;
11+
| ------- borrow later used here
12+
13+
error[E0503]: cannot use `y` because it was mutably borrowed
14+
--> $DIR/borrowck-anon-fields-variant.rs:37:7
15+
|
16+
LL | Foo::Y(ref mut a, _) => a,
17+
| --------- borrow of `y.0` occurs here
18+
...
19+
LL | Foo::Y(ref mut b, _) => b,
20+
| ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
21+
...
22+
LL | *a += 1;
23+
| ------- borrow later used here
24+
25+
error[E0499]: cannot borrow `y.0` as mutable more than once at a time
26+
--> $DIR/borrowck-anon-fields-variant.rs:37:14
27+
|
28+
LL | Foo::Y(ref mut a, _) => a,
29+
| --------- first mutable borrow occurs here
30+
...
31+
LL | Foo::Y(ref mut b, _) => b,
32+
| ^^^^^^^^^ second mutable borrow occurs here
33+
...
34+
LL | *a += 1;
35+
| ------- first borrow later used here
36+
37+
error: aborting due to 3 previous errors
38+
39+
Some errors have detailed explanations: E0499, E0503.
40+
For more information about an error, try `rustc --explain E0499`.

0 commit comments

Comments
 (0)