about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-01 14:45:56 +0000
committerbors <bors@rust-lang.org>2020-07-01 14:45:56 +0000
commitf781babf87dea29c44f93842b7ac9eb809549d29 (patch)
treefcb575eda0c6d0e786d9b42d1b6559b4865f3ff6 /src/libcore
parent1505c1239554fd8c9a5f7a6f4823c7384a0c29e3 (diff)
parentc9b3e869771e7944719e139a327422726f7529de (diff)
downloadrust-f781babf87dea29c44f93842b7ac9eb809549d29.tar.gz
rust-f781babf87dea29c44f93842b7ac9eb809549d29.zip
Auto merge of #73924 - Manishearth:rollup-8r51ld9, r=Manishearth
Rollup of 17 pull requests

Successful merges:

 - #72071 (Added detailed error code explanation for issue E0687 in Rust compiler.)
 - #72369 (Bring net/parser.rs up to modern up to date with modern rust patterns)
 - #72445 (Stabilize `#[track_caller]`.)
 - #73466 (impl From<char> for String)
 - #73548 (remove rustdoc warnings)
 - #73649 (Fix sentence structure)
 - #73678 (Update Box::from_raw example to generalize better)
 - #73705 (stop taking references in Relate)
 - #73716 (Document the static keyword)
 - #73752 (Remap Windows ERROR_INVALID_PARAMETER to ErrorKind::InvalidInput from Other)
 - #73776 (Move terminator to new module)
 - #73778 (Make `likely` and `unlikely` const, gated by feature `const_unlikely`)
 - #73805 (Document the type keyword)
 - #73806 (Use an 'approximate' universal upper bound when reporting region errors)
 - #73828 (Fix wording for anonymous parameter name help)
 - #73846 (Fix comma in debug_assert! docs)
 - #73847 (Edit cursor.prev() method docs in lexer)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs2
-rw-r--r--src/libcore/lib.rs3
-rw-r--r--src/libcore/macros/mod.rs4
-rw-r--r--src/libcore/panic.rs14
4 files changed, 10 insertions, 13 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 5d090187591..57ffed19c00 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -952,6 +952,7 @@ extern "rust-intrinsic" {
     /// Any use other than with `if` statements will probably not have an effect.
     ///
     /// This intrinsic does not have a stable counterpart.
+    #[rustc_const_unstable(feature = "const_likely", issue = "none")]
     pub fn likely(b: bool) -> bool;
 
     /// Hints to the compiler that branch condition is likely to be false.
@@ -960,6 +961,7 @@ extern "rust-intrinsic" {
     /// Any use other than with `if` statements will probably not have an effect.
     ///
     /// This intrinsic does not have a stable counterpart.
+    #[rustc_const_unstable(feature = "const_likely", issue = "none")]
     pub fn unlikely(b: bool) -> bool;
 
     /// Executes a breakpoint trap, for inspection by a debugger.
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index aeb52bffbf2..63ddd97eed3 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -92,6 +92,7 @@
 #![feature(const_slice_from_raw_parts)]
 #![feature(const_slice_ptr_len)]
 #![feature(const_type_name)]
+#![feature(const_likely)]
 #![feature(custom_inner_attributes)]
 #![feature(decl_macro)]
 #![feature(doc_cfg)]
@@ -118,7 +119,7 @@
 #![feature(staged_api)]
 #![feature(std_internals)]
 #![feature(stmt_expr_attributes)]
-#![feature(track_caller)]
+#![cfg_attr(bootstrap, feature(track_caller))]
 #![feature(transparent_unions)]
 #![feature(unboxed_closures)]
 #![feature(unsized_locals)]
diff --git a/src/libcore/macros/mod.rs b/src/libcore/macros/mod.rs
index 3cfdde60135..17f7349bac2 100644
--- a/src/libcore/macros/mod.rs
+++ b/src/libcore/macros/mod.rs
@@ -1,6 +1,6 @@
 #[doc(include = "panic.md")]
 #[macro_export]
-#[allow_internal_unstable(core_panic, track_caller)]
+#[allow_internal_unstable(core_panic, const_caller_location)]
 #[stable(feature = "core", since = "1.6.0")]
 macro_rules! panic {
     () => (
@@ -151,7 +151,7 @@ macro_rules! assert_ne {
 /// An unchecked assertion allows a program in an inconsistent state to keep
 /// running, which might have unexpected consequences but does not introduce
 /// unsafety as long as this only happens in safe code. The performance cost
-/// of assertions, is however, not measurable in general. Replacing [`assert!`]
+/// of assertions, however, is not measurable in general. Replacing [`assert!`]
 /// with `debug_assert!` is thus only encouraged after thorough profiling, and
 /// more importantly, only in safe code!
 ///
diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs
index c7009b76e81..543aa969330 100644
--- a/src/libcore/panic.rs
+++ b/src/libcore/panic.rs
@@ -190,7 +190,6 @@ impl<'a> Location<'a> {
     /// # Examples
     ///
     /// ```
-    /// #![feature(track_caller)]
     /// use core::panic::Location;
     ///
     /// /// Returns the [`Location`] at which it is called.
@@ -206,7 +205,7 @@ impl<'a> Location<'a> {
     ///
     /// let fixed_location = get_just_one_location();
     /// assert_eq!(fixed_location.file(), file!());
-    /// assert_eq!(fixed_location.line(), 15);
+    /// assert_eq!(fixed_location.line(), 14);
     /// assert_eq!(fixed_location.column(), 5);
     ///
     /// // running the same untracked function in a different location gives us the same result
@@ -217,7 +216,7 @@ impl<'a> Location<'a> {
     ///
     /// let this_location = get_caller_location();
     /// assert_eq!(this_location.file(), file!());
-    /// assert_eq!(this_location.line(), 29);
+    /// assert_eq!(this_location.line(), 28);
     /// assert_eq!(this_location.column(), 21);
     ///
     /// // running the tracked function in a different location produces a different value
@@ -226,13 +225,8 @@ impl<'a> Location<'a> {
     /// assert_ne!(this_location.line(), another_location.line());
     /// assert_ne!(this_location.column(), another_location.column());
     /// ```
-    // FIXME: When stabilizing this method, please also update the documentation
-    // of `intrinsics::caller_location`.
-    #[unstable(
-        feature = "track_caller",
-        reason = "uses #[track_caller] which is not yet stable",
-        issue = "47809"
-    )]
+    #[stable(feature = "track_caller", since = "1.46.0")]
+    #[rustc_const_unstable(feature = "const_caller_location", issue = "47809")]
     #[track_caller]
     pub const fn caller() -> &'static Location<'static> {
         crate::intrinsics::caller_location()