]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #49906 - kennytm:stable-unreachable, r=sfackler
authorkennytm <kennytm@gmail.com>
Tue, 24 Apr 2018 03:57:04 +0000 (11:57 +0800)
committerGitHub <noreply@github.com>
Tue, 24 Apr 2018 03:57:04 +0000 (11:57 +0800)
Stabilize `std::hint::unreachable_unchecked`.

Closes #43751.

1  2 
src/libcore/lib.rs
src/libcore/macros.rs
src/libstd/lib.rs

diff --combined src/libcore/lib.rs
index 7da5d9f76b55a0acc930ba2757b299665fcbb847,1968c11d06223ba880d778fe6da49c2d6f757ecc..0e21a3327fddf471f6a486fb9e1f222f5e545981
  #![feature(asm)]
  #![feature(associated_type_defaults)]
  #![feature(attr_literals)]
 -#![feature(cfg_target_feature)]
  #![feature(cfg_target_has_atomic)]
  #![feature(concat_idents)]
  #![feature(const_fn)]
 +#![feature(core_float)]
  #![feature(custom_attribute)]
  #![feature(doc_cfg)]
  #![feature(doc_spotlight)]
@@@ -83,7 -83,6 +83,7 @@@
  #![feature(iterator_repeat_with)]
  #![feature(lang_items)]
  #![feature(link_llvm_intrinsics)]
 +#![feature(never_type)]
  #![feature(exhaustive_patterns)]
  #![feature(macro_at_most_once_rep)]
  #![feature(no_core)]
  #![feature(rustc_attrs)]
  #![feature(rustc_const_unstable)]
  #![feature(simd_ffi)]
 +#![feature(core_slice_ext)]
 +#![feature(core_str_ext)]
  #![feature(specialization)]
  #![feature(staged_api)]
  #![feature(stmt_expr_attributes)]
 -#![feature(target_feature)]
  #![feature(unboxed_closures)]
  #![feature(untagged_unions)]
  #![feature(unwind_attributes)]
 +#![feature(doc_alias)]
 +
 +#![cfg_attr(not(stage0), feature(mmx_target_feature))]
 +#![cfg_attr(not(stage0), feature(tbm_target_feature))]
 +#![cfg_attr(not(stage0), feature(sse4a_target_feature))]
 +#![cfg_attr(not(stage0), feature(arm_target_feature))]
 +#![cfg_attr(not(stage0), feature(powerpc_target_feature))]
 +#![cfg_attr(not(stage0), feature(mips_target_feature))]
 +#![cfg_attr(not(stage0), feature(aarch64_target_feature))]
 +
 +#![cfg_attr(stage0, feature(target_feature))]
 +#![cfg_attr(stage0, feature(cfg_target_feature))]
  
  #[prelude_import]
  #[allow(unused)]
@@@ -163,6 -149,7 +163,7 @@@ pub mod intrinsics
  pub mod mem;
  pub mod nonzero;
  pub mod ptr;
+ pub mod hint;
  
  /* Core language traits */
  
@@@ -218,22 -205,8 +219,22 @@@ mod unit
  // things like SIMD and such. Note that the actual source for all this lies in a
  // different repository, rust-lang-nursery/stdsimd. That's why the setup here is
  // a bit wonky.
 +#[allow(unused_macros)]
 +macro_rules! test_v16 { ($item:item) => {}; }
 +#[allow(unused_macros)]
 +macro_rules! test_v32 { ($item:item) => {}; }
 +#[allow(unused_macros)]
 +macro_rules! test_v64 { ($item:item) => {}; }
 +#[allow(unused_macros)]
 +macro_rules! test_v128 { ($item:item) => {}; }
 +#[allow(unused_macros)]
 +macro_rules! test_v256 { ($item:item) => {}; }
 +#[allow(unused_macros)]
 +macro_rules! test_v512 { ($item:item) => {}; }
 +#[allow(unused_macros)]
 +macro_rules! vector_impl { ($([$f:ident, $($args:tt)*]),*) => { $($f!($($args)*);)* } }
  #[path = "../stdsimd/coresimd/mod.rs"]
 -#[allow(missing_docs, missing_debug_implementations, dead_code)]
 +#[allow(missing_docs, missing_debug_implementations, dead_code, unused_imports)]
  #[unstable(feature = "stdsimd", issue = "48556")]
  #[cfg(not(stage0))] // allow changes to how stdsimd works in stage0
  mod coresimd;
  #[unstable(feature = "stdsimd", issue = "48556")]
  #[cfg(not(stage0))]
  pub use coresimd::simd;
 -#[unstable(feature = "stdsimd", issue = "48556")]
 +#[stable(feature = "simd_arch", since = "1.27.0")]
  #[cfg(not(stage0))]
  pub use coresimd::arch;
diff --combined src/libcore/macros.rs
index 346d404fa8c5924d5e6dd8186792ab40bdc275d5,1e2551e36f54442214c0d732e0ee6cc28164b985..f9371ed0575e49782f7471320d83c5b852d663a1
@@@ -295,7 -295,6 +295,7 @@@ macro_rules! debug_assert_ne 
  /// ```
  #[macro_export]
  #[stable(feature = "rust1", since = "1.0.0")]
 +#[doc(alias = "?")]
  macro_rules! try {
      ($expr:expr) => (match $expr {
          $crate::result::Result::Ok(val) => val,
@@@ -421,13 -420,13 +421,13 @@@ macro_rules! writeln 
  /// * Iterators that dynamically terminate.
  ///
  /// If the determination that the code is unreachable proves incorrect, the
- /// program immediately terminates with a [`panic!`].  The function [`unreachable`],
- /// which belongs to the [`std::intrinsics`] module, informs the compilier to
+ /// program immediately terminates with a [`panic!`].  The function [`unreachable_unchecked`],
+ /// which belongs to the [`std::hint`] module, informs the compilier to
  /// optimize the code out of the release version entirely.
  ///
  /// [`panic!`]:  ../std/macro.panic.html
- /// [`unreachable`]: ../std/intrinsics/fn.unreachable.html
- /// [`std::intrinsics`]: ../std/intrinsics/index.html
+ /// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
+ /// [`std::hint`]: ../std/hint/index.html
  ///
  /// # Panics
  ///
diff --combined src/libstd/lib.rs
index 1df7bc777d17e56b2a786bb26845134a3e1adf8e,d92a45265493b939f34f08c3737fc2a5cc5a1910..419921931350906e5c9223ace3e19de4d80a63c0
  //!
  //! Once you are familiar with the contents of the standard library you may
  //! begin to find the verbosity of the prose distracting. At this stage in your
 -//! development you may want to press the **[-]** button near the top of the
 +//! development you may want to press the `[-]` button near the top of the
  //! page to collapse it into a more skimmable view.
  //!
 -//! While you are looking at that **[-]** button also notice the **[src]**
 +//! While you are looking at that `[-]` button also notice the `[src]`
  //! button. Rust's API documentation comes with the source code and you are
  //! encouraged to read it. The standard library source is generally high
  //! quality and a peek behind the curtains is often enlightening.
  #![feature(collections_range)]
  #![feature(compiler_builtins_lib)]
  #![feature(const_fn)]
 -#![feature(core_float)]
 +#![cfg_attr(stage0, feature(core_float))]
  #![feature(core_intrinsics)]
  #![feature(dropck_eyepatch)]
  #![feature(exact_size_is_empty)]
  #![feature(fs_read_write)]
  #![feature(fixed_size_array)]
  #![feature(float_from_str_radix)]
 +#![cfg_attr(stage0, feature(float_internals))]
  #![feature(fn_traits)]
  #![feature(fnbox)]
  #![cfg_attr(stage0, feature(generic_param_attrs))]
  #![feature(macro_reexport)]
  #![feature(macro_vis_matcher)]
  #![feature(needs_panic_runtime)]
 -#![feature(nonnull_cast)]
 +#![feature(never_type)]
  #![feature(exhaustive_patterns)]
  #![feature(nonzero)]
  #![feature(num_bits_bytes)]
  #![feature(rand)]
  #![feature(raw)]
  #![feature(rustc_attrs)]
 +#![feature(std_internals)]
  #![feature(stdsimd)]
  #![feature(shrink_to)]
  #![feature(slice_bytes)]
  #![feature(test, rustc_private)]
  #![feature(thread_local)]
  #![feature(toowned_clone_into)]
 +#![feature(try_from)]
  #![feature(try_reserve)]
  #![feature(unboxed_closures)]
  #![feature(untagged_unions)]
  #![feature(doc_spotlight)]
  #![cfg_attr(test, feature(update_panic_count))]
  #![cfg_attr(windows, feature(used))]
 +#![feature(doc_alias)]
  
  #![default_lib_allocator]
  
@@@ -461,6 -457,8 +461,8 @@@ pub use alloc_crate::vec
  pub use core::char;
  #[stable(feature = "i128", since = "1.26.0")]
  pub use core::u128;
+ #[stable(feature = "core_hint", since = "1.27.0")]
+ pub use core::hint;
  
  pub mod f32;
  pub mod f64;
@@@ -482,6 -480,7 +484,6 @@@ pub mod path
  pub mod process;
  pub mod sync;
  pub mod time;
 -pub mod alloc;
  
  #[unstable(feature = "allocator_api", issue = "32838")]
  #[rustc_deprecated(since = "1.27.0", reason = "module renamed to `alloc`")]
@@@ -495,8 -494,6 +497,8 @@@ pub mod heap 
  mod sys_common;
  mod sys;
  
 +pub mod alloc;
 +
  // Private support modules
  mod panicking;
  mod memchr;
@@@ -530,7 -527,7 +532,7 @@@ mod coresimd 
  #[unstable(feature = "stdsimd", issue = "48556")]
  #[cfg(all(not(stage0), not(test)))]
  pub use stdsimd::simd;
 -#[unstable(feature = "stdsimd", issue = "48556")]
 +#[stable(feature = "simd_arch", since = "1.27.0")]
  #[cfg(all(not(stage0), not(test)))]
  pub use stdsimd::arch;