Skip to content

Commit

Permalink
Adjust tests for newly added unclear_fat_pointer_comparisons lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Nov 10, 2023
1 parent b53f250 commit 2b1bbe4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,7 @@ fn vec_macro_repeating_null_raw_fat_pointer() {

let vec = vec![null_raw_dyn; 1];
dbg!(ptr_metadata(vec[0]));
assert!(vec[0] == null_raw_dyn);
assert!(std::ptr::eq(vec[0], null_raw_dyn));

// Polyfill for https://github.com/rust-lang/rfcs/pull/2580

Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/pass/pointers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//@[tree]compile-flags: -Zmiri-tree-borrows
//@compile-flags: -Zmiri-permissive-provenance
#![feature(ptr_metadata, const_raw_ptr_comparison)]
#![allow(unclear_fat_pointer_comparisons)]

use std::mem::{self, transmute};
use std::ptr;
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/pass/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//@compile-flags: -Zmiri-strict-provenance
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]
#![allow(unclear_fat_pointer_comparisons)]

use std::cell::{Cell, RefCell};
use std::fmt::Debug;
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/issues/issue-17336.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// build-pass

#![allow(unused_must_use)]
#![allow(unclear_fat_pointer_comparisons)]

#[allow(dead_code)]
fn check(a: &str) {
let x = a as *const str;
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/mir/mir_raw_fat_ptr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// run-pass
// check raw fat pointer ops in mir
// FIXME: please improve this when we get monomorphization support

#![feature(raw_ref_op)]
#![allow(unclear_fat_pointer_comparisons)]

use std::mem;

Expand Down

0 comments on commit 2b1bbe4

Please sign in to comment.