Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,21 +793,6 @@ const impl<T> From<T> for T {
}
}

/// **Stability note:** This impl does not yet exist, but we are
/// "reserving space" to add it in the future. See
/// [rust-lang/rust#64715][#64715] for details.
///
/// [#64715]: https://github.com/rust-lang/rust/issues/64715
#[stable(feature = "convert_infallible", since = "1.34.0")]
#[rustc_reservation_impl = "permitting this impl would forbid us from adding \
`impl<T> From<!> for T` later; see rust-lang/rust#64715 for details"]
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
const impl<T> From<!> for T {
fn from(t: !) -> T {
t
}
}

// TryFrom implies TryInto
#[stable(feature = "try_from", since = "1.34.0")]
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// check that the `for<T> T: From<!>` impl is reserved
// check that the `for<T> T: From<!>` impl is not reserved anymore

//@ check-pass
//
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver=coherence
Expand All @@ -10,7 +12,6 @@ pub struct MyFoo;
pub trait MyTrait {}

impl MyTrait for MyFoo {}
// This will conflict with the first impl if we impl `for<T> T: From<!>`.
impl<T> MyTrait for T where T: From<!> {} //~ ERROR conflicting implementation
impl<T> MyTrait for T where T: From<!> {}

fn main() {}
14 changes: 0 additions & 14 deletions tests/ui/never_type/never-from-impl-is-reserved.current.stderr

This file was deleted.

14 changes: 0 additions & 14 deletions tests/ui/never_type/never-from-impl-is-reserved.next.stderr

This file was deleted.

Loading