Allow fn pointers comparisons lint in UI tests
This commit is contained in:
parent
5e34c2e43c
commit
8ce63576bd
11 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
trait Answer {
|
trait Answer {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
type BuiltIn = for<'a> fn(&str);
|
type BuiltIn = for<'a> fn(&str);
|
||||||
|
|
||||||
struct Function {
|
struct Function {
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
// Tests equality between supertype and subtype of a function
|
// Tests equality between supertype and subtype of a function
|
||||||
// See the issue #91636
|
// See the issue #91636
|
||||||
|
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
fn foo(_a: &str) {}
|
fn foo(_a: &str) {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
// We used to have a __rust_abi shim that resulted in duplicated symbols
|
// We used to have a __rust_abi shim that resulted in duplicated symbols
|
||||||
// whenever the item path wasn't enough to disambiguate between them.
|
// whenever the item path wasn't enough to disambiguate between them.
|
||||||
|
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let a = {
|
let a = {
|
||||||
extern "C" fn good() -> i32 { return 0; }
|
extern "C" fn good() -> i32 { return 0; }
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
extern "C" fn foopy() {}
|
extern "C" fn foopy() {}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ aux-build:cci_const.rs
|
//@ aux-build:cci_const.rs
|
||||||
|
|
||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
extern crate cci_const;
|
extern crate cci_const;
|
||||||
use cci_const::bar;
|
use cci_const::bar;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
// Tests that we can compare various kinds of extern fn signatures.
|
// Tests that we can compare various kinds of extern fn signatures.
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
// `dbg!()` differentiates these functions to ensure they won't be merged.
|
// `dbg!()` differentiates these functions to ensure they won't be merged.
|
||||||
extern "C" fn voidret1() { dbg!() }
|
extern "C" fn voidret1() { dbg!() }
|
||||||
|
|
2
tests/ui/extern/extern-take-value.rs
vendored
2
tests/ui/extern/extern-take-value.rs
vendored
|
@ -1,6 +1,8 @@
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ aux-build:extern-take-value.rs
|
//@ aux-build:extern-take-value.rs
|
||||||
|
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
extern crate extern_take_value;
|
extern crate extern_take_value;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
//@ compile-flags: -C opt-level=3
|
//@ compile-flags: -C opt-level=3
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
fn foo(_i: i32) -> i32 {
|
fn foo(_i: i32) -> i32 {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// We shouldn't promote this
|
// We shouldn't promote this
|
||||||
let _ = &(main as fn() == main as fn());
|
let _ = &(main as fn() == main as fn());
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
//@ compile-flags: -Zvalidate-mir
|
//@ compile-flags: -Zvalidate-mir
|
||||||
|
|
||||||
|
#![allow(unpredictable_function_pointer_comparisons)]
|
||||||
|
|
||||||
fn foo(_a: &str) {}
|
fn foo(_a: &str) {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue