Skip to content

Commit 9cfdb80

Browse files
varkoryodaldevoid
andcommitted
Update tests
Co-Authored-By: Gabriel Smith <[email protected]>
1 parent 2279907 commit 9cfdb80

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/test/ui/generic/generic-no-mangle.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![deny(no_mangle_generic_items)]
22

33
#[no_mangle]
4-
pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled
4+
pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
55

66
#[no_mangle]
7-
pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled
7+
pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
88

99
#[no_mangle]
1010
pub fn baz(x: &i32) -> &i32 { x }

src/test/ui/generic/generic-no-mangle.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error: functions generic over types must be mangled
1+
error: functions generic over types or consts must be mangled
22
--> $DIR/generic-no-mangle.rs:4:1
33
|
44
LL | #[no_mangle]
55
| ------------ help: remove this attribute
6-
LL | pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled
6+
LL | pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
77
| ^^^^^^^^^^^^^^^^^^
88
|
99
note: lint level defined here
@@ -12,12 +12,12 @@ note: lint level defined here
1212
LL | #![deny(no_mangle_generic_items)]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^
1414

15-
error: functions generic over types must be mangled
15+
error: functions generic over types or consts must be mangled
1616
--> $DIR/generic-no-mangle.rs:7:1
1717
|
1818
LL | #[no_mangle]
1919
| ------------ help: remove this attribute
20-
LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled
20+
LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^
2222

2323
error: aborting due to 2 previous errors

src/test/ui/lint/suggestions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#[no_mangle]
1111
//~^ HELP remove this attribute
1212
pub fn defiant<T>(_t: T) {}
13-
//~^ WARN functions generic over types must be mangled
13+
//~^ WARN functions generic over types or consts must be mangled
1414

1515
#[no_mangle]
1616
fn rio_grande() {}
@@ -23,15 +23,15 @@ mod badlands {
2323
//~^ ERROR const items should never be #[no_mangle]
2424
//~| HELP try a static value
2525
#[no_mangle] pub fn val_jean<T>() {}
26-
//~^ WARN functions generic over types must be mangled
26+
//~^ WARN functions generic over types or consts must be mangled
2727
//~| HELP remove this attribute
2828

2929
// ... but we can suggest just-`pub` instead of restricted
3030
#[no_mangle] pub(crate) const VETAR: bool = true;
3131
//~^ ERROR const items should never be #[no_mangle]
3232
//~| HELP try a static value
3333
#[no_mangle] pub(crate) fn crossfield<T>() {}
34-
//~^ WARN functions generic over types must be mangled
34+
//~^ WARN functions generic over types or consts must be mangled
3535
//~| HELP remove this attribute
3636
}
3737

src/test/ui/lint/suggestions.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ LL | #[no_mangle] const DISCOVERY: usize = 1;
5454
|
5555
= note: #[deny(no_mangle_const_items)] on by default
5656

57-
warning: functions generic over types must be mangled
57+
warning: functions generic over types or consts must be mangled
5858
--> $DIR/suggestions.rs:12:1
5959
|
6060
LL | #[no_mangle]
@@ -73,7 +73,7 @@ LL | #[no_mangle] pub const DAUNTLESS: bool = true;
7373
| |
7474
| help: try a static value: `pub static`
7575

76-
warning: functions generic over types must be mangled
76+
warning: functions generic over types or consts must be mangled
7777
--> $DIR/suggestions.rs:25:18
7878
|
7979
LL | #[no_mangle] pub fn val_jean<T>() {}
@@ -89,7 +89,7 @@ LL | #[no_mangle] pub(crate) const VETAR: bool = true;
8989
| |
9090
| help: try a static value: `pub static`
9191

92-
warning: functions generic over types must be mangled
92+
warning: functions generic over types or consts must be mangled
9393
--> $DIR/suggestions.rs:33:18
9494
|
9595
LL | #[no_mangle] pub(crate) fn crossfield<T>() {}

0 commit comments

Comments
 (0)