Skip to content

Commit d430461

Browse files
authored
Rollup merge of rust-lang#142158 - xizheyin:141617, r=jdonszelmann
Tracking the old name of renamed unstable library features This PR resolves the first problem of rust-lang#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification. r? `@jdonszelmann` There have been a lot of PR's reviewed by you lately, thanks for your time! cc `@jyn514`
2 parents 5c3c860 + 05269b7 commit d430461

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

core/src/ops/control_flow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub enum ControlFlow<B, C = ()> {
9898
// is a no-op conversion in the `Try` implementation.
9999
}
100100

101-
#[unstable(feature = "try_trait_v2", issue = "84277")]
101+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
102102
impl<B, C> ops::Try for ControlFlow<B, C> {
103103
type Output = C;
104104
type Residual = ControlFlow<B, convert::Infallible>;
@@ -117,7 +117,7 @@ impl<B, C> ops::Try for ControlFlow<B, C> {
117117
}
118118
}
119119

120-
#[unstable(feature = "try_trait_v2", issue = "84277")]
120+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
121121
// Note: manually specifying the residual type instead of using the default to work around
122122
// https://github.com/rust-lang/rust/issues/99940
123123
impl<B, C> ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {

core/src/ops/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub use self::try_trait::Residual;
194194
#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
195195
pub use self::try_trait::Yeet;
196196
pub(crate) use self::try_trait::{ChangeOutputType, NeverShortCircuit};
197-
#[unstable(feature = "try_trait_v2", issue = "84277")]
197+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
198198
pub use self::try_trait::{FromResidual, Try};
199199
#[unstable(feature = "coerce_unsized", issue = "18598")]
200200
pub use self::unsize::CoerceUnsized;

core/src/ops/try_trait.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use crate::ops::ControlFlow;
112112
/// R::from_output(accum)
113113
/// }
114114
/// ```
115-
#[unstable(feature = "try_trait_v2", issue = "84277")]
115+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
116116
#[rustc_on_unimplemented(
117117
on(
118118
all(from_desugaring = "TryBlock"),
@@ -130,7 +130,7 @@ use crate::ops::ControlFlow;
130130
#[lang = "Try"]
131131
pub trait Try: FromResidual {
132132
/// The type of the value produced by `?` when *not* short-circuiting.
133-
#[unstable(feature = "try_trait_v2", issue = "84277")]
133+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
134134
type Output;
135135

136136
/// The type of the value passed to [`FromResidual::from_residual`]
@@ -154,7 +154,7 @@ pub trait Try: FromResidual {
154154
/// then typically you can use `Foo<std::convert::Infallible>` as its `Residual`
155155
/// type: that type will have a "hole" in the correct place, and will maintain the
156156
/// "foo-ness" of the residual so other types need to opt-in to interconversion.
157-
#[unstable(feature = "try_trait_v2", issue = "84277")]
157+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
158158
type Residual;
159159

160160
/// Constructs the type from its `Output` type.
@@ -186,7 +186,7 @@ pub trait Try: FromResidual {
186186
/// assert_eq!(r, Some(4));
187187
/// ```
188188
#[lang = "from_output"]
189-
#[unstable(feature = "try_trait_v2", issue = "84277")]
189+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
190190
fn from_output(output: Self::Output) -> Self;
191191

192192
/// Used in `?` to decide whether the operator should produce a value
@@ -213,7 +213,7 @@ pub trait Try: FromResidual {
213213
/// );
214214
/// ```
215215
#[lang = "branch"]
216-
#[unstable(feature = "try_trait_v2", issue = "84277")]
216+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
217217
fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
218218
}
219219

@@ -303,7 +303,7 @@ pub trait Try: FromResidual {
303303
),
304304
)]
305305
#[rustc_diagnostic_item = "FromResidual"]
306-
#[unstable(feature = "try_trait_v2", issue = "84277")]
306+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
307307
pub trait FromResidual<R = <Self as Try>::Residual> {
308308
/// Constructs the type from a compatible `Residual` type.
309309
///
@@ -326,7 +326,7 @@ pub trait FromResidual<R = <Self as Try>::Residual> {
326326
/// );
327327
/// ```
328328
#[lang = "from_residual"]
329-
#[unstable(feature = "try_trait_v2", issue = "84277")]
329+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
330330
fn from_residual(residual: R) -> Self;
331331
}
332332

core/src/option.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,7 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
25322532
}
25332533
}
25342534

2535-
#[unstable(feature = "try_trait_v2", issue = "84277")]
2535+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
25362536
impl<T> ops::Try for Option<T> {
25372537
type Output = T;
25382538
type Residual = Option<convert::Infallible>;
@@ -2551,7 +2551,7 @@ impl<T> ops::Try for Option<T> {
25512551
}
25522552
}
25532553

2554-
#[unstable(feature = "try_trait_v2", issue = "84277")]
2554+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
25552555
// Note: manually specifying the residual type instead of using the default to work around
25562556
// https://github.com/rust-lang/rust/issues/99940
25572557
impl<T> ops::FromResidual<Option<convert::Infallible>> for Option<T> {

core/src/result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
20512051
}
20522052
}
20532053

2054-
#[unstable(feature = "try_trait_v2", issue = "84277")]
2054+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
20552055
impl<T, E> ops::Try for Result<T, E> {
20562056
type Output = T;
20572057
type Residual = Result<convert::Infallible, E>;
@@ -2070,7 +2070,7 @@ impl<T, E> ops::Try for Result<T, E> {
20702070
}
20712071
}
20722072

2073-
#[unstable(feature = "try_trait_v2", issue = "84277")]
2073+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
20742074
impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Result<T, F> {
20752075
#[inline]
20762076
#[track_caller]

core/src/task/poll.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl<T> From<T> for Poll<T> {
229229
}
230230
}
231231

232-
#[unstable(feature = "try_trait_v2", issue = "84277")]
232+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
233233
impl<T, E> ops::Try for Poll<Result<T, E>> {
234234
type Output = Poll<T>;
235235
type Residual = Result<convert::Infallible, E>;
@@ -249,7 +249,7 @@ impl<T, E> ops::Try for Poll<Result<T, E>> {
249249
}
250250
}
251251

252-
#[unstable(feature = "try_trait_v2", issue = "84277")]
252+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
253253
impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Poll<Result<T, F>> {
254254
#[inline]
255255
fn from_residual(x: Result<convert::Infallible, E>) -> Self {
@@ -259,7 +259,7 @@ impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Pol
259259
}
260260
}
261261

262-
#[unstable(feature = "try_trait_v2", issue = "84277")]
262+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
263263
impl<T, E> ops::Try for Poll<Option<Result<T, E>>> {
264264
type Output = Poll<Option<T>>;
265265
type Residual = Result<convert::Infallible, E>;
@@ -280,7 +280,7 @@ impl<T, E> ops::Try for Poll<Option<Result<T, E>>> {
280280
}
281281
}
282282

283-
#[unstable(feature = "try_trait_v2", issue = "84277")]
283+
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
284284
impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>>
285285
for Poll<Option<Result<T, F>>>
286286
{

0 commit comments

Comments
 (0)