File tree 2 files changed +16
-8
lines changed
2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change
1
+ // run-pass
1
2
// https://github.com/rust-lang/rust/issues/55223
2
3
3
4
union Foo < ' a > {
5
+ //~^ WARN union is never used
4
6
y : & ' a ( ) ,
5
7
long_live_the_unit : & ' static ( ) ,
6
8
}
7
9
8
- const FOO : & ( ) = { //~ ERROR any use of this value will cause an error
10
+ const FOO : & ( ) = {
11
+ //~^ WARN constant item is never used
9
12
let y = ( ) ;
10
13
unsafe { Foo { y : & y } . long_live_the_unit }
11
14
} ;
Original file line number Diff line number Diff line change 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
3
11
|
4
12
LL | / const FOO: &() = {
13
+ LL | |
5
14
LL | | let y = ();
6
15
LL | | unsafe { Foo { y: &y }.long_live_the_unit }
7
16
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
+ | |__^
13
18
You can’t perform that action at this time.
0 commit comments