X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fcore%2Fsrc%2Fresult.rs;h=b2b132300a299869fcfab14e8bc4ece0b0bf4a28;hb=b200483412b1195d0ca9deffe011c659606e5b3b;hp=afd0c8572291d2e788d33226b07c462b60ac97c6;hpb=0c79c862f0e7e6ab56ea6d78b15410de209e0825;p=rust.git diff --git a/library/core/src/result.rs b/library/core/src/result.rs index afd0c857229..b2b132300a2 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -536,7 +536,7 @@ impl Result { /// assert_eq!(x.is_ok(), false); /// ``` #[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"] - #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub const fn is_ok(&self) -> bool { @@ -580,7 +580,7 @@ pub fn is_ok_and(&self, f: impl FnOnce(&T) -> bool) -> bool { /// assert_eq!(x.is_err(), true); /// ``` #[must_use = "if you intended to assert that this is err, consider `.unwrap_err()` instead"] - #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub const fn is_err(&self) -> bool { @@ -636,7 +636,7 @@ pub fn is_err_and(&self, f: impl FnOnce(&E) -> bool) -> bool { #[rustc_const_unstable(feature = "const_result_drop", issue = "92384")] pub const fn ok(self) -> Option where - E: ~const Drop + ~const Destruct, + E: ~const Destruct, { match self { Ok(x) => Some(x), @@ -667,7 +667,7 @@ pub const fn ok(self) -> Option #[rustc_const_unstable(feature = "const_result_drop", issue = "92384")] pub const fn err(self) -> Option where - T: ~const Drop + ~const Destruct, + T: ~const Destruct, { match self { // FIXME: ~const Drop doesn't quite work right yet @@ -698,7 +698,7 @@ pub const fn err(self) -> Option /// assert_eq!(x.as_ref(), Err(&"Error")); /// ``` #[inline] - #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] #[stable(feature = "rust1", since = "1.0.0")] pub const fn as_ref(&self) -> Result<&T, &E> { match *self { @@ -1283,9 +1283,9 @@ pub fn into_err(self) -> E #[stable(feature = "rust1", since = "1.0.0")] pub const fn and(self, res: Result) -> Result 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 @@ -1368,9 +1368,9 @@ pub fn and_then Result>(self, op: F) -> Result { #[stable(feature = "rust1", since = "1.0.0")] pub const fn or(self, res: Result) -> Result 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), @@ -1432,8 +1432,8 @@ pub fn or_else Result>(self, op: O) -> Result { #[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, @@ -1803,11 +1803,10 @@ fn unwrap_failed(_msg: &str, _error: &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 const Clone for Result 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 {