Skip to content

Commit 8ce6357

Browse files
committed
Allow fn pointers comparisons lint in UI tests
1 parent 5e34c2e commit 8ce6357

11 files changed

+23
-0
lines changed

src/tools/miri/tests/pass/function_pointers.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unpredictable_function_pointer_comparisons)]
2+
13
use std::mem;
24

35
trait Answer {

src/tools/miri/tests/pass/issues/issue-91636.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unpredictable_function_pointer_comparisons)]
2+
13
type BuiltIn = for<'a> fn(&str);
24

35
struct Function {

tests/ui/binop/binary-op-on-fn-ptr-eq.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ run-pass
22
// Tests equality between supertype and subtype of a function
33
// See the issue #91636
4+
5+
#![allow(unpredictable_function_pointer_comparisons)]
6+
47
fn foo(_a: &str) {}
58

69
fn main() {

tests/ui/box/unit/unique-ffi-symbols.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ run-pass
22
// We used to have a __rust_abi shim that resulted in duplicated symbols
33
// whenever the item path wasn't enough to disambiguate between them.
4+
5+
#![allow(unpredictable_function_pointer_comparisons)]
6+
47
fn main() {
58
let a = {
69
extern "C" fn good() -> i32 { return 0; }

tests/ui/consts/const-extern-function.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ run-pass
2+
23
#![allow(non_upper_case_globals)]
4+
#![allow(unpredictable_function_pointer_comparisons)]
35

46
extern "C" fn foopy() {}
57

tests/ui/cross-crate/const-cross-crate-extern.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ run-pass
22
//@ aux-build:cci_const.rs
3+
34
#![allow(non_upper_case_globals)]
5+
#![allow(unpredictable_function_pointer_comparisons)]
46

57
extern crate cci_const;
68
use cci_const::bar;

tests/ui/extern/extern-compare-with-return-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// Tests that we can compare various kinds of extern fn signatures.
44
#![allow(non_camel_case_types)]
5+
#![allow(unpredictable_function_pointer_comparisons)]
56

67
// `dbg!()` differentiates these functions to ensure they won't be merged.
78
extern "C" fn voidret1() { dbg!() }

tests/ui/extern/extern-take-value.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ run-pass
22
//@ aux-build:extern-take-value.rs
33

4+
#![allow(unpredictable_function_pointer_comparisons)]
5+
46
extern crate extern_take_value;
57

68
pub fn main() {

tests/ui/function-pointer/function-pointer-comparison-issue-54685.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ compile-flags: -C opt-level=3
22
//@ run-pass
33

4+
#![allow(unpredictable_function_pointer_comparisons)]
5+
46
fn foo(_i: i32) -> i32 {
57
1
68
}

tests/ui/issues/issue-54696.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ run-pass
22

3+
#![allow(unpredictable_function_pointer_comparisons)]
4+
35
fn main() {
46
// We shouldn't promote this
57
let _ = &(main as fn() == main as fn());

tests/ui/mir/validate/issue-95978-validator-lifetime-comparison.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ check-pass
22
//@ compile-flags: -Zvalidate-mir
33

4+
#![allow(unpredictable_function_pointer_comparisons)]
5+
46
fn foo(_a: &str) {}
57

68
fn main() {

0 commit comments

Comments
 (0)