Rollup merge of #64202 - alexreg:rush-pr-1, r=Centril

Fixed grammar/style in some error messages

Factored out from hacking on rustc for work on the REPL.

r? @Centril
This commit is contained in:
Mazdak Farrokhzad 2019-09-06 19:00:49 +02:00 committed by GitHub
commit afb6a7002d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
125 changed files with 381 additions and 380 deletions

View file

@ -20,7 +20,7 @@ pub fn main() {
let x: isize;
unsafe {
asm!("mov $1, $0" : "=r"(x) : "r"(x));
//~^ ERROR use of possibly uninitialized variable: `x`
//~^ ERROR use of possibly-uninitialized variable: `x`
}
foo(x);
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/asm-out-read-uninit.rs:22:43
|
LL | asm!("mov $1, $0" : "=r"(x) : "r"(x));
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -8,7 +8,7 @@ async fn no_non_guaranteed_initialization(x: usize) -> usize {
y = echo(10).await;
}
y
//~^ use of possibly uninitialized variable: `y`
//~^ use of possibly-uninitialized variable: `y`
}
async fn echo(x: usize) -> usize { x + 1 }

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `y`
error[E0381]: use of possibly-uninitialized variable: `y`
--> $DIR/no-non-guaranteed-initialization.rs:10:5
|
LL | y
| ^ use of possibly uninitialized `y`
| ^ use of possibly-uninitialized `y`
error: aborting due to previous error

View file

@ -11,7 +11,7 @@ async fn noop() {}
async fn test_tuple() {
let mut t: (i32, i32);
t.0 = 42;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
noop().await;
t.1 = 88;
let _ = t;
@ -20,7 +20,7 @@ async fn test_tuple() {
async fn test_tuple_struct() {
let mut t: T;
t.0 = 42;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
noop().await;
t.1 = 88;
let _ = t;
@ -29,7 +29,7 @@ async fn test_tuple_struct() {
async fn test_struct() {
let mut t: S;
t.x = 42;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
noop().await;
t.y = 88;
let _ = t;

View file

@ -1,20 +1,20 @@
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/partial-initialization-across-await.rs:13:5
|
LL | t.0 = 42;
| ^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/partial-initialization-across-await.rs:22:5
|
LL | t.0 = 42;
| ^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/partial-initialization-across-await.rs:31:5
|
LL | t.x = 42;
| ^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^ use of possibly-uninitialized `t`
error: aborting due to 3 previous errors

View file

@ -1,14 +1,14 @@
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/assign_mutable_fields.rs:9:5
|
LL | x.0 = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/assign_mutable_fields.rs:17:5
|
LL | x.0 = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error: aborting due to 2 previous errors

View file

@ -2,5 +2,5 @@ fn main() {
let i: isize;
println!("{}", false && { i = 5; true });
println!("{}", i); //~ ERROR borrow of possibly uninitialized variable: `i`
println!("{}", i); //~ ERROR borrow of possibly-uninitialized variable: `i`
}

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `i`
error[E0381]: borrow of possibly-uninitialized variable: `i`
--> $DIR/borrowck-and-init.rs:5:20
|
LL | println!("{}", i);
| ^ use of possibly uninitialized `i`
| ^ use of possibly-uninitialized `i`
error: aborting due to previous error

View file

@ -57,7 +57,7 @@ mod test_cases {
fn indirect_is_not_init() {
let x: i32;
unsafe {
asm!("nop" : "=*r"(x)); //~ ERROR use of possibly uninitialized variable
asm!("nop" : "=*r"(x)); //~ ERROR use of possibly-uninitialized variable
}
}

View file

@ -46,11 +46,11 @@ LL | unsafe {
LL | asm!("nop" : "+r"(x));
| ^ cannot assign twice to immutable variable
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-asm.rs:60:32
|
LL | asm!("nop" : "=*r"(x));
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/borrowck-asm.rs:68:31

View file

@ -1,7 +1,7 @@
fn force<F>(f: F) where F: FnOnce() { f(); }
fn main() {
let x: isize;
force(|| { //~ ERROR borrow of possibly uninitialized variable: `x`
force(|| { //~ ERROR borrow of possibly-uninitialized variable: `x`
println!("{}", x);
});
}

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-block-unint.rs:4:11
|
LL | force(|| {
| ^^ use of possibly uninitialized `x`
| ^^ use of possibly-uninitialized `x`
LL | println!("{}", x);
| - borrow occurs due to use in closure

View file

@ -6,7 +6,7 @@ fn foo() -> isize {
x = 0;
}
println!("{}", x); //~ ERROR borrow of possibly uninitialized variable: `x`
println!("{}", x); //~ ERROR borrow of possibly-uninitialized variable: `x`
return 17;
}

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-break-uninit-2.rs:9:20
|
LL | println!("{}", x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -6,7 +6,7 @@ fn foo() -> isize {
x = 0;
}
println!("{}", x); //~ ERROR borrow of possibly uninitialized variable: `x`
println!("{}", x); //~ ERROR borrow of possibly-uninitialized variable: `x`
return 17;
}

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-break-uninit.rs:9:20
|
LL | println!("{}", x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -78,20 +78,20 @@ fn fu_move_after_fu_move() {
fn copy_after_field_assign_after_uninit() {
let mut x: A;
x.a = 1; //~ ERROR assign to part of possibly uninitialized variable: `x`
x.a = 1; //~ ERROR assign to part of possibly-uninitialized variable: `x`
drop(x.a);
}
fn borrow_after_field_assign_after_uninit() {
let mut x: A;
x.a = 1; //~ ERROR assign to part of possibly uninitialized variable: `x`
x.a = 1; //~ ERROR assign to part of possibly-uninitialized variable: `x`
let p = &x.a;
drop(*p);
}
fn move_after_field_assign_after_uninit() {
let mut x: A;
x.b = box 1; //~ ERROR assign to part of possibly uninitialized variable: `x`
x.b = box 1; //~ ERROR assign to part of possibly-uninitialized variable: `x`
drop(x.b);
}

View file

@ -108,23 +108,23 @@ LL | let _z = A { a: 4, .. x };
|
= note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/borrowck-field-sensitivity.rs:81:5
|
LL | x.a = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/borrowck-field-sensitivity.rs:87:5
|
LL | x.a = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/borrowck-field-sensitivity.rs:94:5
|
LL | x.b = box 1;
| ^^^ use of possibly uninitialized `x`
| ^^^ use of possibly-uninitialized `x`
error: aborting due to 14 previous errors

View file

@ -2,5 +2,5 @@ fn foo(x: isize) { println!("{}", x); }
fn main() {
let x: isize; if 1 > 2 { x = 10; }
foo(x); //~ ERROR use of possibly uninitialized variable: `x`
foo(x); //~ ERROR use of possibly-uninitialized variable: `x`
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-if-no-else.rs:5:9
|
LL | foo(x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -7,5 +7,5 @@ fn main() {
} else {
x = 10;
}
foo(x); //~ ERROR use of possibly uninitialized variable: `x`
foo(x); //~ ERROR use of possibly-uninitialized variable: `x`
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-if-with-else.rs:10:9
|
LL | foo(x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -1,7 +1,7 @@
fn main() {
let j = || -> isize {
let i: isize;
i //~ ERROR use of possibly uninitialized variable: `i`
i //~ ERROR use of possibly-uninitialized variable: `i`
};
j();
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `i`
error[E0381]: use of possibly-uninitialized variable: `i`
--> $DIR/borrowck-init-in-called-fn-expr.rs:4:9
|
LL | i
| ^ use of possibly uninitialized `i`
| ^ use of possibly-uninitialized `i`
error: aborting due to previous error

View file

@ -1,7 +1,7 @@
fn main() {
let f = || -> isize {
let i: isize;
i //~ ERROR use of possibly uninitialized variable: `i`
i //~ ERROR use of possibly-uninitialized variable: `i`
};
println!("{}", f());
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `i`
error[E0381]: use of possibly-uninitialized variable: `i`
--> $DIR/borrowck-init-in-fn-expr.rs:4:9
|
LL | i
| ^ use of possibly uninitialized `i`
| ^ use of possibly-uninitialized `i`
error: aborting due to previous error

View file

@ -7,6 +7,6 @@ struct Point {
fn main() {
let mut origin: Point;
origin = Point { x: 10, ..origin };
//~^ ERROR use of possibly uninitialized variable: `origin` [E0381]
//~^ ERROR use of possibly-uninitialized variable: `origin` [E0381]
origin.clone();
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `origin`
error[E0381]: use of possibly-uninitialized variable: `origin`
--> $DIR/borrowck-init-in-fru.rs:9:5
|
LL | origin = Point { x: 10, ..origin };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `origin.y`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly-uninitialized `origin.y`
error: aborting due to previous error

View file

@ -1,6 +1,6 @@
fn test() {
let v: isize;
v += 1; //~ ERROR use of possibly uninitialized variable: `v`
v += 1; //~ ERROR use of possibly-uninitialized variable: `v`
v.clone();
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `v`
error[E0381]: use of possibly-uninitialized variable: `v`
--> $DIR/borrowck-init-op-equal.rs:3:5
|
LL | v += 1;
| ^^^^^^ use of possibly uninitialized `v`
| ^^^^^^ use of possibly-uninitialized `v`
error: aborting due to previous error

View file

@ -1,6 +1,6 @@
fn test() {
let mut v: isize;
v = v + 1; //~ ERROR use of possibly uninitialized variable: `v`
v = v + 1; //~ ERROR use of possibly-uninitialized variable: `v`
v.clone();
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `v`
error[E0381]: use of possibly-uninitialized variable: `v`
--> $DIR/borrowck-init-plus-equal.rs:3:9
|
LL | v = v + 1;
| ^ use of possibly uninitialized `v`
| ^ use of possibly-uninitialized `v`
error: aborting due to previous error

View file

@ -2,5 +2,5 @@ fn main() {
let i: isize;
println!("{}", false || { i = 5; true });
println!("{}", i); //~ ERROR borrow of possibly uninitialized variable: `i`
println!("{}", i); //~ ERROR borrow of possibly-uninitialized variable: `i`
}

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `i`
error[E0381]: borrow of possibly-uninitialized variable: `i`
--> $DIR/borrowck-or-init.rs:5:20
|
LL | println!("{}", i);
| ^ use of possibly uninitialized `i`
| ^ use of possibly-uninitialized `i`
error: aborting due to previous error

View file

@ -15,7 +15,7 @@ impl Drop for Test2 {
fn stuff() {
let mut x : (Test2, Test2);
(x.0).0 = Some(Test);
//~^ ERROR assign of possibly uninitialized variable: `x.0`
//~^ ERROR assign of possibly-uninitialized variable: `x.0`
}
fn main() {

View file

@ -1,8 +1,8 @@
error[E0381]: assign of possibly uninitialized variable: `x.0`
error[E0381]: assign of possibly-uninitialized variable: `x.0`
--> $DIR/borrowck-partial-reinit-4.rs:17:5
|
LL | (x.0).0 = Some(Test);
| ^^^^^^^ use of possibly uninitialized `x.0`
| ^^^^^^^ use of possibly-uninitialized `x.0`
error: aborting due to previous error

View file

@ -1,6 +1,6 @@
fn f() -> isize {
let x: isize;
return x; //~ ERROR use of possibly uninitialized variable: `x`
return x; //~ ERROR use of possibly-uninitialized variable: `x`
}
fn main() { f(); }

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-return.rs:3:12
|
LL | return x;
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-storage-dead.rs:16:17
|
LL | let _ = x + 1;
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -1,5 +1,5 @@
fn main() {
let bar;
fn baz(_x: isize) { }
baz(bar); //~ ERROR use of possibly uninitialized variable: `bar`
baz(bar); //~ ERROR use of possibly-uninitialized variable: `bar`
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `bar`
error[E0381]: use of possibly-uninitialized variable: `bar`
--> $DIR/borrowck-uninit-after-item.rs:4:9
|
LL | baz(bar);
| ^^^ use of possibly uninitialized `bar`
| ^^^ use of possibly-uninitialized `bar`
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `a`
error[E0381]: use of possibly-uninitialized variable: `a`
--> $DIR/borrowck-uninit-field-access.rs:21:13
|
LL | let _ = a.x + 1;
| ^^^ use of possibly uninitialized `a.x`
| ^^^ use of possibly-uninitialized `a.x`
error[E0382]: use of moved value: `line1.origin`
--> $DIR/borrowck-uninit-field-access.rs:25:13

View file

@ -3,32 +3,32 @@
pub fn main() {
let x: isize;
x += 1; //~ ERROR use of possibly uninitialized variable: `x`
x += 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x -= 1; //~ ERROR use of possibly uninitialized variable: `x`
x -= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x *= 1; //~ ERROR use of possibly uninitialized variable: `x`
x *= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x /= 1; //~ ERROR use of possibly uninitialized variable: `x`
x /= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x %= 1; //~ ERROR use of possibly uninitialized variable: `x`
x %= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x ^= 1; //~ ERROR use of possibly uninitialized variable: `x`
x ^= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x &= 1; //~ ERROR use of possibly uninitialized variable: `x`
x &= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x |= 1; //~ ERROR use of possibly uninitialized variable: `x`
x |= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x <<= 1; //~ ERROR use of possibly uninitialized variable: `x`
x <<= 1; //~ ERROR use of possibly-uninitialized variable: `x`
let x: isize;
x >>= 1; //~ ERROR use of possibly uninitialized variable: `x`
x >>= 1; //~ ERROR use of possibly-uninitialized variable: `x`
}

View file

@ -1,62 +1,62 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:6:5
|
LL | x += 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:9:5
|
LL | x -= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:12:5
|
LL | x *= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:15:5
|
LL | x /= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:18:5
|
LL | x %= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:21:5
|
LL | x ^= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:24:5
|
LL | x &= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:27:5
|
LL | x |= 1;
| ^^^^^^ use of possibly uninitialized `x`
| ^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:30:5
|
LL | x <<= 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-in-assignop.rs:33:5
|
LL | x >>= 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error: aborting due to 10 previous errors

View file

@ -15,19 +15,19 @@ fn main() {
let mut a: S<i32, i32>;
a.x = 0; //~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
a.x = 0; //~ ERROR assign to part of possibly-uninitialized variable: `a` [E0381]
let _b = &a.x;
let mut a: S<&&i32, &&i32>;
a.x = &&0; //~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
a.x = &&0; //~ ERROR assign to part of possibly-uninitialized variable: `a` [E0381]
let _b = &**a.x;
let mut a: S<i32, i32>;
a.x = 0; //~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
a.x = 0; //~ ERROR assign to part of possibly-uninitialized variable: `a` [E0381]
let _b = &a.y;
let mut a: S<&&i32, &&i32>;
a.x = &&0; //~ assign to part of possibly uninitialized variable: `a` [E0381]
a.x = &&0; //~ assign to part of possibly-uninitialized variable: `a` [E0381]
let _b = &**a.y;
}

View file

@ -1,44 +1,44 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-ref-chain.rs:8:14
|
LL | let _y = &**x;
| ^^^^ use of possibly uninitialized `**x`
| ^^^^ use of possibly-uninitialized `**x`
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-ref-chain.rs:11:14
|
LL | let _y = &**x;
| ^^^^ use of possibly uninitialized `**x`
| ^^^^ use of possibly-uninitialized `**x`
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit-ref-chain.rs:14:14
|
LL | let _y = &**x;
| ^^^^ use of possibly uninitialized `**x`
| ^^^^ use of possibly-uninitialized `**x`
error[E0381]: assign to part of possibly uninitialized variable: `a`
error[E0381]: assign to part of possibly-uninitialized variable: `a`
--> $DIR/borrowck-uninit-ref-chain.rs:18:5
|
LL | a.x = 0;
| ^^^^^^^ use of possibly uninitialized `a`
| ^^^^^^^ use of possibly-uninitialized `a`
error[E0381]: assign to part of possibly uninitialized variable: `a`
error[E0381]: assign to part of possibly-uninitialized variable: `a`
--> $DIR/borrowck-uninit-ref-chain.rs:22:5
|
LL | a.x = &&0;
| ^^^^^^^^^ use of possibly uninitialized `a`
| ^^^^^^^^^ use of possibly-uninitialized `a`
error[E0381]: assign to part of possibly uninitialized variable: `a`
error[E0381]: assign to part of possibly-uninitialized variable: `a`
--> $DIR/borrowck-uninit-ref-chain.rs:27:5
|
LL | a.x = 0;
| ^^^^^^^ use of possibly uninitialized `a`
| ^^^^^^^ use of possibly-uninitialized `a`
error[E0381]: assign to part of possibly uninitialized variable: `a`
error[E0381]: assign to part of possibly-uninitialized variable: `a`
--> $DIR/borrowck-uninit-ref-chain.rs:31:5
|
LL | a.x = &&0;
| ^^^^^^^^^ use of possibly uninitialized `a`
| ^^^^^^^^^ use of possibly-uninitialized `a`
error: aborting due to 7 previous errors

View file

@ -2,5 +2,5 @@ fn foo(x: isize) { println!("{}", x); }
fn main() {
let x: isize;
foo(x); //~ ERROR use of possibly uninitialized variable: `x`
foo(x); //~ ERROR use of possibly-uninitialized variable: `x`
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-uninit.rs:5:9
|
LL | foo(x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -10,8 +10,8 @@ fn main() {
unsafe {
let mut s: S;
let mut u: U;
s.a = 0; //~ ERROR assign to part of possibly uninitialized variable: `s`
u.a = 0; //~ ERROR assign to part of possibly uninitialized variable: `u`
s.a = 0; //~ ERROR assign to part of possibly-uninitialized variable: `s`
u.a = 0; //~ ERROR assign to part of possibly-uninitialized variable: `u`
let sa = s.a;
let ua = u.a;
}

View file

@ -1,14 +1,14 @@
error[E0381]: assign to part of possibly uninitialized variable: `s`
error[E0381]: assign to part of possibly-uninitialized variable: `s`
--> $DIR/borrowck-union-uninitialized.rs:13:9
|
LL | s.a = 0;
| ^^^^^^^ use of possibly uninitialized `s`
| ^^^^^^^ use of possibly-uninitialized `s`
error[E0381]: assign to part of possibly uninitialized variable: `u`
error[E0381]: assign to part of possibly-uninitialized variable: `u`
--> $DIR/borrowck-union-uninitialized.rs:14:9
|
LL | u.a = 0;
| ^^^^^^^ use of possibly uninitialized `u`
| ^^^^^^^ use of possibly-uninitialized `u`
error: aborting due to 2 previous errors

View file

@ -1,14 +1,14 @@
error[E0381]: use of possibly uninitialized variable: `w`
error[E0381]: use of possibly-uninitialized variable: `w`
--> $DIR/borrowck-use-in-index-lvalue.rs:3:5
|
LL | w[5] = 0;
| ^^^^ use of possibly uninitialized `*w`
| ^^^^ use of possibly-uninitialized `*w`
error[E0381]: use of possibly uninitialized variable: `w`
error[E0381]: use of possibly-uninitialized variable: `w`
--> $DIR/borrowck-use-in-index-lvalue.rs:6:5
|
LL | w[5] = 0;
| ^^^^ use of possibly uninitialized `*w`
| ^^^^ use of possibly-uninitialized `*w`
error: aborting due to 2 previous errors

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:9:13
|
LL | let y = x as *const dyn Foo;
| ^ use of possibly uninitialized `*x`
| ^ use of possibly-uninitialized `*x`
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/borrowck-use-uninitialized-in-cast.rs:7:13
|
LL | let y = x as *const i32;
| ^ use of possibly uninitialized `*x`
| ^ use of possibly-uninitialized `*x`
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ fn test(cond: bool) {
v = 3;
break;
}
println!("{}", v); //~ ERROR borrow of possibly uninitialized variable: `v`
println!("{}", v); //~ ERROR borrow of possibly-uninitialized variable: `v`
}
fn main() {

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `v`
error[E0381]: borrow of possibly-uninitialized variable: `v`
--> $DIR/borrowck-while-break.rs:7:20
|
LL | println!("{}", v);
| ^ use of possibly uninitialized `v`
| ^ use of possibly-uninitialized `v`
error: aborting due to previous error

View file

@ -1,4 +1,4 @@
fn main() {
let x: bool;
while x { } //~ ERROR use of possibly uninitialized variable: `x`
while x { } //~ ERROR use of possibly-uninitialized variable: `x`
}

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-while-cond.rs:3:11
|
LL | while x { }
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -1,7 +1,7 @@
fn f() -> isize {
let mut x: isize;
while 1 == 1 { x = 10; }
return x; //~ ERROR use of possibly uninitialized variable: `x`
return x; //~ ERROR use of possibly-uninitialized variable: `x`
}
fn main() { f(); }

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `x`
error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/borrowck-while.rs:4:12
|
LL | return x;
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

View file

@ -4,19 +4,19 @@
fn main() {
let mut t: (u64, u64);
t.0 = 1;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
t.1 = 1;
let mut t: (u64, u64);
t.1 = 1;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
t.0 = 1;
let mut t: (u64, u64);
t.0 = 1;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
let mut t: (u64,);
t.0 = 1;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
}

View file

@ -1,26 +1,26 @@
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/disallow-possibly-uninitialized.rs:6:5
|
LL | t.0 = 1;
| ^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/disallow-possibly-uninitialized.rs:11:5
|
LL | t.1 = 1;
| ^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/disallow-possibly-uninitialized.rs:16:5
|
LL | t.0 = 1;
| ^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/disallow-possibly-uninitialized.rs:20:5
|
LL | t.0 = 1;
| ^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^ use of possibly-uninitialized `t`
error: aborting due to 4 previous errors

View file

@ -10,7 +10,7 @@ fn main() {
{
let mut t: Tuple;
t.0 = S(1);
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
t.1 = 2;
println!("{:?} {:?}", t.0, t.1);
}
@ -18,7 +18,7 @@ fn main() {
{
let mut u: Tpair;
u.0 = S(1);
//~^ ERROR assign to part of possibly uninitialized variable: `u` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `u` [E0381]
u.1 = 2;
println!("{:?} {:?}", u.0, u.1);
}
@ -26,7 +26,7 @@ fn main() {
{
let mut v: Spair;
v.x = S(1);
//~^ ERROR assign to part of possibly uninitialized variable: `v` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `v` [E0381]
v.y = 2;
println!("{:?} {:?}", v.x, v.y);
}

View file

@ -1,20 +1,20 @@
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/issue-54499-field-mutation-marks-mut-as-used.rs:12:9
|
LL | t.0 = S(1);
| ^^^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `u`
error[E0381]: assign to part of possibly-uninitialized variable: `u`
--> $DIR/issue-54499-field-mutation-marks-mut-as-used.rs:20:9
|
LL | u.0 = S(1);
| ^^^^^^^^^^ use of possibly uninitialized `u`
| ^^^^^^^^^^ use of possibly-uninitialized `u`
error[E0381]: assign to part of possibly uninitialized variable: `v`
error[E0381]: assign to part of possibly-uninitialized variable: `v`
--> $DIR/issue-54499-field-mutation-marks-mut-as-used.rs:28:9
|
LL | v.x = S(1);
| ^^^^^^^^^^ use of possibly uninitialized `v`
| ^^^^^^^^^^ use of possibly-uninitialized `v`
error: aborting due to 3 previous errors

View file

@ -10,7 +10,7 @@ fn main() {
{
let t: Tuple;
t.0 = S(1);
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
t.1 = 2;
println!("{:?} {:?}", t.0, t.1);
}
@ -18,7 +18,7 @@ fn main() {
{
let u: Tpair;
u.0 = S(1);
//~^ ERROR assign to part of possibly uninitialized variable: `u` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `u` [E0381]
u.1 = 2;
println!("{:?} {:?}", u.0, u.1);
}
@ -26,7 +26,7 @@ fn main() {
{
let v: Spair;
v.x = S(1);
//~^ ERROR assign to part of possibly uninitialized variable: `v` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `v` [E0381]
v.y = 2;
println!("{:?} {:?}", v.x, v.y);
}

View file

@ -1,20 +1,20 @@
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/issue-54499-field-mutation-of-never-init.rs:12:9
|
LL | t.0 = S(1);
| ^^^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `u`
error[E0381]: assign to part of possibly-uninitialized variable: `u`
--> $DIR/issue-54499-field-mutation-of-never-init.rs:20:9
|
LL | u.0 = S(1);
| ^^^^^^^^^^ use of possibly uninitialized `u`
| ^^^^^^^^^^ use of possibly-uninitialized `u`
error[E0381]: assign to part of possibly uninitialized variable: `v`
error[E0381]: assign to part of possibly-uninitialized variable: `v`
--> $DIR/issue-54499-field-mutation-of-never-init.rs:28:9
|
LL | v.x = S(1);
| ^^^^^^^^^^ use of possibly uninitialized `v`
| ^^^^^^^^^^ use of possibly-uninitialized `v`
error: aborting due to 3 previous errors

View file

@ -1,7 +1,7 @@
fn main() {
let e: i32;
match e {
//~^ ERROR use of possibly uninitialized variable
//~^ ERROR use of possibly-uninitialized variable
ref u if true => {}
ref v if true => {
let tx = 0;

View file

@ -1,8 +1,8 @@
error[E0381]: use of possibly uninitialized variable: `e`
error[E0381]: use of possibly-uninitialized variable: `e`
--> $DIR/issue-62107-match-arm-scopes.rs:3:11
|
LL | match e {
| ^ use of possibly uninitialized `e`
| ^ use of possibly-uninitialized `e`
error: aborting due to previous error

View file

@ -1,14 +1,14 @@
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/reassignment_immutable_fields.rs:7:5
|
LL | x.0 = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/reassignment_immutable_fields.rs:15:5
|
LL | x.0 = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error: aborting due to 2 previous errors

View file

@ -1,8 +1,8 @@
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/reassignment_immutable_fields_overlapping.rs:12:5
|
LL | x.a = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error[E0594]: cannot assign to `x.b`, as `x` is not declared as mutable
--> $DIR/reassignment_immutable_fields_overlapping.rs:13:5

View file

@ -7,11 +7,11 @@ LL | x = (22, 44);
LL | x.0 = 1;
| ^^^^^^^ cannot assign
error[E0381]: assign to part of possibly uninitialized variable: `x`
error[E0381]: assign to part of possibly-uninitialized variable: `x`
--> $DIR/reassignment_immutable_fields_twice.rs:12:5
|
LL | x.0 = 1;
| ^^^^^^^ use of possibly uninitialized `x`
| ^^^^^^^ use of possibly-uninitialized `x`
error: aborting due to 2 previous errors

View file

@ -1,4 +1,4 @@
// Test that a borrow which starts as a 2-phase borrow and gets
// Test that a borrow which starts as a two-phase borrow and gets
// carried around a loop winds up conflicting with itself.
struct Foo { x: String }

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | Boo = [unsafe { Foo { b: () }.a }; 4][3],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:28:43
@ -38,7 +38,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:40:5
@ -46,7 +46,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:43:43
@ -78,7 +78,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:55:5
@ -86,7 +86,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:58:45
@ -102,7 +102,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:64:47
@ -150,7 +150,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:82:43
@ -190,7 +190,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:97:43
@ -214,7 +214,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:106:43

View file

@ -7,7 +7,7 @@ LL | | Union { u8: &BAR }.bar,
LL | | )};
| |___^ type validation failed: encountered 5 at .1.<deref>, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: could not evaluate constant pattern
--> $DIR/ref_to_int_match.rs:7:14

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | static FOO: bool = unsafe { mem::transmute(3u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3, but expected something less or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM: Enum = unsafe { TransmuteEnum { in2: 1 }.out1 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 1, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:26:1
@ -12,7 +12,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM_PTR: Enum = unsafe { TransmuteEnum { in1: &1 }.out1 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:29:1
@ -20,7 +20,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { TransmuteEnum { in1: &1 }.out2 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected something that cannot possibly fail to be equal to 0
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:48:1
@ -28,7 +28,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM2: Enum2 = unsafe { TransmuteEnum2 { in1: 0 }.out1 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:50:1
@ -36,7 +36,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { TransmuteEnum2 { in2: &0 }.out1 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:52:1
@ -44,7 +44,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { TransmuteEnum2 { in2: &0 }.out2 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected something that cannot possibly fail to be equal to 2
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:56:1
@ -52,7 +52,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { TransmuteEnum2 { in3: () }.out1 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:60:1
@ -60,7 +60,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { TransmuteEnum2 { in2: &0 }.out3 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected a valid enum discriminant
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum.rs:71:1
@ -68,7 +68,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { TransmuteChar { a: !0 }.b }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 4294967295 at .<downcast-variant(Some)>.0.1, but expected something less or equal to 1114111
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 9 previous errors

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: any use of this value will cause an error
--> $DIR/ub-nonnull.rs:18:29
@ -30,7 +30,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:24:1
@ -38,7 +38,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:32:1
@ -46,7 +46,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const UNINIT: NonZeroU8 = unsafe { Transmute { uninit: () }.out };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:40:1
@ -54,7 +54,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 42, but expected something in the range 10..=30
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:46:1
@ -62,7 +62,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 20, but expected something less or equal to 10, or greater or equal to 30
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 7 previous errors

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:11:1
@ -12,7 +12,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:17:1
@ -20,7 +20,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:20:1
@ -28,7 +28,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<deref>, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:23:1
@ -36,7 +36,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling reference (created from integer)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 5 previous errors

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_BAD_BAD: Bar = unsafe { (TransmuteUnion::<(), Bar> { a: () }).b };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:18:1
@ -12,7 +12,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type at .<deref>
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:21:1
@ -20,7 +20,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { (TransmuteUnion::<(), [Bar; 1]> { a: () }).b };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 3 previous errors

View file

@ -8,7 +8,7 @@ LL | | move || { let _ = bad_ref; let _ = another_var; }
LL | | };
| |__^ type validation failed: encountered 0 at .<deref>.<dyn-downcast>.<closure-var(bad_ref)>, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const STR_TOO_LONG: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.str};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling reference (not entirely in bounds)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:90:1
@ -12,7 +12,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const STR_LENGTH_PTR: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.str};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:93:1
@ -20,7 +20,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.my_str};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:97:1
@ -28,7 +28,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const STR_NO_UTF8: &str = unsafe { SliceTransmute { slice: &[0xFF] }.str };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized or non-UTF-8 data in str at .<deref>
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:100:1
@ -36,7 +36,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const MYSTR_NO_UTF8: &MyStr = unsafe { SliceTransmute { slice: &[0xFF] }.my_str };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized or non-UTF-8 data in str at .<deref>.0
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:107:1
@ -44,7 +44,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe { SliceTransmute { addr: 42 }.slice};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized data in wide pointer metadata
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:110:1
@ -52,7 +52,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const SLICE_TOO_LONG: &[u8] = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.slice};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling reference (not entirely in bounds)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:113:1
@ -60,7 +60,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.slice};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered non-integer slice length in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:117:1
@ -68,7 +68,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { BoolTransmute { val: 3 }.bl }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>[0], but expected something less or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:123:1
@ -76,7 +76,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { BoolTransmute { val: 3 }.bl }, [false]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>.0, but expected something less or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:126:1
@ -84,7 +84,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { BoolTransmute { val: 3 }.bl }]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>.1[0], but expected something less or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:133:1
@ -92,7 +92,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe { SliceTransmute { addr: 42 }.raw_slice};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized data in wide pointer metadata
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:138:1
@ -100,7 +100,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const TRAIT_OBJ_SHORT_VTABLE_1: &dyn Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable: &3 } }.rust};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling or unaligned vtable pointer in wide pointer or too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:141:1
@ -108,7 +108,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const TRAIT_OBJ_SHORT_VTABLE_2: &dyn Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.rust};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling or unaligned vtable pointer in wide pointer or too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:144:1
@ -116,7 +116,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const TRAIT_OBJ_INT_VTABLE: &dyn Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtable: 3 } }.rust};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling or unaligned vtable pointer in wide pointer or too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:148:1
@ -124,7 +124,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = &unsafe { BoolTransmute { val: 3 }.bl };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>.<dyn-downcast>, but expected something less or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:152:1
@ -132,7 +132,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtable: 0 } }.rust};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling or unaligned vtable pointer in wide pointer or too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:154:1
@ -140,7 +140,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.raw_rust};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling or unaligned vtable pointer in wide pointer or too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 18 previous errors

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/union-ice.rs:16:1
@ -15,7 +15,7 @@ LL | | b: unsafe { UNION.field3 },
LL | | };
| |__^ type validation failed: encountered uninitialized bytes at .b, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> $DIR/union-ice.rs:26:1
@ -29,7 +29,7 @@ LL | | a: 42,
LL | | };
| |__^ type validation failed: encountered undefined bytes at .b[1]
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 3 previous errors

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 42, but expected something less or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -2,6 +2,6 @@ fn main() {}
const fn slice([a, b]: &[i32]) -> i32 { //~ ERROR refutable pattern in function argument
a + b //~ ERROR can only call other `const fn` within a `const fn`
//~^ ERROR use of possibly uninitialized variable: `a`
//~| ERROR use of possibly uninitialized variable: `b`
//~^ ERROR use of possibly-uninitialized variable: `a`
//~| ERROR use of possibly-uninitialized variable: `b`
}

View file

@ -13,17 +13,17 @@ LL | a + b
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
= help: add `#![feature(const_fn)]` to the crate attributes to enable
error[E0381]: use of possibly uninitialized variable: `a`
error[E0381]: use of possibly-uninitialized variable: `a`
--> $DIR/const_let_refutable.rs:4:5
|
LL | a + b
| ^ use of possibly uninitialized `a`
| ^ use of possibly-uninitialized `a`
error[E0381]: use of possibly uninitialized variable: `b`
error[E0381]: use of possibly-uninitialized variable: `b`
--> $DIR/const_let_refutable.rs:4:9
|
LL | a + b
| ^ use of possibly uninitialized `b`
| ^ use of possibly-uninitialized `b`
error: aborting due to 4 previous errors

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const LAYOUT_INVALID: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0 at .align_, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error[E0080]: it is undefined behavior to use this value
LL | const FOO: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of an uninhabited type at .<deref>
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ fn transmute<T, U>(t: T) -> U {
let Helper::U(u) = Helper::T(t, []);
//~^ ERROR refutable pattern in local binding: `T(_, _)` not covered
u
//~^ ERROR use of possibly uninitialized variable: `u`
//~^ ERROR use of possibly-uninitialized variable: `u`
}
fn main() {

View file

@ -11,11 +11,11 @@ LL | | }
LL | let Helper::U(u) = Helper::T(t, []);
| ^^^^^^^^^^^^ pattern `T(_, _)` not covered
error[E0381]: use of possibly uninitialized variable: `u`
error[E0381]: use of possibly-uninitialized variable: `u`
--> $DIR/empty-never-array.rs:12:5
|
LL | u
| ^ use of possibly uninitialized `u`
| ^ use of possibly-uninitialized `u`
error: aborting due to 2 previous errors

View file

@ -10,7 +10,7 @@ fn test_tuple() {
let _ = || {
let mut t: (i32, i32);
t.0 = 42;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
yield;
t.1 = 88;
let _ = t;
@ -21,7 +21,7 @@ fn test_tuple_struct() {
let _ = || {
let mut t: T;
t.0 = 42;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
yield;
t.1 = 88;
let _ = t;
@ -32,7 +32,7 @@ fn test_struct() {
let _ = || {
let mut t: S;
t.x = 42;
//~^ ERROR assign to part of possibly uninitialized variable: `t` [E0381]
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
yield;
t.y = 88;
let _ = t;

View file

@ -1,20 +1,20 @@
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/partial-initialization-across-yield.rs:12:9
|
LL | t.0 = 42;
| ^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/partial-initialization-across-yield.rs:23:9
|
LL | t.0 = 42;
| ^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^ use of possibly-uninitialized `t`
error[E0381]: assign to part of possibly uninitialized variable: `t`
error[E0381]: assign to part of possibly-uninitialized variable: `t`
--> $DIR/partial-initialization-across-yield.rs:34:9
|
LL | t.x = 42;
| ^^^^^^^^ use of possibly uninitialized `t`
| ^^^^^^^^ use of possibly-uninitialized `t`
error: aborting due to 3 previous errors

View file

@ -4,6 +4,6 @@ fn main() {
for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) {
//~^ ERROR refutable pattern in `for` loop binding: `&[]` not covered
println!("y={}", y);
//~^ ERROR borrow of possibly uninitialized variable: `y`
//~^ ERROR borrow of possibly-uninitialized variable: `y`
}
}

View file

@ -4,11 +4,11 @@ error[E0005]: refutable pattern in `for` loop binding: `&[]` not covered
LL | for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) {
| ^^^^^^^^ pattern `&[]` not covered
error[E0381]: borrow of possibly uninitialized variable: `y`
error[E0381]: borrow of possibly-uninitialized variable: `y`
--> $DIR/issue-15381.rs:6:26
|
LL | println!("y={}", y);
| ^ use of possibly uninitialized `y`
| ^ use of possibly-uninitialized `y`
error: aborting due to 2 previous errors

View file

@ -9,11 +9,11 @@ pub fn main() {
pub fn foo1() {
let x: i32;
loop { x = break; }
println!("{}", x); //~ ERROR borrow of possibly uninitialized variable: `x`
println!("{}", x); //~ ERROR borrow of possibly-uninitialized variable: `x`
}
pub fn foo2() {
let x: i32;
for _ in 0..10 { x = continue; }
println!("{}", x); //~ ERROR borrow of possibly uninitialized variable: `x`
println!("{}", x); //~ ERROR borrow of possibly-uninitialized variable: `x`
}

View file

@ -1,14 +1,14 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/issue-24267-flow-exit.rs:12:20
|
LL | println!("{}", x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/issue-24267-flow-exit.rs:18:20
|
LL | println!("{}", x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to 2 previous errors

View file

@ -6,7 +6,7 @@ fn test1() {
'a: loop {
x = loop { break 'a };
}
println!("{:?}", x); //~ ERROR borrow of possibly uninitialized variable
println!("{:?}", x); //~ ERROR borrow of possibly-uninitialized variable
}
// test2 and test3 should not fail.

View file

@ -1,8 +1,8 @@
error[E0381]: borrow of possibly uninitialized variable: `x`
error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/loop-proper-liveness.rs:9:22
|
LL | println!("{:?}", x);
| ^ use of possibly uninitialized `x`
| ^ use of possibly-uninitialized `x`
error: aborting due to previous error

Some files were not shown because too many files have changed in this diff Show more