mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 03:14:11 +00:00
Allow fn pointers comparisons lint in UI tests
This commit is contained in:
parent
5e34c2e43c
commit
8ce63576bd
@ -1,3 +1,5 @@
|
||||
#![allow(unpredictable_function_pointer_comparisons)]
|
||||
|
||||
use std::mem;
|
||||
|
||||
trait Answer {
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![allow(unpredictable_function_pointer_comparisons)]
|
||||
|
||||
type BuiltIn = for<'a> fn(&str);
|
||||
|
||||
struct Function {
|
||||
|
@ -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() {
|
||||
|
@ -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; }
|
||||
|
@ -1,5 +1,7 @@
|
||||
//@ run-pass
|
||||
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(unpredictable_function_pointer_comparisons)]
|
||||
|
||||
extern "C" fn foopy() {}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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!() }
|
||||
|
2
tests/ui/extern/extern-take-value.rs
vendored
2
tests/ui/extern/extern-take-value.rs
vendored
@ -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() {
|
||||
|
@ -1,6 +1,8 @@
|
||||
//@ compile-flags: -C opt-level=3
|
||||
//@ run-pass
|
||||
|
||||
#![allow(unpredictable_function_pointer_comparisons)]
|
||||
|
||||
fn foo(_i: i32) -> i32 {
|
||||
1
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -1,6 +1,8 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: -Zvalidate-mir
|
||||
|
||||
#![allow(unpredictable_function_pointer_comparisons)]
|
||||
|
||||
fn foo(_a: &str) {}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user