Skip to content

Commit 6d2a437

Browse files
committed
move strict provenance lints to new feature gate, remove old feature gates
1 parent 4461171 commit 6d2a437

File tree

17 files changed

+21
-25
lines changed

17 files changed

+21
-25
lines changed

Diff for: alloc/benches/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#![feature(iter_next_chunk)]
55
#![feature(repr_simd)]
66
#![feature(slice_partition_dedup)]
7-
#![feature(strict_provenance)]
7+
#![cfg_attr(bootstrap, feature(strict_provenance))]
8+
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
89
#![feature(test)]
910
#![deny(fuzzy_provenance_casts)]
1011

Diff for: alloc/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
#![feature(slice_range)]
148148
#![feature(std_internals)]
149149
#![feature(str_internals)]
150-
#![feature(strict_provenance)]
151150
#![feature(trusted_fused)]
152151
#![feature(trusted_len)]
153152
#![feature(trusted_random_access)]
@@ -162,6 +161,8 @@
162161
//
163162
// Language features:
164163
// tidy-alphabetical-start
164+
#![cfg_attr(bootstrap, feature(strict_provenance))]
165+
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
165166
#![cfg_attr(not(test), feature(coroutine_trait))]
166167
#![cfg_attr(test, feature(panic_update_hook))]
167168
#![cfg_attr(test, feature(test))]

Diff for: alloc/tests/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
#![feature(panic_update_hook)]
3333
#![feature(pointer_is_aligned_to)]
3434
#![feature(thin_box)]
35-
#![feature(strict_provenance)]
35+
#![cfg_attr(bootstrap, feature(strict_provenance))]
36+
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
3637
#![feature(drain_keep_rest)]
3738
#![feature(local_waker)]
3839
#![feature(vec_pop_if)]

Diff for: core/src/intrinsics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,6 @@ where
27942794
/// #![feature(is_val_statically_known)]
27952795
/// #![feature(core_intrinsics)]
27962796
/// # #![allow(internal_features)]
2797-
/// #![feature(strict_provenance)]
27982797
/// use std::intrinsics::is_val_statically_known;
27992798
///
28002799
/// fn foo(x: &i32) -> bool {

Diff for: core/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
#![feature(str_internals)]
164164
#![feature(str_split_inclusive_remainder)]
165165
#![feature(str_split_remainder)]
166-
#![feature(strict_provenance)]
167166
#![feature(ub_checks)]
168167
#![feature(unchecked_neg)]
169168
#![feature(unchecked_shifts)]
@@ -174,6 +173,8 @@
174173
//
175174
// Language features:
176175
// tidy-alphabetical-start
176+
#![cfg_attr(bootstrap, feature(strict_provenance))]
177+
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
177178
#![feature(abi_unadjusted)]
178179
#![feature(adt_const_params)]
179180
#![feature(allow_internal_unsafe)]

Diff for: core/src/ptr/const_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ impl<T: ?Sized> *const T {
552552
/// ## Examples
553553
///
554554
/// ```
555-
/// #![feature(ptr_mask, strict_provenance)]
555+
/// #![feature(ptr_mask)]
556556
/// let v = 17_u32;
557557
/// let ptr: *const u32 = &v;
558558
///

Diff for: core/src/ptr/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@
290290
//! represent the tagged pointer as an actual pointer and not a `usize`*. For instance:
291291
//!
292292
//! ```
293-
//! #![feature(strict_provenance)]
294-
//!
295293
//! unsafe {
296294
//! // A flag we want to pack into our pointer
297295
//! static HAS_DATA: usize = 0x1;

Diff for: core/src/ptr/mut_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ impl<T: ?Sized> *mut T {
549549
/// ## Examples
550550
///
551551
/// ```
552-
/// #![feature(ptr_mask, strict_provenance)]
552+
/// #![feature(ptr_mask)]
553553
/// let mut v = 17_u32;
554554
/// let ptr: *mut u32 = &mut v;
555555
///

Diff for: core/src/ptr/non_null.rs

-1
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ impl<T: ?Sized> NonNull<T> {
748748
/// *Incorrect* usage:
749749
///
750750
/// ```rust,no_run
751-
/// #![feature(strict_provenance)]
752751
/// use std::ptr::NonNull;
753752
///
754753
/// let ptr1 = NonNull::new(Box::into_raw(Box::new(0u8))).unwrap();

Diff for: core/src/sync/atomic.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ impl<T> AtomicPtr<T> {
17581758
/// # Examples
17591759
///
17601760
/// ```
1761-
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)]
1761+
/// #![feature(strict_provenance_atomic_ptr)]
17621762
/// use core::sync::atomic::{AtomicPtr, Ordering};
17631763
///
17641764
/// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
@@ -1838,7 +1838,7 @@ impl<T> AtomicPtr<T> {
18381838
/// # Examples
18391839
///
18401840
/// ```
1841-
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)]
1841+
/// #![feature(strict_provenance_atomic_ptr)]
18421842
/// use core::sync::atomic::{AtomicPtr, Ordering};
18431843
///
18441844
/// let atom = AtomicPtr::<i64>::new(core::ptr::null_mut());
@@ -1874,7 +1874,7 @@ impl<T> AtomicPtr<T> {
18741874
/// # Examples
18751875
///
18761876
/// ```
1877-
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)]
1877+
/// #![feature(strict_provenance_atomic_ptr)]
18781878
/// use core::sync::atomic::{AtomicPtr, Ordering};
18791879
///
18801880
/// let atom = AtomicPtr::<i64>::new(core::ptr::without_provenance_mut(1));
@@ -1919,7 +1919,7 @@ impl<T> AtomicPtr<T> {
19191919
/// # Examples
19201920
///
19211921
/// ```
1922-
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)]
1922+
/// #![feature(strict_provenance_atomic_ptr)]
19231923
/// use core::sync::atomic::{AtomicPtr, Ordering};
19241924
///
19251925
/// let pointer = &mut 3i64 as *mut i64;
@@ -1970,7 +1970,7 @@ impl<T> AtomicPtr<T> {
19701970
/// # Examples
19711971
///
19721972
/// ```
1973-
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)]
1973+
/// #![feature(strict_provenance_atomic_ptr)]
19741974
/// use core::sync::atomic::{AtomicPtr, Ordering};
19751975
///
19761976
/// let pointer = &mut 3i64 as *mut i64;
@@ -2020,7 +2020,7 @@ impl<T> AtomicPtr<T> {
20202020
/// # Examples
20212021
///
20222022
/// ```
2023-
/// #![feature(strict_provenance_atomic_ptr, strict_provenance)]
2023+
/// #![feature(strict_provenance_atomic_ptr)]
20242024
/// use core::sync::atomic::{AtomicPtr, Ordering};
20252025
///
20262026
/// let pointer = &mut 3i64 as *mut i64;

Diff for: core/tests/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// tidy-alphabetical-start
2+
#![cfg_attr(bootstrap, feature(strict_provenance))]
3+
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
24
#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
35
#![cfg_attr(test, feature(cfg_match))]
46
#![feature(alloc_layout_extra)]
@@ -85,7 +87,6 @@
8587
#![feature(std_internals)]
8688
#![feature(step_trait)]
8789
#![feature(str_internals)]
88-
#![feature(strict_provenance)]
8990
#![feature(strict_provenance_atomic_ptr)]
9091
#![feature(test)]
9192
#![feature(trait_upcasting)]

Diff for: panic_unwind/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#![feature(panic_unwind)]
2020
#![feature(staged_api)]
2121
#![feature(std_internals)]
22-
#![feature(strict_provenance)]
23-
#![feature(exposed_provenance)]
2422
#![feature(rustc_attrs)]
2523
#![panic_runtime]
2624
#![feature(panic_runtime)]

Diff for: portable-simd/crates/core_simd/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
repr_simd,
1010
simd_ffi,
1111
staged_api,
12-
strict_provenance,
1312
prelude_import,
1413
ptr_metadata
1514
)]

Diff for: portable-simd/crates/core_simd/tests/pointers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(portable_simd, strict_provenance, exposed_provenance)]
1+
#![feature(portable_simd)]
22

33
use core_simd::simd::{
44
ptr::{SimdConstPtr, SimdMutPtr},

Diff for: proc_macro/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(restricted_std)]
3333
#![feature(rustc_attrs)]
3434
#![feature(min_specialization)]
35-
#![feature(strict_provenance)]
3635
#![recursion_limit = "256"]
3736
#![allow(internal_features)]
3837
#![deny(ffi_unwind_calls)]

Diff for: std/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@
279279
//
280280
// Language features:
281281
// tidy-alphabetical-start
282+
#![cfg_attr(bootstrap, feature(strict_provenance))]
283+
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
282284
#![feature(alloc_error_handler)]
283285
#![feature(allocator_internals)]
284286
#![feature(allow_internal_unsafe)]
@@ -336,7 +338,6 @@
336338
#![feature(error_iter)]
337339
#![feature(exact_size_is_empty)]
338340
#![feature(exclusive_wrapper)]
339-
#![feature(exposed_provenance)]
340341
#![feature(extend_one)]
341342
#![feature(float_gamma)]
342343
#![feature(float_minimum_maximum)]
@@ -362,7 +363,6 @@
362363
#![feature(slice_range)]
363364
#![feature(std_internals)]
364365
#![feature(str_internals)]
365-
#![feature(strict_provenance)]
366366
#![feature(strict_provenance_atomic_ptr)]
367367
#![feature(ub_checks)]
368368
// tidy-alphabetical-end

Diff for: unwind/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![unstable(feature = "panic_unwind", issue = "32837")]
33
#![feature(link_cfg)]
44
#![feature(staged_api)]
5-
#![feature(strict_provenance)]
65
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
76
#![cfg_attr(
87
all(target_family = "wasm", not(target_os = "emscripten")),

0 commit comments

Comments
 (0)