Update tests

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
varkor 2019-02-15 22:26:36 +00:00
parent 2279907fd2
commit 9cfdb80085
4 changed files with 12 additions and 12 deletions

View file

@ -1,10 +1,10 @@
#![deny(no_mangle_generic_items)]
#[no_mangle]
pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled
pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
#[no_mangle]
pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled
pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
#[no_mangle]
pub fn baz(x: &i32) -> &i32 { x }

View file

@ -1,9 +1,9 @@
error: functions generic over types must be mangled
error: functions generic over types or consts must be mangled
--> $DIR/generic-no-mangle.rs:4:1
|
LL | #[no_mangle]
| ------------ help: remove this attribute
LL | pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled
LL | pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
@ -12,12 +12,12 @@ note: lint level defined here
LL | #![deny(no_mangle_generic_items)]
| ^^^^^^^^^^^^^^^^^^^^^^^
error: functions generic over types must be mangled
error: functions generic over types or consts must be mangled
--> $DIR/generic-no-mangle.rs:7:1
|
LL | #[no_mangle]
| ------------ help: remove this attribute
LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled
LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View file

@ -10,7 +10,7 @@
#[no_mangle]
//~^ HELP remove this attribute
pub fn defiant<T>(_t: T) {}
//~^ WARN functions generic over types must be mangled
//~^ WARN functions generic over types or consts must be mangled
#[no_mangle]
fn rio_grande() {}
@ -23,7 +23,7 @@ mod badlands {
//~^ ERROR const items should never be #[no_mangle]
//~| HELP try a static value
#[no_mangle] pub fn val_jean<T>() {}
//~^ WARN functions generic over types must be mangled
//~^ WARN functions generic over types or consts must be mangled
//~| HELP remove this attribute
// ... but we can suggest just-`pub` instead of restricted
@ -31,7 +31,7 @@ mod badlands {
//~^ ERROR const items should never be #[no_mangle]
//~| HELP try a static value
#[no_mangle] pub(crate) fn crossfield<T>() {}
//~^ WARN functions generic over types must be mangled
//~^ WARN functions generic over types or consts must be mangled
//~| HELP remove this attribute
}

View file

@ -54,7 +54,7 @@ LL | #[no_mangle] const DISCOVERY: usize = 1;
|
= note: #[deny(no_mangle_const_items)] on by default
warning: functions generic over types must be mangled
warning: functions generic over types or consts must be mangled
--> $DIR/suggestions.rs:12:1
|
LL | #[no_mangle]
@ -73,7 +73,7 @@ LL | #[no_mangle] pub const DAUNTLESS: bool = true;
| |
| help: try a static value: `pub static`
warning: functions generic over types must be mangled
warning: functions generic over types or consts must be mangled
--> $DIR/suggestions.rs:25:18
|
LL | #[no_mangle] pub fn val_jean<T>() {}
@ -89,7 +89,7 @@ LL | #[no_mangle] pub(crate) const VETAR: bool = true;
| |
| help: try a static value: `pub static`
warning: functions generic over types must be mangled
warning: functions generic over types or consts must be mangled
--> $DIR/suggestions.rs:33:18
|
LL | #[no_mangle] pub(crate) fn crossfield<T>() {}