Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #67750

Closed
wants to merge 16 commits into from
Closed
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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Jorge Aparicio <japaric@linux.com> <japaricious@gmail.com>
Joseph Martin <pythoner6@gmail.com>
Joseph T. Lyons <JosephTLyons@gmail.com> <josephtlyons@gmail.com>
Joseph T. Lyons <JosephTLyons@gmail.com> <JosephTLyons@users.noreply.github.com>
jumbatm <jumbatm@gmail.com> <30644300+jumbatm@users.noreply.github.com>
Junyoung Cho <june0.cho@samsung.com>
Jyun-Yan You <jyyou.tw@gmail.com> <jyyou@cs.nctu.edu.tw>
Kang Seonghoon <kang.seonghoon@mearie.org> <public+git@mearie.org>
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@
#![feature(const_if_match)]
#![feature(const_panic)]
#![feature(const_fn_union)]
#![feature(const_if_match)]
#![feature(const_generics)]
#![feature(const_ptr_offset_from)]
#![feature(const_result)]
#![feature(const_type_name)]
#![feature(custom_inner_attributes)]
#![feature(decl_macro)]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub const NAN: f32 = 0.0_f32 / 0.0_f32;
/// Infinity (∞).
#[stable(feature = "rust1", since = "1.0.0")]
pub const INFINITY: f32 = 1.0_f32 / 0.0_f32;
/// Negative infinity (-∞).
/// Negative infinity (∞).
#[stable(feature = "rust1", since = "1.0.0")]
pub const NEG_INFINITY: f32 = -1.0_f32 / 0.0_f32;

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub const NAN: f64 = 0.0_f64 / 0.0_f64;
/// Infinity (∞).
#[stable(feature = "rust1", since = "1.0.0")]
pub const INFINITY: f64 = 1.0_f64 / 0.0_f64;
/// Negative infinity (-∞).
/// Negative infinity (∞).
#[stable(feature = "rust1", since = "1.0.0")]
pub const NEG_INFINITY: f64 = -1.0_f64 / 0.0_f64;

Expand Down
9 changes: 6 additions & 3 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,10 @@ impl<T, E> Result<T, E> {
/// assert_eq!(x.is_ok(), false);
/// ```
#[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"]
#[rustc_const_unstable(feature = "const_result", issue = "67520")]
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn is_ok(&self) -> bool {
pub const fn is_ok(&self) -> bool {
match *self {
Ok(_) => true,
Err(_) => false,
Expand All @@ -303,9 +304,10 @@ impl<T, E> Result<T, E> {
/// assert_eq!(x.is_err(), true);
/// ```
#[must_use = "if you intended to assert that this is err, consider `.unwrap_err()` instead"]
#[rustc_const_unstable(feature = "const_result", issue = "67520")]
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn is_err(&self) -> bool {
pub const fn is_err(&self) -> bool {
!self.is_ok()
}

Expand Down Expand Up @@ -446,8 +448,9 @@ impl<T, E> Result<T, E> {
/// assert_eq!(x.as_ref(), Err(&"Error"));
/// ```
#[inline]
#[rustc_const_unstable(feature = "const_result", issue = "67520")]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn as_ref(&self) -> Result<&T, &E> {
pub const fn as_ref(&self) -> Result<&T, &E> {
match *self {
Ok(ref x) => Ok(x),
Err(ref x) => Err(x),
Expand Down
Loading