Skip to content

Commit ee403d6

Browse files
committed
Update test
1 parent 370251c commit ee403d6

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/test/ui/consts/dangling-alloc-id-ice.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
// run-pass
12
// https://github.com/rust-lang/rust/issues/55223
23

34
union Foo<'a> {
5+
//~^ WARN union is never used
46
y: &'a (),
57
long_live_the_unit: &'static (),
68
}
79

8-
const FOO: &() = { //~ ERROR any use of this value will cause an error
10+
const FOO: &() = {
11+
//~^ WARN constant item is never used
912
let y = ();
1013
unsafe { Foo { y: &y }.long_live_the_unit }
1114
};
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
error: any use of this value will cause an error
2-
--> $DIR/dangling-alloc-id-ice.rs:8:1
1+
warning: union is never used: `Foo`
2+
--> $DIR/dangling-alloc-id-ice.rs:4:7
3+
|
4+
LL | union Foo<'a> {
5+
| ^^^
6+
|
7+
= note: `#[warn(dead_code)]` on by default
8+
9+
warning: constant item is never used: `FOO`
10+
--> $DIR/dangling-alloc-id-ice.rs:10:1
311
|
412
LL | / const FOO: &() = {
13+
LL | |
514
LL | | let y = ();
615
LL | | unsafe { Foo { y: &y }.long_live_the_unit }
716
LL | | };
8-
| |__^ encountered dangling pointer in final constant
9-
|
10-
= note: `#[deny(const_err)]` on by default
11-
12-
error: aborting due to previous error
17+
| |__^
1318

0 commit comments

Comments
 (0)