move strict provenance lints to new feature gate, remove old feature gates

This commit is contained in:
Ralf Jung 2024-09-14 13:44:02 +02:00
parent c3e928d8dd
commit 56ee492a6e
89 changed files with 40 additions and 127 deletions

View File

@ -23,7 +23,6 @@
#![feature(maybe_uninit_slice)] #![feature(maybe_uninit_slice)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![feature(strict_provenance)]
#![warn(unreachable_pub)] #![warn(unreachable_pub)]
// tidy-alphabetical-end // tidy-alphabetical-end

View File

@ -11,7 +11,6 @@
#![feature(let_chains)] #![feature(let_chains)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![feature(strict_provenance)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![warn(unreachable_pub)] #![warn(unreachable_pub)]

View File

@ -10,7 +10,6 @@
#![feature(never_type)] #![feature(never_type)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![feature(slice_ptr_get)] #![feature(slice_ptr_get)]
#![feature(strict_provenance)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(unqualified_local_imports)] #![feature(unqualified_local_imports)]

View File

@ -33,7 +33,6 @@
#![feature(ptr_alignment_type)] #![feature(ptr_alignment_type)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![feature(strict_provenance)]
#![feature(test)] #![feature(test)]
#![feature(thread_id_value)] #![feature(thread_id_value)]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]

View File

@ -598,7 +598,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows attributes on expressions and non-item statements. /// Allows attributes on expressions and non-item statements.
(unstable, stmt_expr_attributes, "1.6.0", Some(15701)), (unstable, stmt_expr_attributes, "1.6.0", Some(15701)),
/// Allows lints part of the strict provenance effort. /// Allows lints part of the strict provenance effort.
(unstable, strict_provenance, "1.61.0", Some(95228)), (unstable, strict_provenance_lints, "1.61.0", Some(130351)),
/// Allows string patterns to dereference values to match them. /// Allows string patterns to dereference values to match them.
(unstable, string_deref_patterns, "1.67.0", Some(87121)), (unstable, string_deref_patterns, "1.67.0", Some(87121)),
/// Allows the use of `#[target_feature]` on safe functions. /// Allows the use of `#[target_feature]` on safe functions.

View File

@ -2667,7 +2667,6 @@
/// ### Example /// ### Example
/// ///
/// ```rust /// ```rust
/// #![feature(strict_provenance)]
/// #![warn(fuzzy_provenance_casts)] /// #![warn(fuzzy_provenance_casts)]
/// ///
/// fn main() { /// fn main() {
@ -2701,7 +2700,7 @@
pub FUZZY_PROVENANCE_CASTS, pub FUZZY_PROVENANCE_CASTS,
Allow, Allow,
"a fuzzy integer to pointer cast is used", "a fuzzy integer to pointer cast is used",
@feature_gate = strict_provenance; @feature_gate = strict_provenance_lints;
} }
declare_lint! { declare_lint! {
@ -2711,7 +2710,6 @@
/// ### Example /// ### Example
/// ///
/// ```rust /// ```rust
/// #![feature(strict_provenance)]
/// #![warn(lossy_provenance_casts)] /// #![warn(lossy_provenance_casts)]
/// ///
/// fn main() { /// fn main() {
@ -2747,7 +2745,7 @@
pub LOSSY_PROVENANCE_CASTS, pub LOSSY_PROVENANCE_CASTS,
Allow, Allow,
"a lossy pointer to integer cast is used", "a lossy pointer to integer cast is used",
@feature_gate = strict_provenance; @feature_gate = strict_provenance_lints;
} }
declare_lint! { declare_lint! {

View File

@ -56,7 +56,6 @@
#![feature(ptr_alignment_type)] #![feature(ptr_alignment_type)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![feature(strict_provenance)]
#![feature(trait_upcasting)] #![feature(trait_upcasting)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(try_blocks)] #![feature(try_blocks)]

View File

@ -1913,7 +1913,7 @@
str_trim, str_trim,
str_trim_end, str_trim_end,
str_trim_start, str_trim_start,
strict_provenance, strict_provenance_lints,
string_as_mut_str, string_as_mut_str,
string_as_str, string_as_str,
string_deref_patterns, string_deref_patterns,

View File

@ -4,7 +4,8 @@
#![feature(iter_next_chunk)] #![feature(iter_next_chunk)]
#![feature(repr_simd)] #![feature(repr_simd)]
#![feature(slice_partition_dedup)] #![feature(slice_partition_dedup)]
#![feature(strict_provenance)] #![cfg_attr(bootstrap, feature(strict_provenance))]
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
#![feature(test)] #![feature(test)]
#![deny(fuzzy_provenance_casts)] #![deny(fuzzy_provenance_casts)]

View File

@ -147,7 +147,6 @@
#![feature(slice_range)] #![feature(slice_range)]
#![feature(std_internals)] #![feature(std_internals)]
#![feature(str_internals)] #![feature(str_internals)]
#![feature(strict_provenance)]
#![feature(trusted_fused)] #![feature(trusted_fused)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(trusted_random_access)] #![feature(trusted_random_access)]
@ -162,6 +161,8 @@
// //
// Language features: // Language features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(strict_provenance))]
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
#![cfg_attr(not(test), feature(coroutine_trait))] #![cfg_attr(not(test), feature(coroutine_trait))]
#![cfg_attr(test, feature(panic_update_hook))] #![cfg_attr(test, feature(panic_update_hook))]
#![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(test))]

View File

@ -32,7 +32,8 @@
#![feature(panic_update_hook)] #![feature(panic_update_hook)]
#![feature(pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
#![feature(thin_box)] #![feature(thin_box)]
#![feature(strict_provenance)] #![cfg_attr(bootstrap, feature(strict_provenance))]
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
#![feature(drain_keep_rest)] #![feature(drain_keep_rest)]
#![feature(local_waker)] #![feature(local_waker)]
#![feature(vec_pop_if)] #![feature(vec_pop_if)]

View File

@ -2794,7 +2794,6 @@ pub const fn const_eval_select<ARG: Tuple, F, G, RET>(
/// #![feature(is_val_statically_known)] /// #![feature(is_val_statically_known)]
/// #![feature(core_intrinsics)] /// #![feature(core_intrinsics)]
/// # #![allow(internal_features)] /// # #![allow(internal_features)]
/// #![feature(strict_provenance)]
/// use std::intrinsics::is_val_statically_known; /// use std::intrinsics::is_val_statically_known;
/// ///
/// fn foo(x: &i32) -> bool { /// fn foo(x: &i32) -> bool {

View File

@ -163,7 +163,6 @@
#![feature(str_internals)] #![feature(str_internals)]
#![feature(str_split_inclusive_remainder)] #![feature(str_split_inclusive_remainder)]
#![feature(str_split_remainder)] #![feature(str_split_remainder)]
#![feature(strict_provenance)]
#![feature(ub_checks)] #![feature(ub_checks)]
#![feature(unchecked_neg)] #![feature(unchecked_neg)]
#![feature(unchecked_shifts)] #![feature(unchecked_shifts)]
@ -174,6 +173,8 @@
// //
// Language features: // Language features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(strict_provenance))]
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
#![feature(abi_unadjusted)] #![feature(abi_unadjusted)]
#![feature(adt_const_params)] #![feature(adt_const_params)]
#![feature(allow_internal_unsafe)] #![feature(allow_internal_unsafe)]

View File

@ -552,7 +552,7 @@ pub const fn wrapping_byte_offset(self, count: isize) -> Self {
/// ## Examples /// ## Examples
/// ///
/// ``` /// ```
/// #![feature(ptr_mask, strict_provenance)] /// #![feature(ptr_mask)]
/// let v = 17_u32; /// let v = 17_u32;
/// let ptr: *const u32 = &v; /// let ptr: *const u32 = &v;
/// ///

View File

@ -290,8 +290,6 @@
//! represent the tagged pointer as an actual pointer and not a `usize`*. For instance: //! represent the tagged pointer as an actual pointer and not a `usize`*. For instance:
//! //!
//! ``` //! ```
//! #![feature(strict_provenance)]
//!
//! unsafe { //! unsafe {
//! // A flag we want to pack into our pointer //! // A flag we want to pack into our pointer
//! static HAS_DATA: usize = 0x1; //! static HAS_DATA: usize = 0x1;

View File

@ -549,7 +549,7 @@ pub const fn wrapping_byte_offset(self, count: isize) -> Self {
/// ## Examples /// ## Examples
/// ///
/// ``` /// ```
/// #![feature(ptr_mask, strict_provenance)] /// #![feature(ptr_mask)]
/// let mut v = 17_u32; /// let mut v = 17_u32;
/// let ptr: *mut u32 = &mut v; /// let ptr: *mut u32 = &mut v;
/// ///

View File

@ -748,7 +748,6 @@ pub const fn cast<U>(self) -> NonNull<U> {
/// *Incorrect* usage: /// *Incorrect* usage:
/// ///
/// ```rust,no_run /// ```rust,no_run
/// #![feature(strict_provenance)]
/// use std::ptr::NonNull; /// use std::ptr::NonNull;
/// ///
/// let ptr1 = NonNull::new(Box::into_raw(Box::new(0u8))).unwrap(); /// let ptr1 = NonNull::new(Box::into_raw(Box::new(0u8))).unwrap();

View File

@ -1758,7 +1758,7 @@ pub fn fetch_update<F>(
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)] /// #![feature(strict_provenance_atomic_ptr)]
/// use core::sync::atomic::{AtomicPtr, Ordering}; /// use core::sync::atomic::{AtomicPtr, Ordering};
/// ///
/// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut()); /// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
@ -1838,7 +1838,7 @@ pub fn fetch_ptr_sub(&self, val: usize, order: Ordering) -> *mut T {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)] /// #![feature(strict_provenance_atomic_ptr)]
/// use core::sync::atomic::{AtomicPtr, Ordering}; /// use core::sync::atomic::{AtomicPtr, Ordering};
/// ///
/// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut()); /// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
@ -1874,7 +1874,7 @@ pub fn fetch_byte_add(&self, val: usize, order: Ordering) -> *mut T {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)] /// #![feature(strict_provenance_atomic_ptr)]
/// use core::sync::atomic::{AtomicPtr, Ordering}; /// use core::sync::atomic::{AtomicPtr, Ordering};
/// ///
/// let atom = AtomicPtr::<i64>::new(core::ptr::without_provenance_mut(1)); /// let atom = AtomicPtr::<i64>::new(core::ptr::without_provenance_mut(1));
@ -1919,7 +1919,7 @@ pub fn fetch_byte_sub(&self, val: usize, order: Ordering) -> *mut T {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)] /// #![feature(strict_provenance_atomic_ptr)]
/// use core::sync::atomic::{AtomicPtr, Ordering}; /// use core::sync::atomic::{AtomicPtr, Ordering};
/// ///
/// let pointer = &mut 3i64 as *mut i64; /// let pointer = &mut 3i64 as *mut i64;
@ -1970,7 +1970,7 @@ pub fn fetch_or(&self, val: usize, order: Ordering) -> *mut T {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)] /// #![feature(strict_provenance_atomic_ptr)]
/// use core::sync::atomic::{AtomicPtr, Ordering}; /// use core::sync::atomic::{AtomicPtr, Ordering};
/// ///
/// let pointer = &mut 3i64 as *mut i64; /// let pointer = &mut 3i64 as *mut i64;
@ -2020,7 +2020,7 @@ pub fn fetch_and(&self, val: usize, order: Ordering) -> *mut T {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)] /// #![feature(strict_provenance_atomic_ptr)]
/// use core::sync::atomic::{AtomicPtr, Ordering}; /// use core::sync::atomic::{AtomicPtr, Ordering};
/// ///
/// let pointer = &mut 3i64 as *mut i64; /// let pointer = &mut 3i64 as *mut i64;

View File

@ -1,4 +1,6 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(strict_provenance))]
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))] #![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
#![cfg_attr(test, feature(cfg_match))] #![cfg_attr(test, feature(cfg_match))]
#![feature(alloc_layout_extra)] #![feature(alloc_layout_extra)]
@ -85,7 +87,6 @@
#![feature(std_internals)] #![feature(std_internals)]
#![feature(step_trait)] #![feature(step_trait)]
#![feature(str_internals)] #![feature(str_internals)]
#![feature(strict_provenance)]
#![feature(strict_provenance_atomic_ptr)] #![feature(strict_provenance_atomic_ptr)]
#![feature(test)] #![feature(test)]
#![feature(trait_upcasting)] #![feature(trait_upcasting)]

View File

@ -19,8 +19,6 @@
#![feature(panic_unwind)] #![feature(panic_unwind)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(std_internals)] #![feature(std_internals)]
#![feature(strict_provenance)]
#![feature(exposed_provenance)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![panic_runtime] #![panic_runtime]
#![feature(panic_runtime)] #![feature(panic_runtime)]

View File

@ -9,7 +9,6 @@
repr_simd, repr_simd,
simd_ffi, simd_ffi,
staged_api, staged_api,
strict_provenance,
prelude_import, prelude_import,
ptr_metadata ptr_metadata
)] )]

View File

@ -1,4 +1,4 @@
#![feature(portable_simd, strict_provenance, exposed_provenance)] #![feature(portable_simd)]
use core_simd::simd::{ use core_simd::simd::{
ptr::{SimdConstPtr, SimdMutPtr}, ptr::{SimdConstPtr, SimdMutPtr},

View File

@ -32,7 +32,6 @@
#![feature(restricted_std)] #![feature(restricted_std)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(strict_provenance)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#![allow(internal_features)] #![allow(internal_features)]
#![deny(ffi_unwind_calls)] #![deny(ffi_unwind_calls)]

View File

@ -279,6 +279,8 @@
// //
// Language features: // Language features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(strict_provenance))]
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
#![feature(alloc_error_handler)] #![feature(alloc_error_handler)]
#![feature(allocator_internals)] #![feature(allocator_internals)]
#![feature(allow_internal_unsafe)] #![feature(allow_internal_unsafe)]
@ -336,7 +338,6 @@
#![feature(error_iter)] #![feature(error_iter)]
#![feature(exact_size_is_empty)] #![feature(exact_size_is_empty)]
#![feature(exclusive_wrapper)] #![feature(exclusive_wrapper)]
#![feature(exposed_provenance)]
#![feature(extend_one)] #![feature(extend_one)]
#![feature(float_gamma)] #![feature(float_gamma)]
#![feature(float_minimum_maximum)] #![feature(float_minimum_maximum)]
@ -362,7 +363,6 @@
#![feature(slice_range)] #![feature(slice_range)]
#![feature(std_internals)] #![feature(std_internals)]
#![feature(str_internals)] #![feature(str_internals)]
#![feature(strict_provenance)]
#![feature(strict_provenance_atomic_ptr)] #![feature(strict_provenance_atomic_ptr)]
#![feature(ub_checks)] #![feature(ub_checks)]
// tidy-alphabetical-end // tidy-alphabetical-end

View File

@ -2,7 +2,6 @@
#![unstable(feature = "panic_unwind", issue = "32837")] #![unstable(feature = "panic_unwind", issue = "32837")]
#![feature(link_cfg)] #![feature(link_cfg)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(strict_provenance)]
#![cfg_attr(not(target_env = "msvc"), feature(libc))] #![cfg_attr(not(target_env = "msvc"), feature(libc))]
#![cfg_attr( #![cfg_attr(
all(target_family = "wasm", not(target_os = "emscripten")), all(target_family = "wasm", not(target_os = "emscripten")),

View File

@ -1,18 +1,17 @@
# `strict_provenance` # `strict_provenance_lints`
The tracking issue for this feature is: [#95228] The tracking issue for this feature is: [#95228]
[#95228]: https://github.com/rust-lang/rust/issues/95228 [#95228]: https://github.com/rust-lang/rust/issues/95228
----- -----
The `strict_provenance` feature allows to enable the `fuzzy_provenance_casts` and `lossy_provenance_casts` lints. The `strict_provenance_lints` feature allows to enable the `fuzzy_provenance_casts` and `lossy_provenance_casts` lints.
These lint on casts between integers and pointers, that are recommended against or invalid in the strict provenance model. These lint on casts between integers and pointers, that are recommended against or invalid in the strict provenance model.
The same feature gate is also used for the experimental strict provenance API in `std` (actually `core`).
## Example ## Example
```rust ```rust
#![feature(strict_provenance)] #![feature(strict_provenance_lints)]
#![warn(fuzzy_provenance_casts)] #![warn(fuzzy_provenance_casts)]
fn main() { fn main() {

View File

@ -11,8 +11,6 @@
#![feature(let_chains)] #![feature(let_chains)]
#![feature(trait_upcasting)] #![feature(trait_upcasting)]
#![feature(strict_overflow_ops)] #![feature(strict_overflow_ops)]
#![feature(strict_provenance)]
#![feature(exposed_provenance)]
#![feature(pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
#![feature(unqualified_local_imports)] #![feature(unqualified_local_imports)]
// Configure clippy and other lints // Configure clippy and other lints

View File

@ -1,4 +1,3 @@
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
fn direct_raw(x: *const (i32, i32)) -> *const i32 { fn direct_raw(x: *const (i32, i32)) -> *const i32 {

View File

@ -1,6 +1,5 @@
// Should be caught even without retagging // Should be caught even without retagging
//@compile-flags: -Zmiri-disable-stacked-borrows //@compile-flags: -Zmiri-disable-stacked-borrows
#![feature(strict_provenance)]
use std::ptr::{self, addr_of_mut}; use std::ptr::{self, addr_of_mut};
// Deref'ing a dangling raw pointer is fine, but for a dangling box it is not. // Deref'ing a dangling raw pointer is fine, but for a dangling box it is not.

View File

@ -1,6 +1,5 @@
// Should be caught even without retagging // Should be caught even without retagging
//@compile-flags: -Zmiri-disable-stacked-borrows //@compile-flags: -Zmiri-disable-stacked-borrows
#![feature(strict_provenance)]
use std::ptr::{self, addr_of_mut}; use std::ptr::{self, addr_of_mut};
// Deref'ing a dangling raw pointer is fine, but for a dangling reference it is not. // Deref'ing a dangling raw pointer is fine, but for a dangling reference it is not.

View File

@ -1,4 +1,3 @@
#![feature(strict_provenance)]
use core::ptr; use core::ptr;
fn main() { fn main() {

View File

@ -1,4 +1,3 @@
#![feature(strict_provenance)]
use std::mem; use std::mem;
#[repr(C, usize)] #[repr(C, usize)]

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-permissive-provenance //@compile-flags: -Zmiri-permissive-provenance
#![feature(strict_provenance)]
use std::mem; use std::mem;

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-permissive-provenance //@compile-flags: -Zmiri-permissive-provenance
#![feature(strict_provenance, exposed_provenance)]
fn main() { fn main() {
let x: i32 = 3; let x: i32 = 3;

View File

@ -1,4 +1,3 @@
#![feature(strict_provenance, exposed_provenance)]
// Ensure that a `ptr::without_provenance` ptr is truly invalid. // Ensure that a `ptr::without_provenance` ptr is truly invalid.
fn main() { fn main() {

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-strict-provenance //@compile-flags: -Zmiri-strict-provenance
#![feature(strict_provenance)]
fn main() { fn main() {
let x = 22; let x = 22;

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-strict-provenance //@compile-flags: -Zmiri-strict-provenance
#![feature(exposed_provenance)]
fn main() { fn main() {
let addr = &0 as *const i32 as usize; let addr = &0 as *const i32 as usize;

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-permissive-provenance //@compile-flags: -Zmiri-permissive-provenance
#![feature(exposed_provenance)]
// If we have only exposed read-only pointers, doing a write through a wildcard ptr should fail. // If we have only exposed read-only pointers, doing a write through a wildcard ptr should fail.

View File

@ -1,6 +1,5 @@
//@compile-flags: -Zmiri-symbolic-alignment-check //@compile-flags: -Zmiri-symbolic-alignment-check
//@revisions: call_unaligned_ptr read_unaligned_ptr //@revisions: call_unaligned_ptr read_unaligned_ptr
#![feature(strict_provenance)]
#[path = "../../utils/mod.rs"] #[path = "../../utils/mod.rs"]
mod utils; mod utils;

View File

@ -1,7 +1,6 @@
//@compile-flags: -Zmiri-disable-validation //@compile-flags: -Zmiri-disable-validation
//@error-in-other-file: memory is uninitialized at [0x4..0x8] //@error-in-other-file: memory is uninitialized at [0x4..0x8]
//@normalize-stderr-test: "a[0-9]+" -> "ALLOC" //@normalize-stderr-test: "a[0-9]+" -> "ALLOC"
#![feature(strict_provenance)]
#![allow(dropping_copy_types)] #![allow(dropping_copy_types)]
// Test printing allocations that contain single-byte provenance. // Test printing allocations that contain single-byte provenance.

View File

@ -3,7 +3,6 @@
//@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4 //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4
#![feature(io_error_more)] #![feature(io_error_more)]
#![feature(pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
#![feature(strict_provenance)]
use std::mem::{size_of, size_of_val}; use std::mem::{size_of, size_of_val};

View File

@ -1,6 +1,5 @@
//@only-target: linux //@only-target: linux
#![feature(strict_provenance)]
use std::convert::TryInto; use std::convert::TryInto;
fn main() { fn main() {

View File

@ -1,4 +1,4 @@
#![feature(strict_provenance, pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
use std::{mem, ptr, slice}; use std::{mem, ptr, slice};
fn test_memcpy() { fn test_memcpy() {

View File

@ -2,7 +2,6 @@
//@compile-flags: -Zmiri-disable-isolation //@compile-flags: -Zmiri-disable-isolation
#![feature(io_error_more)] #![feature(io_error_more)]
#![feature(pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
#![feature(strict_provenance)]
use std::mem::transmute; use std::mem::transmute;

View File

@ -1,6 +1,5 @@
//@ignore-target: windows # No mmap on Windows //@ignore-target: windows # No mmap on Windows
//@compile-flags: -Zmiri-disable-isolation -Zmiri-permissive-provenance //@compile-flags: -Zmiri-disable-isolation -Zmiri-permissive-provenance
#![feature(strict_provenance)]
use std::io::Error; use std::io::Error;
use std::{ptr, slice}; use std::{ptr, slice};

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-symbolic-alignment-check //@compile-flags: -Zmiri-symbolic-alignment-check
#![feature(strict_provenance)]
use std::mem; use std::mem;

View File

@ -2,7 +2,7 @@
//@[tree]compile-flags: -Zmiri-tree-borrows //@[tree]compile-flags: -Zmiri-tree-borrows
//@compile-flags: -Zmiri-strict-provenance //@compile-flags: -Zmiri-strict-provenance
#![feature(strict_provenance, strict_provenance_atomic_ptr)] #![feature(strict_provenance_atomic_ptr)]
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint // FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
#![allow(static_mut_refs)] #![allow(static_mut_refs)]

View File

@ -5,7 +5,6 @@
//@revisions: stack tree //@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows //@[tree]compile-flags: -Zmiri-tree-borrows
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(strict_provenance)]
use std::alloc::{AllocError, Allocator, Layout}; use std::alloc::{AllocError, Allocator, Layout};
use std::cell::{Cell, UnsafeCell}; use std::cell::{Cell, UnsafeCell};

View File

@ -1,7 +1,6 @@
//! Regression test for <https://github.com/rust-lang/miri/issues/3450>: //! Regression test for <https://github.com/rust-lang/miri/issues/3450>:
//! When the address gets reused, there should be a happens-before relation. //! When the address gets reused, there should be a happens-before relation.
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=1.0 //@compile-flags: -Zmiri-address-reuse-cross-thread-rate=1.0
#![feature(strict_provenance)]
#![feature(sync_unsafe_cell)] #![feature(sync_unsafe_cell)]
use std::cell::SyncUnsafeCell; use std::cell::SyncUnsafeCell;

View File

@ -7,7 +7,6 @@
// MIR inlining will put every evaluation of the const we're repeatedly evaluating into the same // MIR inlining will put every evaluation of the const we're repeatedly evaluating into the same
// stack frame, breaking this test. // stack frame, breaking this test.
//@compile-flags: -Zinline-mir=no //@compile-flags: -Zinline-mir=no
#![feature(strict_provenance)]
const EVALS: usize = 256; const EVALS: usize = 256;

View File

@ -1,4 +1,4 @@
#![feature(custom_mir, core_intrinsics, strict_provenance)] #![feature(custom_mir, core_intrinsics)]
use std::intrinsics::mir::*; use std::intrinsics::mir::*;
// The `Drop` terminator on a type with no drop glue should be a NOP. // The `Drop` terminator on a type with no drop glue should be a NOP.

View File

@ -1,6 +1,6 @@
//@revisions: stack tree //@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows //@[tree]compile-flags: -Zmiri-tree-borrows
#![feature(extern_types, strict_provenance)] #![feature(extern_types)]
use std::ptr; use std::ptr;

View File

@ -1,6 +1,5 @@
//@revisions: stack tree //@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows //@[tree]compile-flags: -Zmiri-tree-borrows
#![feature(strict_provenance)]
use std::{mem, ptr}; use std::{mem, ptr};
const PTR_SIZE: usize = mem::size_of::<&i32>(); const PTR_SIZE: usize = mem::size_of::<&i32>();

View File

@ -2,7 +2,6 @@
// Tree Borrows doesn't support int2ptr casts, but let's make sure we don't immediately crash either. // Tree Borrows doesn't support int2ptr casts, but let's make sure we don't immediately crash either.
//@[tree]compile-flags: -Zmiri-tree-borrows //@[tree]compile-flags: -Zmiri-tree-borrows
//@[stack]compile-flags: -Zmiri-permissive-provenance //@[stack]compile-flags: -Zmiri-permissive-provenance
#![feature(strict_provenance, exposed_provenance)]
use std::ptr; use std::ptr;

View File

@ -1,4 +1,3 @@
#![feature(strict_provenance)]
use std::mem; use std::mem;
use std::ptr::{self, addr_of}; use std::ptr::{self, addr_of};

View File

@ -1,5 +1,4 @@
#![feature(ptr_mask)] #![feature(ptr_mask)]
#![feature(strict_provenance)]
fn main() { fn main() {
let v: u32 = 0xABCDABCD; let v: u32 = 0xABCDABCD;

View File

@ -4,7 +4,6 @@
#![feature(slice_as_chunks)] #![feature(slice_as_chunks)]
#![feature(slice_partition_dedup)] #![feature(slice_partition_dedup)]
#![feature(layout_for_ptr)] #![feature(layout_for_ptr)]
#![feature(strict_provenance)]
use std::{ptr, slice}; use std::{ptr, slice};

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-permissive-provenance //@compile-flags: -Zmiri-permissive-provenance
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
// Just to make sure that casting a ref to raw, to int and back to raw // Just to make sure that casting a ref to raw, to int and back to raw

View File

@ -2,7 +2,6 @@
// printing, not how it interacts with the GC. // printing, not how it interacts with the GC.
//@compile-flags: -Zmiri-permissive-provenance -Zmiri-provenance-gc=0 //@compile-flags: -Zmiri-permissive-provenance -Zmiri-provenance-gc=0
#![feature(strict_provenance)]
use std::alloc::{self, Layout}; use std::alloc::{self, Layout};
use std::mem::ManuallyDrop; use std::mem::ManuallyDrop;

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-permissive-provenance //@compile-flags: -Zmiri-permissive-provenance
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;

View File

@ -1,6 +1,5 @@
//@revisions: stack tree //@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows //@[tree]compile-flags: -Zmiri-tree-borrows
#![feature(strict_provenance)]
use std::{mem, ptr}; use std::{mem, ptr};
fn t1() { fn t1() {

View File

@ -1,5 +1,4 @@
// Various tests ensuring that underscore patterns really just construct the place, but don't check its contents. // Various tests ensuring that underscore patterns really just construct the place, but don't check its contents.
#![feature(strict_provenance)]
#![feature(never_type)] #![feature(never_type)]
use std::ptr; use std::ptr;

View File

@ -1,5 +1,4 @@
//! Tests specific for <https://github.com/rust-lang/rust/issues/117945>: zero-sized operations. //! Tests specific for <https://github.com/rust-lang/rust/issues/117945>: zero-sized operations.
#![feature(strict_provenance)]
use std::ptr; use std::ptr;

View File

@ -6,7 +6,6 @@
//@ compile-flags: -O -Cno-prepopulate-passes //@ compile-flags: -O -Cno-prepopulate-passes
#![crate_type = "lib"] #![crate_type = "lib"]
#![feature(strict_provenance)]
#![feature(strict_provenance_atomic_ptr)] #![feature(strict_provenance_atomic_ptr)]
use std::ptr::without_provenance_mut; use std::ptr::without_provenance_mut;

View File

@ -1,7 +1,6 @@
//@ compile-flags: -O -C debug-assertions=yes //@ compile-flags: -O -C debug-assertions=yes
#![crate_type = "lib"] #![crate_type = "lib"]
#![feature(strict_provenance)]
#[no_mangle] #[no_mangle]
pub fn test(src: *const u8, dst: *const u8) -> usize { pub fn test(src: *const u8, dst: *const u8) -> usize {

View File

@ -5,8 +5,6 @@
// Regression for <https://github.com/rust-lang/rust/issues/127089> // Regression for <https://github.com/rust-lang/rust/issues/127089>
#![feature(strict_provenance)]
struct Foo<T>(std::marker::PhantomData<T>); struct Foo<T>(std::marker::PhantomData<T>);
impl<T> Foo<T> { impl<T> Foo<T> {

View File

@ -2,8 +2,6 @@
//@ compile-flags: -Copt-level=2 //@ compile-flags: -Copt-level=2
//@ run-pass //@ run-pass
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -4,8 +4,6 @@
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908 // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
fn f() -> usize { fn f() -> usize {

View File

@ -4,8 +4,6 @@
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
#[inline(never)] #[inline(never)]

View File

@ -4,8 +4,6 @@
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
#[inline(never)] #[inline(never)]

View File

@ -4,8 +4,6 @@
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499 // https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -4,8 +4,6 @@
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499 // https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -4,8 +4,6 @@
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 // https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601
#![feature(exposed_provenance)]
use std::{ use std::{
cell::{Ref, RefCell}, cell::{Ref, RefCell},
ptr, ptr,

View File

@ -4,8 +4,6 @@
// Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 // Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601
#![feature(exposed_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -2,8 +2,6 @@
//@ compile-flags: -Copt-level=2 //@ compile-flags: -Copt-level=2
//@ run-pass //@ run-pass
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -4,8 +4,6 @@
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908 // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
fn f() -> usize { fn f() -> usize {

View File

@ -4,8 +4,6 @@
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
#[inline(never)] #[inline(never)]

View File

@ -4,8 +4,6 @@
// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340 // Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1432161340
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
#[inline(never)] #[inline(never)]

View File

@ -4,8 +4,6 @@
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499 // https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -4,8 +4,6 @@
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499 // https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -4,8 +4,6 @@
// https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 // https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601
#![feature(strict_provenance)]
use std::{ use std::{
cell::{Ref, RefCell}, cell::{Ref, RefCell},
ptr, ptr,

View File

@ -4,8 +4,6 @@
// Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601 // Derived from https://github.com/rust-lang/rust/issues/107975#issuecomment-1431758601
#![feature(strict_provenance)]
use std::ptr; use std::ptr;
fn main() { fn main() {

View File

@ -1,24 +1,24 @@
warning: unknown lint: `fuzzy_provenance_casts` warning: unknown lint: `fuzzy_provenance_casts`
--> $DIR/feature-gate-strict_provenance.rs:3:1 --> $DIR/feature-gate-strict_provenance_lints.rs:3:1
| |
LL | #![deny(fuzzy_provenance_casts)] LL | #![deny(fuzzy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the `fuzzy_provenance_casts` lint is unstable = note: the `fuzzy_provenance_casts` lint is unstable
= note: see issue #95228 <https://github.com/rust-lang/rust/issues/95228> for more information = note: see issue #130351 <https://github.com/rust-lang/rust/issues/130351> for more information
= help: add `#![feature(strict_provenance)]` to the crate attributes to enable = help: add `#![feature(strict_provenance_lints)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
= note: `#[warn(unknown_lints)]` on by default = note: `#[warn(unknown_lints)]` on by default
warning: unknown lint: `lossy_provenance_casts` warning: unknown lint: `lossy_provenance_casts`
--> $DIR/feature-gate-strict_provenance.rs:5:1 --> $DIR/feature-gate-strict_provenance_lints.rs:5:1
| |
LL | #![deny(lossy_provenance_casts)] LL | #![deny(lossy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the `lossy_provenance_casts` lint is unstable = note: the `lossy_provenance_casts` lint is unstable
= note: see issue #95228 <https://github.com/rust-lang/rust/issues/95228> for more information = note: see issue #130351 <https://github.com/rust-lang/rust/issues/130351> for more information
= help: add `#![feature(strict_provenance)]` to the crate attributes to enable = help: add `#![feature(strict_provenance_lints)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
warning: 2 warnings emitted warning: 2 warnings emitted

View File

@ -1,4 +1,4 @@
#![feature(strict_provenance)] #![feature(strict_provenance_lints)]
#![deny(fuzzy_provenance_casts)] #![deny(fuzzy_provenance_casts)]
fn main() { fn main() {

View File

@ -1,4 +1,4 @@
#![feature(strict_provenance)] #![feature(strict_provenance_lints)]
#![deny(lossy_provenance_casts)] #![deny(lossy_provenance_casts)]
fn main() { fn main() {

View File

@ -7,8 +7,6 @@
// that will fail on dereferencing of a pointer to u64 which is not 8-byte-aligned but is // that will fail on dereferencing of a pointer to u64 which is not 8-byte-aligned but is
// 4-byte-aligned. // 4-byte-aligned.
#![feature(strict_provenance)]
fn main() { fn main() {
let mut x = [0u64; 2]; let mut x = [0u64; 2];
let ptr = x.as_mut_ptr(); let ptr = x.as_mut_ptr();

View File

@ -1,8 +1,6 @@
//@ run-pass //@ run-pass
//@ compile-flags: -C debug-assertions //@ compile-flags: -C debug-assertions
#![feature(strict_provenance)]
#[repr(packed)] #[repr(packed)]
struct Misaligner { struct Misaligner {
_head: u8, _head: u8,

View File

@ -5,7 +5,6 @@
#![allow(dead_code)] #![allow(dead_code)]
#![feature(never_type)] #![feature(never_type)]
#![feature(pointer_is_aligned_to)] #![feature(pointer_is_aligned_to)]
#![feature(strict_provenance)]
use std::mem::size_of; use std::mem::size_of;
use std::num::NonZero; use std::num::NonZero;