Skip to content

Commit e7b9935

Browse files
authored
Rollup merge of #149135 - nxsaken:const_residual_into_try_type, r=scottmcm
Constify `residual_into_try_type` Feature: `const_try_residual` (related to `try_trait_v2_residual`) Tracking issue: #91285 Constify `residual_into_try_type` introduced in #148725. r? ``@scottmcm``
2 parents e397c5d + 5590d7d commit e7b9935

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/core/src/ops/try_trait.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,14 @@ pub const trait Residual<O>: Sized {
371371
/// but importantly not on the contextual type the way it would be if
372372
/// we called `<_ as FromResidual>::from_residual(r)` directly.
373373
#[unstable(feature = "try_trait_v2_residual", issue = "91285")]
374+
#[rustc_const_unstable(feature = "const_try_residual", issue = "91285")]
374375
// needs to be `pub` to avoid `private type` errors
375376
#[expect(unreachable_pub)]
376377
#[inline] // FIXME: force would be nice, but fails -- see #148915
377378
#[lang = "into_try_type"]
378-
pub fn residual_into_try_type<R: Residual<O>, O>(r: R) -> <R as Residual<O>>::TryType {
379+
pub const fn residual_into_try_type<R: [const] Residual<O>, O>(
380+
r: R,
381+
) -> <R as Residual<O>>::TryType {
379382
FromResidual::from_residual(r)
380383
}
381384

0 commit comments

Comments
 (0)