Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7e72781329ffce0d868a917aa71303f662e7d7d0
Choose a base ref
..
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1b6df71192db3e0d635754e3810def977e28092f
Choose a head ref
Showing with 27 additions and 0 deletions.
  1. +1 −0 library/core/tests/ops.rs
  2. +26 −0 library/core/tests/ops/from_residual.rs
1 change: 1 addition & 0 deletions library/core/tests/ops.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod control_flow;
mod from_residual;

use core::ops::{
Bound, Deref, DerefMut, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive,
26 changes: 26 additions & 0 deletions library/core/tests/ops/from_residual.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//! Regression test that Option and ControlFlow can have downstream FromResidual impls.
//! cc https://github.com/rust-lang/rust/issues/99940,
//! This does NOT test that issue in general; Option and ControlFlow's FromResidual
//! impls in core were changed to not be affected by that issue.
use core::ops::{ControlFlow, FromResidual};

struct Local;

impl<T> FromResidual<Local> for Option<T> {
fn from_residual(_: Local) -> Option<T> {
unimplemented!()
}
}

impl<B, C> FromResidual<Local> for ControlFlow<B, C> {
fn from_residual(_: Local) -> ControlFlow<B, C> {
unimplemented!()
}
}

impl<T, E> FromResidual<Local> for Result<T, E> {
fn from_residual(_: Local) -> Result<T, E> {
unimplemented!()
}
}