Allow fn pointers comparisons lint in UI tests

This commit is contained in:
Urgau 2023-12-10 15:51:06 +01:00
parent 5e34c2e43c
commit 8ce63576bd
11 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,5 @@
#![allow(unpredictable_function_pointer_comparisons)]
use std::mem;
trait Answer {

View File

@ -1,3 +1,5 @@
#![allow(unpredictable_function_pointer_comparisons)]
type BuiltIn = for<'a> fn(&str);
struct Function {

View File

@ -1,6 +1,9 @@
//@ run-pass
// Tests equality between supertype and subtype of a function
// See the issue #91636
#![allow(unpredictable_function_pointer_comparisons)]
fn foo(_a: &str) {}
fn main() {

View File

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

View File

@ -1,5 +1,7 @@
//@ run-pass
#![allow(non_upper_case_globals)]
#![allow(unpredictable_function_pointer_comparisons)]
extern "C" fn foopy() {}

View File

@ -1,6 +1,8 @@
//@ run-pass
//@ aux-build:cci_const.rs
#![allow(non_upper_case_globals)]
#![allow(unpredictable_function_pointer_comparisons)]
extern crate cci_const;
use cci_const::bar;

View File

@ -2,6 +2,7 @@
// Tests that we can compare various kinds of extern fn signatures.
#![allow(non_camel_case_types)]
#![allow(unpredictable_function_pointer_comparisons)]
// `dbg!()` differentiates these functions to ensure they won't be merged.
extern "C" fn voidret1() { dbg!() }

View File

@ -1,6 +1,8 @@
//@ run-pass
//@ aux-build:extern-take-value.rs
#![allow(unpredictable_function_pointer_comparisons)]
extern crate extern_take_value;
pub fn main() {

View File

@ -1,6 +1,8 @@
//@ compile-flags: -C opt-level=3
//@ run-pass
#![allow(unpredictable_function_pointer_comparisons)]
fn foo(_i: i32) -> i32 {
1
}

View File

@ -1,5 +1,7 @@
//@ run-pass
#![allow(unpredictable_function_pointer_comparisons)]
fn main() {
// We shouldn't promote this
let _ = &(main as fn() == main as fn());

View File

@ -1,6 +1,8 @@
//@ check-pass
//@ compile-flags: -Zvalidate-mir
#![allow(unpredictable_function_pointer_comparisons)]
fn foo(_a: &str) {}
fn main() {