Skip to content

Commit 040a77f

Browse files
committed
Auto merge of #29952 - petrochenkov:depr, r=brson
Part of #29935 The deprecation lint is still called "deprecated", so people can continue using `#[allow(deprecated)]` and similar things.
2 parents 8e9a975 + a613059 commit 040a77f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+126
-113
lines changed

src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ The currently implemented features of the reference compiler are:
23272327

23282328
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a
23292329
crate. Stability markers are also attributes: `#[stable]`,
2330-
`#[unstable]`, and `#[deprecated]` are the three levels.
2330+
`#[unstable]`, and `#[rustc_deprecated]` are the three levels.
23312331

23322332
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
23332333
into a Rust program. This capability, especially the signature for the

src/etc/featureck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
lang_stable_since = language_feature_stats[name][4]
207207
lib_stable_since = lib_feature_stats[name][4]
208208

209-
if lang_status != lib_status and lib_status != "deprecated":
209+
if lang_status != lib_status and lib_status != "rustc_deprecated":
210210
print("error: feature '%s' has lang status %s " +
211211
"but lib status %s" % (name, lang_status, lib_status))
212212
errors = True

src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl<T: ?Sized> Deref for Arc<T> {
385385
impl<T: Clone> Arc<T> {
386386
#[unstable(feature = "arc_make_unique", reason = "renamed to Arc::make_mut",
387387
issue = "27718")]
388-
#[deprecated(since = "1.4.0", reason = "renamed to Arc::make_mut")]
388+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to Arc::make_mut")]
389389
pub fn make_unique(this: &mut Self) -> &mut T {
390390
Arc::make_mut(this)
391391
}

src/liballoc/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
#![no_std]
7575
#![cfg_attr(not(stage0), needs_allocator)]
7676

77+
#![cfg_attr(stage0, feature(rustc_attrs))]
78+
#![cfg_attr(stage0, allow(unused_attributes))]
7779
#![feature(allocator)]
7880
#![feature(box_syntax)]
7981
#![feature(coerce_unsized)]

src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl<T: Clone> Rc<T> {
362362
#[inline]
363363
#[unstable(feature = "rc_make_unique", reason = "renamed to Rc::make_mut",
364364
issue = "27718")]
365-
#[deprecated(since = "1.4.0", reason = "renamed to Rc::make_mut")]
365+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to Rc::make_mut")]
366366
pub fn make_unique(&mut self) -> &mut T {
367367
Rc::make_mut(self)
368368
}

src/libcollections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<T: Ord> BinaryHeap<T> {
241241
#[unstable(feature = "binary_heap_extras",
242242
reason = "needs to be audited",
243243
issue = "28147")]
244-
#[deprecated(since = "1.5.0", reason = "use BinaryHeap::from instead")]
244+
#[rustc_deprecated(since = "1.5.0", reason = "use BinaryHeap::from instead")]
245245
pub fn from_vec(vec: Vec<T>) -> BinaryHeap<T> {
246246
BinaryHeap::from(vec)
247247
}

src/libcollections/btree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
161161
#[unstable(feature = "btree_b",
162162
reason = "probably want this to be on the type, eventually",
163163
issue = "27795")]
164-
#[deprecated(since = "1.4.0", reason = "niche API")]
164+
#[rustc_deprecated(since = "1.4.0", reason = "niche API")]
165165
pub fn with_b(b: usize) -> BTreeMap<K, V> {
166166
assert!(b > 1, "B must be greater than 1");
167167
BTreeMap {

src/libcollections/btree/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<T: Ord> BTreeSet<T> {
105105
#[unstable(feature = "btree_b",
106106
reason = "probably want this to be on the type, eventually",
107107
issue = "27795")]
108-
#[deprecated(since = "1.4.0", reason = "niche API")]
108+
#[rustc_deprecated(since = "1.4.0", reason = "niche API")]
109109
#[allow(deprecated)]
110110
pub fn with_b(b: usize) -> BTreeSet<T> {
111111
BTreeSet { map: BTreeMap::with_b(b) }

src/libcollections/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
// SNAP 1af31d4
3838
#![allow(unused_attributes)]
3939

40+
#![cfg_attr(stage0, feature(rustc_attrs))]
41+
#![cfg_attr(stage0, allow(unused_attributes))]
4042
#![feature(alloc)]
4143
#![feature(box_patterns)]
4244
#![feature(box_syntax)]

src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ pub trait SliceConcatExt<T: ?Sized> {
862862
/// assert_eq!(["hello", "world"].connect(" "), "hello world");
863863
/// ```
864864
#[stable(feature = "rust1", since = "1.0.0")]
865-
#[deprecated(since = "1.3.0", reason = "renamed to join")]
865+
#[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
866866
fn connect(&self, sep: &T) -> Self::Output;
867867
}
868868

src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl str {
665665
/// assert_eq!(v, ["foo", "bar", "", "baz"]);
666666
/// ```
667667
#[stable(feature = "rust1", since = "1.0.0")]
668-
#[deprecated(since = "1.4.0", reason = "use lines() instead now")]
668+
#[rustc_deprecated(since = "1.4.0", reason = "use lines() instead now")]
669669
#[inline]
670670
#[allow(deprecated)]
671671
pub fn lines_any(&self) -> LinesAny {

src/libcollections/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ impl String {
842842
#[unstable(feature = "box_str2",
843843
reason = "recently added, matches RFC",
844844
issue = "27785")]
845-
#[deprecated(since = "1.4.0", reason = "renamed to `into_boxed_str`")]
845+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to `into_boxed_str`")]
846846
pub fn into_boxed_slice(self) -> Box<str> {
847847
self.into_boxed_str()
848848
}

src/libcollections/vec_deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ impl<T> VecDeque<T> {
10581058
#[unstable(feature = "deque_extras",
10591059
reason = "the naming of this function may be altered",
10601060
issue = "27788")]
1061-
#[deprecated(since = "1.5.0", reason = "renamed to swap_remove_back")]
1061+
#[rustc_deprecated(since = "1.5.0", reason = "renamed to swap_remove_back")]
10621062
pub fn swap_back_remove(&mut self, index: usize) -> Option<T> {
10631063
self.swap_remove_back(index)
10641064
}
@@ -1101,7 +1101,7 @@ impl<T> VecDeque<T> {
11011101
#[unstable(feature = "deque_extras",
11021102
reason = "the naming of this function may be altered",
11031103
issue = "27788")]
1104-
#[deprecated(since = "1.5.0", reason = "renamed to swap_remove_front")]
1104+
#[rustc_deprecated(since = "1.5.0", reason = "renamed to swap_remove_front")]
11051105
pub fn swap_front_remove(&mut self, index: usize) -> Option<T> {
11061106
self.swap_remove_front(index)
11071107
}

src/libcore/iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,7 +4303,7 @@ impl<A> Iterator for StepBy<A, RangeFrom<A>> where
43034303
#[unstable(feature = "range_inclusive",
43044304
reason = "likely to be replaced by range notation and adapters",
43054305
issue = "27777")]
4306-
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
4306+
#[rustc_deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
43074307
#[allow(deprecated)]
43084308
pub struct RangeInclusive<A> {
43094309
range: ops::Range<A>,
@@ -4315,7 +4315,7 @@ pub struct RangeInclusive<A> {
43154315
#[unstable(feature = "range_inclusive",
43164316
reason = "likely to be replaced by range notation and adapters",
43174317
issue = "27777")]
4318-
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
4318+
#[rustc_deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
43194319
#[allow(deprecated)]
43204320
pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A>
43214321
where A: Step + One + Clone
@@ -4329,7 +4329,7 @@ pub fn range_inclusive<A>(start: A, stop: A) -> RangeInclusive<A>
43294329
#[unstable(feature = "range_inclusive",
43304330
reason = "likely to be replaced by range notation and adapters",
43314331
issue = "27777")]
4332-
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
4332+
#[rustc_deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
43334333
#[allow(deprecated)]
43344334
impl<A> Iterator for RangeInclusive<A> where
43354335
A: PartialEq + Step + One + Clone,
@@ -4365,7 +4365,7 @@ impl<A> Iterator for RangeInclusive<A> where
43654365
#[unstable(feature = "range_inclusive",
43664366
reason = "likely to be replaced by range notation and adapters",
43674367
issue = "27777")]
4368-
#[deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
4368+
#[rustc_deprecated(since = "1.5.0", reason = "replaced with ... syntax")]
43694369
#[allow(deprecated)]
43704370
impl<A> DoubleEndedIterator for RangeInclusive<A> where
43714371
A: PartialEq + Step + One + Clone,
@@ -4743,7 +4743,7 @@ pub fn once<T>(value: T) -> Once<T> {
47434743
///
47444744
/// If two sequences are equal up until the point where one ends,
47454745
/// the shorter sequence compares less.
4746-
#[deprecated(since = "1.4.0", reason = "use the equivalent methods on `Iterator` instead")]
4746+
#[rustc_deprecated(since = "1.4.0", reason = "use the equivalent methods on `Iterator` instead")]
47474747
#[unstable(feature = "iter_order_deprecated", reason = "needs review and revision",
47484748
issue = "27737")]
47494749
pub mod order {

src/libcore/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
#![no_core]
6969
#![deny(missing_docs)]
7070

71+
#![cfg_attr(stage0, feature(rustc_attrs))]
72+
#![cfg_attr(stage0, allow(unused_attributes))]
7173
#![feature(allow_internal_unstable)]
7274
#![feature(associated_type_defaults)]
7375
#![feature(concat_idents)]
@@ -80,7 +82,6 @@
8082
#![feature(on_unimplemented)]
8183
#![feature(optin_builtin_traits)]
8284
#![feature(reflect)]
83-
#![feature(rustc_attrs)]
8485
#![feature(unwind_attributes)]
8586
#![cfg_attr(stage0, feature(simd))]
8687
#![cfg_attr(not(stage0), feature(repr_simd, platform_intrinsics))]

src/libcore/mem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn size_of_val<T: ?Sized>(val: &T) -> usize {
159159
/// ```
160160
#[inline]
161161
#[stable(feature = "rust1", since = "1.0.0")]
162-
#[deprecated(reason = "use `align_of` instead", since = "1.2.0")]
162+
#[rustc_deprecated(reason = "use `align_of` instead", since = "1.2.0")]
163163
pub fn min_align_of<T>() -> usize {
164164
unsafe { intrinsics::min_align_of::<T>() }
165165
}
@@ -176,7 +176,7 @@ pub fn min_align_of<T>() -> usize {
176176
/// ```
177177
#[inline]
178178
#[stable(feature = "rust1", since = "1.0.0")]
179-
#[deprecated(reason = "use `align_of_val` instead", since = "1.2.0")]
179+
#[rustc_deprecated(reason = "use `align_of_val` instead", since = "1.2.0")]
180180
pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
181181
unsafe { intrinsics::min_align_of_val(val) }
182182
}

src/libcore/option.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<T> Option<T> {
290290
#[unstable(feature = "as_slice",
291291
reason = "waiting for mut conventions",
292292
issue = "27776")]
293-
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
293+
#[rustc_deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
294294
#[allow(deprecated)]
295295
pub fn as_mut_slice(&mut self) -> &mut [T] {
296296
match *self {
@@ -695,7 +695,7 @@ impl<T> Option<T> {
695695
#[inline]
696696
#[unstable(feature = "as_slice", reason = "unsure of the utility here",
697697
issue = "27776")]
698-
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
698+
#[rustc_deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
699699
#[allow(deprecated)]
700700
pub fn as_slice(&self) -> &[T] {
701701
match *self {

src/libcore/result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl<T, E> Result<T, E> {
410410
#[inline]
411411
#[unstable(feature = "as_slice", reason = "unsure of the utility here",
412412
issue = "27776")]
413-
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
413+
#[rustc_deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
414414
#[allow(deprecated)]
415415
pub fn as_slice(&self) -> &[T] {
416416
match *self {
@@ -445,7 +445,7 @@ impl<T, E> Result<T, E> {
445445
#[unstable(feature = "as_slice",
446446
reason = "waiting for mut conventions",
447447
issue = "27776")]
448-
#[deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
448+
#[rustc_deprecated(since = "1.4.0", reason = "niche API, unclear of usefulness")]
449449
#[allow(deprecated)]
450450
pub fn as_mut_slice(&mut self) -> &mut [T] {
451451
match *self {

src/libcore/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#![unstable(feature = "core_simd",
2525
reason = "needs an RFC to flesh out the design",
2626
issue = "27731")]
27-
#![deprecated(since = "1.3.0",
27+
#![rustc_deprecated(since = "1.3.0",
2828
reason = "use the external `simd` crate instead")]
2929

3030
#![allow(non_camel_case_types)]

src/libcore/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ impl<'a, T> ExactSizeIterator for ChunksMut<'a, T> {}
14411441

14421442
/// Converts a reference to A into a slice of length 1 (without copying).
14431443
#[unstable(feature = "ref_slice", issue = "27774")]
1444-
#[deprecated(since = "1.5.0", reason = "unclear whether belongs in libstd")]
1444+
#[rustc_deprecated(since = "1.5.0", reason = "unclear whether belongs in libstd")]
14451445
pub fn ref_slice<A>(s: &A) -> &[A] {
14461446
unsafe {
14471447
from_raw_parts(s, 1)
@@ -1450,7 +1450,7 @@ pub fn ref_slice<A>(s: &A) -> &[A] {
14501450

14511451
/// Converts a reference to A into a slice of length 1 (without copying).
14521452
#[unstable(feature = "ref_slice", issue = "27774")]
1453-
#[deprecated(since = "1.5.0", reason = "unclear whether belongs in libstd")]
1453+
#[rustc_deprecated(since = "1.5.0", reason = "unclear whether belongs in libstd")]
14541454
pub fn mut_ref_slice<A>(s: &mut A) -> &mut [A] {
14551455
unsafe {
14561456
from_raw_parts_mut(s, 1)

src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ impl<'a> DoubleEndedIterator for Lines<'a> {
962962

963963
/// Created with the method `.lines_any()`.
964964
#[stable(feature = "rust1", since = "1.0.0")]
965-
#[deprecated(since = "1.4.0", reason = "use lines()/Lines instead now")]
965+
#[rustc_deprecated(since = "1.4.0", reason = "use lines()/Lines instead now")]
966966
#[derive(Clone)]
967967
#[allow(deprecated)]
968968
pub struct LinesAny<'a>(Lines<'a>);

src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'a, 'tcx: 'a> Annotator<'a, 'tcx> {
162162
// Emit errors for non-staged-api crates.
163163
for attr in attrs {
164164
let tag = attr.name();
165-
if tag == "unstable" || tag == "stable" || tag == "deprecated" {
165+
if tag == "unstable" || tag == "stable" || tag == "rustc_deprecated" {
166166
attr::mark_used(attr);
167167
self.tcx.sess.span_err(attr.span(), "stability attributes may not be used \
168168
outside of the standard library");

src/librustc_lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,10 @@ impl LateLintPass for MissingDebugImplementations {
577577
declare_lint! {
578578
DEPRECATED,
579579
Warn,
580-
"detects use of #[deprecated] items"
580+
"detects use of #[rustc_deprecated] items"
581581
}
582582

583-
/// Checks for use of items with `#[deprecated]` attributes
583+
/// Checks for use of items with `#[rustc_deprecated]` attributes
584584
#[derive(Copy, Clone)]
585585
pub struct Stability;
586586

src/librustc_unicode/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
3535
#![no_std]
3636

37+
#![cfg_attr(stage0, feature(rustc_attrs))]
38+
#![cfg_attr(stage0, allow(unused_attributes))]
3739
#![feature(core_char_ext)]
3840
#![feature(core_slice_ext)]
3941
#![feature(core_str_ext)]

src/librustc_unicode/u_str.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn is_utf16(v: &[u16]) -> bool {
129129

130130
/// An iterator that decodes UTF-16 encoded codepoints from a vector
131131
/// of `u16`s.
132-
#[deprecated(since = "1.4.0", reason = "renamed to `char::DecodeUtf16`")]
132+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to `char::DecodeUtf16`")]
133133
#[unstable(feature = "decode_utf16", reason = "not exposed in std", issue = "27830")]
134134
#[allow(deprecated)]
135135
#[derive(Clone)]
@@ -138,7 +138,8 @@ pub struct Utf16Items<'a> {
138138
}
139139

140140
/// The possibilities for values decoded from a `u16` stream.
141-
#[deprecated(since = "1.4.0", reason = "`char::DecodeUtf16` uses `Result<char, u16>` instead")]
141+
#[rustc_deprecated(since = "1.4.0",
142+
reason = "`char::DecodeUtf16` uses `Result<char, u16>` instead")]
142143
#[unstable(feature = "decode_utf16", reason = "not exposed in std", issue = "27830")]
143144
#[allow(deprecated)]
144145
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
@@ -162,7 +163,7 @@ impl Utf16Item {
162163
}
163164
}
164165

165-
#[deprecated(since = "1.4.0", reason = "use `char::DecodeUtf16` instead")]
166+
#[rustc_deprecated(since = "1.4.0", reason = "use `char::DecodeUtf16` instead")]
166167
#[unstable(feature = "decode_utf16", reason = "not exposed in std", issue = "27830")]
167168
#[allow(deprecated)]
168169
impl<'a> Iterator for Utf16Items<'a> {
@@ -210,7 +211,7 @@ impl<'a> Iterator for Utf16Items<'a> {
210211
/// LoneSurrogate(0xD834)]);
211212
/// }
212213
/// ```
213-
#[deprecated(since = "1.4.0", reason = "renamed to `char::decode_utf16`")]
214+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to `char::decode_utf16`")]
214215
#[unstable(feature = "decode_utf16", reason = "not exposed in std", issue = "27830")]
215216
#[allow(deprecated)]
216217
pub fn utf16_items<'a>(v: &'a [u16]) -> Utf16Items<'a> {

src/libstd/dynamic_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
reason = "API has not been scrutinized and is highly likely to \
1717
either disappear or change",
1818
issue = "27810")]
19-
#![deprecated(since = "1.5.0", reason = "replaced with crates.io crates")]
19+
#![rustc_deprecated(since = "1.5.0", reason = "replaced with crates.io crates")]
2020
#![allow(missing_docs)]
2121
#![allow(deprecated)]
2222

src/libstd/ffi/c_str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl CString {
213213
/// using the pointer.
214214
#[unstable(feature = "cstr_memory2", reason = "recently added",
215215
issue = "27769")]
216-
#[deprecated(since = "1.4.0", reason = "renamed to from_raw")]
216+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to from_raw")]
217217
pub unsafe fn from_ptr(ptr: *const c_char) -> CString {
218218
CString::from_raw(ptr as *mut _)
219219
}
@@ -240,7 +240,7 @@ impl CString {
240240
/// Failure to call `from_raw` will lead to a memory leak.
241241
#[unstable(feature = "cstr_memory2", reason = "recently added",
242242
issue = "27769")]
243-
#[deprecated(since = "1.4.0", reason = "renamed to into_raw")]
243+
#[rustc_deprecated(since = "1.4.0", reason = "renamed to into_raw")]
244244
pub fn into_ptr(self) -> *const c_char {
245245
self.into_raw() as *const _
246246
}

src/libstd/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ pub fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<(
922922
/// # Ok(())
923923
/// # }
924924
/// ```
925-
#[deprecated(since = "1.1.0",
925+
#[rustc_deprecated(since = "1.1.0",
926926
reason = "replaced with std::os::unix::fs::symlink and \
927927
std::os::windows::fs::{symlink_file, symlink_dir}")]
928928
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1176,7 +1176,7 @@ impl Iterator for WalkDir {
11761176
change and some methods may be removed. For stable code, \
11771177
see the std::fs::metadata function.",
11781178
issue = "27725")]
1179-
#[deprecated(since = "1.5.0", reason = "replaced with inherent methods")]
1179+
#[rustc_deprecated(since = "1.5.0", reason = "replaced with inherent methods")]
11801180
pub trait PathExt {
11811181
/// Gets information on the file, directory, etc at this path.
11821182
///

src/libstd/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@
216216
#![cfg_attr(stage0, allow(unused_attributes))]
217217
#![cfg_attr(stage0, allow(improper_ctypes))]
218218

219+
#![cfg_attr(stage0, feature(rustc_attrs))]
220+
#![cfg_attr(stage0, allow(unused_attributes))]
219221
#![feature(alloc)]
220222
#![feature(allow_internal_unstable)]
221223
#![feature(asm)]

0 commit comments

Comments
 (0)