#[rustc_const_unstable(feature = "const_result_drop", issue = "92384")]
pub const fn ok(self) -> Option<T>
where
- E: ~const Drop + ~const Destruct,
+ E: ~const Destruct,
{
match self {
Ok(x) => Some(x),
#[rustc_const_unstable(feature = "const_result_drop", issue = "92384")]
pub const fn err(self) -> Option<E>
where
- T: ~const Drop + ~const Destruct,
+ T: ~const Destruct,
{
match self {
// FIXME: ~const Drop doesn't quite work right yet
#[stable(feature = "rust1", since = "1.0.0")]
pub const fn and<U>(self, res: Result<U, E>) -> Result<U, E>
where
- T: ~const Drop + ~const Destruct,
- U: ~const Drop + ~const Destruct,
- E: ~const Drop + ~const Destruct,
+ T: ~const Destruct,
+ U: ~const Destruct,
+ E: ~const Destruct,
{
match self {
// FIXME: ~const Drop doesn't quite work right yet
#[stable(feature = "rust1", since = "1.0.0")]
pub const fn or<F>(self, res: Result<T, F>) -> Result<T, F>
where
- T: ~const Drop + ~const Destruct,
- E: ~const Drop + ~const Destruct,
- F: ~const Drop + ~const Destruct,
+ T: ~const Destruct,
+ E: ~const Destruct,
+ F: ~const Destruct,
{
match self {
Ok(v) => Ok(v),
#[stable(feature = "rust1", since = "1.0.0")]
pub const fn unwrap_or(self, default: T) -> T
where
- T: ~const Drop + ~const Destruct,
- E: ~const Drop + ~const Destruct,
+ T: ~const Destruct,
+ E: ~const Destruct,
{
match self {
Ok(t) => t,
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_clone", issue = "91805")]
-#[cfg_attr(not(bootstrap), allow(drop_bounds))] // FIXME remove `~const Drop` and this attr when bumping
impl<T, E> const Clone for Result<T, E>
where
- T: ~const Clone + ~const Drop + ~const Destruct,
- E: ~const Clone + ~const Drop + ~const Destruct,
+ T: ~const Clone + ~const Destruct,
+ E: ~const Clone + ~const Destruct,
{
#[inline]
fn clone(&self) -> Self {