]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #55888 - RalfJung:alloc-extra, r=oli-obk
authorkennytm <kennytm@gmail.com>
Tue, 13 Nov 2018 05:03:21 +0000 (13:03 +0800)
committerkennytm <kennytm@gmail.com>
Tue, 13 Nov 2018 11:20:55 +0000 (19:20 +0800)
miri: for uniformity, also move memory_deallocated to AllocationExtra

r? @oli-obk

74 files changed:
src/bootstrap/bootstrap.py
src/bootstrap/compile.rs
src/doc/rustdoc/src/the-doc-attribute.md
src/etc/lldb_batchmode.py
src/liballoc/boxed.rs
src/liballoc/boxed_test.rs
src/liballoc/collections/btree/map.rs
src/liballoc/string.rs
src/libcore/cell.rs
src/libcore/char/methods.rs
src/libcore/convert.rs
src/libcore/iter/sources.rs
src/libcore/lib.rs
src/libcore/marker.rs
src/libcore/mem.rs
src/libcore/num/flt2dec/estimator.rs
src/libcore/num/flt2dec/mod.rs
src/libcore/num/wrapping.rs
src/libcore/ops/range.rs
src/libcore/ptr.rs
src/libcore/slice/mod.rs
src/libcore/str/mod.rs
src/libcore/time.rs
src/libcore/unicode/tables.rs
src/librustc/infer/outlives/obligations.rs
src/librustc/macros.rs
src/librustc/mir/mod.rs
src/librustc/mir/traversal.rs
src/librustc/traits/specialize/specialization_graph.rs
src/librustc/ty/context.rs
src/librustc/ty/mod.rs
src/librustc/ty/query/mod.rs
src/librustc/ty/query/plumbing.rs
src/librustc/ty/sty.rs
src/librustc_apfloat/ieee.rs
src/librustc_codegen_llvm/llvm_util.rs
src/librustc_codegen_utils/linker.rs
src/librustc_data_structures/lib.rs
src/librustc_data_structures/macros.rs [new file with mode: 0644]
src/librustc_incremental/persist/fs.rs
src/librustc_mir/borrow_check/location.rs
src/librustc_mir/borrow_check/nll/region_infer/values.rs
src/librustc_save_analysis/dump_visitor.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/coherence/inherent_impls.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/static/main.js
src/librustdoc/html/static/rustdoc.css
src/libstd/ffi/c_str.rs
src/libstd/macros.rs
src/libstd/net/ip.rs
src/libstd/process.rs
src/libsyntax/ast.rs
src/libsyntax/ext/tt/macro_parser.rs
src/libsyntax/ext/tt/quoted.rs
src/test/run-pass-fulldeps/dropck_tarena_sound_drop.rs
src/test/rustdoc/inline_cross/auxiliary/use_crate.rs [new file with mode: 0644]
src/test/rustdoc/inline_cross/auxiliary/use_crate_2.rs [new file with mode: 0644]
src/test/rustdoc/inline_cross/use_crate.rs [new file with mode: 0644]
src/test/rustdoc/src-links-external.rs
src/test/ui/consts/const-eval/duration_conversion.rs
src/test/ui/consts/const-eval/mod-static-with-const-fn.rs
src/test/ui/consts/const-eval/mod-static-with-const-fn.stderr
src/test/ui/consts/std/cell.rs [new file with mode: 0644]
src/test/ui/consts/std/cell.stderr [new file with mode: 0644]
src/test/ui/consts/std/char.rs [new file with mode: 0644]
src/test/ui/consts/std/iter.rs [new file with mode: 0644]
src/test/ui/consts/std/slice.rs [new file with mode: 0644]
src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.rs
src/test/ui/rfc-2306/convert-id-const-no-gate.rs [deleted file]
src/test/ui/rfc-2306/convert-id-const-no-gate.stderr [deleted file]
src/test/ui/rfc-2306/convert-id-const-with-gate.rs
src/test/ui/rfc1445/phantom-data-is-structurally-matchable.rs [new file with mode: 0644]
src/tools/compiletest/src/header.rs

index fdd8784453bdb8c509b8bf4824921e327fb2246e..cd48e6aa4c4ba36c1ff14711ec602d416de8141c 100644 (file)
@@ -79,8 +79,8 @@ def _download(path, url, probably_big, verbose, exception):
     # see http://serverfault.com/questions/301128/how-to-download
     if sys.platform == 'win32':
         run(["PowerShell.exe", "/nologo", "-Command",
-             "(New-Object System.Net.WebClient)"
-             ".DownloadFile('{}', '{}')".format(url, path)],
+             "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;",
+             "(New-Object System.Net.WebClient).DownloadFile('{}', '{}')".format(url, path)],
             verbose=verbose,
             exception=exception)
     else:
index cef0849937bf01861602cc947e48c63e562b2fc5..c8689f7814086c927f87aaff77454cca2a6ee420 100644 (file)
@@ -203,7 +203,7 @@ fn should_run(run: ShouldRun) -> ShouldRun {
 
     /// Link all libstd rlibs/dylibs into the sysroot location.
     ///
-    /// Links those artifacts generated by `compiler` to the `stage` compiler's
+    /// Links those artifacts generated by `compiler` to the `stage` compiler's
     /// sysroot for the specified `host` and `target`.
     ///
     /// Note that this assumes that `compiler` has already generated the libstd
index 296422744fa4059a4b7f0f19e202f76d9830d4ce..61e5b3d0133ff6980bd886d17070197b34f3eace 100644 (file)
@@ -186,6 +186,9 @@ mod bar {
 
 Now we'll have a `Re-exports` line, and `Bar` will not link to anywhere.
 
+One special case: In Rust 2018 and later, if you `pub use` one of your dependencies, `rustdoc` will
+not eagerly inline it as a module unless you add `#[doc(inline)}`.
+
 ## `#[doc(hidden)]`
 
 Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless
index 24a0ce0ac3611270cd6630a26b1595d48afcc40d..b0220c84ef2fa78216a1e20a967c993003789bda 100644 (file)
@@ -12,7 +12,7 @@
 # containing LLDB commands (one command per line), this script will execute the commands one after
 # the other.
 # LLDB also has the -s and -S commandline options which also execute a list of commands from a text
-# file. However, this command are execute `immediately`: the command of a `run` or `continue`
+# file. However, this command are execute `immediately`: the command of a `run` or `continue`
 # command will be executed immediately after the `run` or `continue`, without waiting for the next
 # breakpoint to be hit. This a command sequence like the following will not yield reliable results:
 #
index 74354f605e5370d1824dc58d03d0b4266e4ce23a..63b262d1f3d986ac22aa793a2270c1b735e11a3e 100644 (file)
@@ -73,7 +73,7 @@
 use core::fmt;
 use core::future::Future;
 use core::hash::{Hash, Hasher};
-use core::iter::FusedIterator;
+use core::iter::{Iterator, FromIterator, FusedIterator};
 use core::marker::{Unpin, Unsize};
 use core::mem;
 use core::pin::Pin;
@@ -81,6 +81,7 @@
 use core::ptr::{self, NonNull, Unique};
 use core::task::{LocalWaker, Poll};
 
+use vec::Vec;
 use raw_vec::RawVec;
 use str::from_boxed_utf8_unchecked;
 
@@ -699,6 +700,13 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
 #[unstable(feature = "dispatch_from_dyn", issue = "0")]
 impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}
 
+#[stable(feature = "boxed_slice_from_iter", since = "1.32.0")]
+impl<A> FromIterator<A> for Box<[A]> {
+    fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self {
+        iter.into_iter().collect::<Vec<_>>().into_boxed_slice()
+    }
+}
+
 #[stable(feature = "box_slice_clone", since = "1.3.0")]
 impl<T: Clone> Clone for Box<[T]> {
     fn clone(&self) -> Self {
index 55995742a4a7da7bfa1ce5ec4008145190da7842..f340ea01c5f07d0b6d8bc35865985d621ea4a50a 100644 (file)
@@ -140,3 +140,11 @@ fn str_slice() {
     let boxed: Box<str> = Box::from(s);
     assert_eq!(&*boxed, s)
 }
+
+#[test]
+fn boxed_slice_from_iter() {
+    let iter = 0..100;
+    let boxed: Box<[u32]> = iter.collect();
+    assert_eq!(boxed.len(), 100);
+    assert_eq!(boxed[7], 7);
+}
index 24c8fd3a969ca3e1bde035f6531cf3c6456d7bb2..49e488702b4b9538e7f650d3ec99af540ff09045 100644 (file)
@@ -853,9 +853,10 @@ pub fn range<T: ?Sized, R>(&self, range: R) -> Range<K, V>
     /// ```
     /// use std::collections::BTreeMap;
     ///
-    /// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"].iter()
-    ///                                                                       .map(|&s| (s, 0))
-    ///                                                                       .collect();
+    /// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"]
+    ///     .iter()
+    ///     .map(|&s| (s, 0))
+    ///     .collect();
     /// for (_, balance) in map.range_mut("B".."Cheryl") {
     ///     *balance += 100;
     /// }
index 5c776292f53d7a86a49f0c1dcedf80d4dd261097..2beb3240aaca0d24b90553b965b35360287deb31 100644 (file)
@@ -2206,6 +2206,20 @@ fn from(s: &'a str) -> String {
 #[cfg(not(test))]
 #[stable(feature = "string_from_box", since = "1.18.0")]
 impl From<Box<str>> for String {
+    /// Converts the given boxed `str` slice to a `String`.
+    /// It is notable that the `str` slice is owned.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```
+    /// let s1: String = String::from("hello world");
+    /// let s2: Box<str> = s1.into_boxed_str();
+    /// let s3: String = String::from(s2);
+    ///
+    /// assert_eq!("hello world", s3)
+    /// ```
     fn from(s: Box<str>) -> String {
         s.into_string()
     }
@@ -2213,6 +2227,19 @@ fn from(s: Box<str>) -> String {
 
 #[stable(feature = "box_from_str", since = "1.20.0")]
 impl From<String> for Box<str> {
+    /// Converts the given `String` to a boxed `str` slice that is owned.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```
+    /// let s1: String = String::from("hello world");
+    /// let s2: Box<str> = Box::from(s1);
+    /// let s3: String = String::from(s2);
+    ///
+    /// assert_eq!("hello world", s3)
+    /// ```
     fn from(s: String) -> Box<str> {
         s.into_boxed_str()
     }
@@ -2272,6 +2299,20 @@ fn from_iter<I: IntoIterator<Item = String>>(it: I) -> Cow<'a, str> {
 
 #[stable(feature = "from_string_for_vec_u8", since = "1.14.0")]
 impl From<String> for Vec<u8> {
+    /// Converts the given `String` to a vector `Vec` that holds values of type `u8`.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```
+    /// let s1 = String::from("hello world");
+    /// let v1 = Vec::from(s1);
+    ///
+    /// for b in v1 {
+    ///     println!("{}", b);
+    /// }
+    /// ```
     fn from(string: String) -> Vec<u8> {
         string.into_bytes()
     }
index 689cf319bd750bd1c710e135c4ee0bd2f54d157d..9cf42eff219ba05a87bbce40768967e8e1e45529 100644 (file)
@@ -474,7 +474,7 @@ impl<T: ?Sized> Cell<T> {
     /// ```
     #[inline]
     #[stable(feature = "cell_as_ptr", since = "1.12.0")]
-    pub fn as_ptr(&self) -> *mut T {
+    pub const fn as_ptr(&self) -> *mut T {
         self.value.get()
     }
 
@@ -1508,7 +1508,7 @@ impl<T: ?Sized> UnsafeCell<T> {
     /// ```
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn get(&self) -> *mut T {
+    pub const fn get(&self) -> *mut T {
         &self.value as *const T as *mut T
     }
 }
index 64a17786b0a6b1b7bb92ec7df180190c2458bc1f..35181afea3da6ce72b6a5d83722737984f953fb3 100644 (file)
@@ -903,7 +903,7 @@ pub fn to_uppercase(self) -> ToUppercase {
     /// ```
     #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
     #[inline]
-    pub fn is_ascii(&self) -> bool {
+    pub const fn is_ascii(&self) -> bool {
         *self as u32 <= 0x7F
     }
 
index b900990d0a7266a90a1abb983cb697ea7148c0c7..dbc28ef7cf6a9ce8f3826bf21a3e9065ad809acd 100644 (file)
 /// assert_eq!(vec![1, 3], filtered);
 /// ```
 #[unstable(feature = "convert_id", issue = "53500")]
-#[rustc_const_unstable(feature = "const_convert_id")]
 #[inline]
 pub const fn identity<T>(x: T) -> T { x }
 
index d500cc99fa13c2641dabc0e3bfc3d898e4fd194e..7fa3a4bcce7bb2357ae1c1e05952c83e89844b24 100644 (file)
@@ -283,7 +283,7 @@ fn default() -> Empty<T> {
 /// assert_eq!(None, nope.next());
 /// ```
 #[stable(feature = "iter_empty", since = "1.2.0")]
-pub fn empty<T>() -> Empty<T> {
+pub const fn empty<T>() -> Empty<T> {
     Empty(marker::PhantomData)
 }
 
index c69d4441121ce9d9f6ad72e6403bec7e2929be4a..5872ac815c25941a67ed8e3cf75a6188c5ef63df 100644 (file)
@@ -82,7 +82,6 @@
 #![feature(const_fn)]
 #![feature(const_int_ops)]
 #![feature(const_fn_union)]
-#![feature(const_manually_drop_new)]
 #![feature(custom_attribute)]
 #![feature(doc_cfg)]
 #![feature(doc_spotlight)]
 #![feature(const_transmute)]
 #![feature(reverse_bits)]
 #![feature(non_exhaustive)]
+#![feature(structural_match)]
 
 #[prelude_import]
 #[allow(unused)]
index 662a8ddd96862d0e70bca2281b8cccc7e207c568..3bcdfabbb245e6f29c4882fddeeb674329ee914b 100644 (file)
@@ -578,6 +578,7 @@ fn default() -> $t<T> {
 ///
 /// [drop check]: ../../nomicon/dropck.html
 #[lang = "phantom_data"]
+#[structural_match]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct PhantomData<T:?Sized>;
 
index 8c4ff02aa140f65afec7d23c05edfee71287d46f..56146a9a5fd39199500ca98a3a7affed93847019 100644 (file)
@@ -809,7 +809,7 @@ pub fn drop<T>(_x: T) { }
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
-    ptr::read(src as *const T as *const U)
+    ptr::read_unaligned(src as *const T as *const U)
 }
 
 /// Opaque type representing the discriminant of an enum.
@@ -942,7 +942,6 @@ impl<T> ManuallyDrop<T> {
     /// ManuallyDrop::new(Box::new(()));
     /// ```
     #[stable(feature = "manually_drop", since = "1.20.0")]
-    #[rustc_const_unstable(feature = "const_manually_drop_new")]
     #[inline]
     pub const fn new(value: T) -> ManuallyDrop<T> {
         ManuallyDrop { value }
@@ -961,7 +960,7 @@ pub const fn new(value: T) -> ManuallyDrop<T> {
     /// ```
     #[stable(feature = "manually_drop", since = "1.20.0")]
     #[inline]
-    pub fn into_inner(slot: ManuallyDrop<T>) -> T {
+    pub const fn into_inner(slot: ManuallyDrop<T>) -> T {
         slot.value
     }
 
index d42e05a91f140f2f150c297914a93faf147f4fb9..4e33fcfd76e61cf210d786833b59e131b5e7a1a4 100644 (file)
@@ -22,4 +22,3 @@ pub fn estimate_scaling_factor(mant: u64, exp: i16) -> i16 {
     // therefore this always underestimates (or is exact), but not much.
     (((nbits + exp as i64) * 1292913986) >> 32) as i16
 }
-
index 21a2e72dac8c37f7411b18841087689a37bc1b24..d58015beecb1e7172f38cf54706dfe5d3411cf13 100644 (file)
@@ -658,4 +658,3 @@ pub fn to_exact_fixed_str<'a, T, F>(mut format_exact: F, v: T,
         }
     }
 }
-
index 1c826c2fa76bdd6c08fd13096cd269e70ba5ac79..00134a58d30f1c2e00a5917b4db3a25a0516fbaa 100644 (file)
@@ -387,7 +387,7 @@ pub const fn max_value() -> Self {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn count_ones(self) -> u32 {
+                pub const fn count_ones(self) -> u32 {
                     self.0.count_ones()
                 }
             }
@@ -407,7 +407,7 @@ pub fn count_ones(self) -> u32 {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn count_zeros(self) -> u32 {
+                pub const fn count_zeros(self) -> u32 {
                     self.0.count_zeros()
                 }
             }
@@ -430,7 +430,7 @@ pub fn count_zeros(self) -> u32 {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn trailing_zeros(self) -> u32 {
+                pub const fn trailing_zeros(self) -> u32 {
                     self.0.trailing_zeros()
                 }
             }
@@ -456,7 +456,7 @@ pub fn trailing_zeros(self) -> u32 {
             /// ```
             #[inline]
             #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-            pub fn rotate_left(self, n: u32) -> Self {
+            pub const fn rotate_left(self, n: u32) -> Self {
                 Wrapping(self.0.rotate_left(n))
             }
 
@@ -481,7 +481,7 @@ pub fn rotate_left(self, n: u32) -> Self {
             /// ```
             #[inline]
             #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-            pub fn rotate_right(self, n: u32) -> Self {
+            pub const fn rotate_right(self, n: u32) -> Self {
                 Wrapping(self.0.rotate_right(n))
             }
 
@@ -505,7 +505,7 @@ pub fn rotate_right(self, n: u32) -> Self {
             /// ```
             #[inline]
             #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-            pub fn swap_bytes(self) -> Self {
+            pub const fn swap_bytes(self) -> Self {
                 Wrapping(self.0.swap_bytes())
             }
 
@@ -532,7 +532,7 @@ pub fn swap_bytes(self) -> Self {
             /// ```
             #[unstable(feature = "reverse_bits", issue = "48763")]
             #[inline]
-            pub fn reverse_bits(self) -> Self {
+            pub const fn reverse_bits(self) -> Self {
                 Wrapping(self.0.reverse_bits())
             }
 
@@ -560,7 +560,7 @@ pub fn reverse_bits(self) -> Self {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn from_be(x: Self) -> Self {
+                pub const fn from_be(x: Self) -> Self {
                     Wrapping(<$t>::from_be(x.0))
                 }
             }
@@ -589,7 +589,7 @@ pub fn from_be(x: Self) -> Self {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn from_le(x: Self) -> Self {
+                pub const fn from_le(x: Self) -> Self {
                     Wrapping(<$t>::from_le(x.0))
                 }
             }
@@ -618,7 +618,7 @@ pub fn from_le(x: Self) -> Self {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn to_be(self) -> Self {
+                pub const fn to_be(self) -> Self {
                     Wrapping(self.0.to_be())
                 }
             }
@@ -647,7 +647,7 @@ pub fn to_be(self) -> Self {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn to_le(self) -> Self {
+                pub const fn to_le(self) -> Self {
                     Wrapping(self.0.to_le())
                 }
             }
@@ -707,7 +707,7 @@ impl Wrapping<$t> {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn leading_zeros(self) -> u32 {
+                pub const fn leading_zeros(self) -> u32 {
                     self.0.leading_zeros()
                 }
             }
@@ -784,7 +784,7 @@ pub fn signum(self) -> Wrapping<$t> {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn is_positive(self) -> bool {
+                pub const fn is_positive(self) -> bool {
                     self.0.is_positive()
                 }
             }
@@ -806,7 +806,7 @@ pub fn is_positive(self) -> bool {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn is_negative(self) -> bool {
+                pub const fn is_negative(self) -> bool {
                     self.0.is_negative()
                 }
             }
@@ -836,7 +836,7 @@ impl Wrapping<$t> {
 ```"),
                 #[inline]
                 #[unstable(feature = "wrapping_int_impl", issue = "32463")]
-                pub fn leading_zeros(self) -> u32 {
+                pub const fn leading_zeros(self) -> u32 {
                     self.0.leading_zeros()
                 }
             }
index 6cfb1005325ba644223311f773bcdcfc4cd0033c..908490e1c839e5eb53d9eee6acf6ea2a414686f5 100644 (file)
@@ -416,7 +416,7 @@ pub const fn new(start: Idx, end: Idx) -> Self {
     /// ```
     #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
     #[inline]
-    pub fn start(&self) -> &Idx {
+    pub const fn start(&self) -> &Idx {
         &self.start
     }
 
@@ -440,7 +440,7 @@ pub fn start(&self) -> &Idx {
     /// ```
     #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
     #[inline]
-    pub fn end(&self) -> &Idx {
+    pub const fn end(&self) -> &Idx {
         &self.end
     }
 
index 827e297c84d1f427918508b885a71395a50884f9..a7bfc3f51244720b5990f3bde99239b695250e38 100644 (file)
@@ -2905,7 +2905,7 @@ pub fn new(ptr: *mut T) -> Option<Self> {
     /// Acquires the underlying `*mut` pointer.
     #[stable(feature = "nonnull", since = "1.25.0")]
     #[inline]
-    pub fn as_ptr(self) -> *mut T {
+    pub const fn as_ptr(self) -> *mut T {
         self.pointer.0 as *mut T
     }
 
index 8a6b212020b4e4a0d74f661d675a604bafce40b1..fece328f51f474d45a7a3ae86c171bbf31341a1f 100644 (file)
@@ -385,7 +385,6 @@ pub unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut I::Output
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
-    #[rustc_const_unstable(feature = "const_slice_as_ptr")]
     pub const fn as_ptr(&self) -> *const T {
         self as *const [T] as *const T
     }
index a2782dd8e2e430f7905c0049d335101bdcadf9b6..a316093825ad75db5082612a33049346c27bcdd8 100644 (file)
@@ -1896,7 +1896,7 @@ fn index(self, slice: &str) -> &Self::Output {
         #[inline]
         fn index_mut(self, slice: &mut str) -> &mut Self::Output {
             // is_char_boundary checks that the index is in [0, .len()]
-            // canot reuse `get` as above, because of NLL trouble
+            // cannot reuse `get` as above, because of NLL trouble
             if self.start <= self.end &&
                slice.is_char_boundary(self.start) &&
                slice.is_char_boundary(self.end) {
@@ -2277,7 +2277,6 @@ pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
-    #[rustc_const_unstable(feature = "const_str_as_ptr")]
     pub const fn as_ptr(&self) -> *const u8 {
         self as *const str as *const u8
     }
index cfbd431aef0a00e87d5d9f0bf82cfbf15cf90919..938e97503deb6d716f88d693f6f68cf0933294ad 100644 (file)
@@ -209,7 +209,6 @@ pub const fn from_nanos(nanos: u64) -> Duration {
     ///
     /// [`subsec_nanos`]: #method.subsec_nanos
     #[stable(feature = "duration", since = "1.3.0")]
-    #[rustc_const_unstable(feature="duration_getters")]
     #[inline]
     pub const fn as_secs(&self) -> u64 { self.secs }
 
@@ -229,7 +228,6 @@ pub const fn as_secs(&self) -> u64 { self.secs }
     /// assert_eq!(duration.subsec_millis(), 432);
     /// ```
     #[stable(feature = "duration_extras", since = "1.27.0")]
-    #[rustc_const_unstable(feature="duration_getters")]
     #[inline]
     pub const fn subsec_millis(&self) -> u32 { self.nanos / NANOS_PER_MILLI }
 
@@ -249,7 +247,6 @@ pub const fn subsec_millis(&self) -> u32 { self.nanos / NANOS_PER_MILLI }
     /// assert_eq!(duration.subsec_micros(), 234_567);
     /// ```
     #[stable(feature = "duration_extras", since = "1.27.0")]
-    #[rustc_const_unstable(feature="duration_getters")]
     #[inline]
     pub const fn subsec_micros(&self) -> u32 { self.nanos / NANOS_PER_MICRO }
 
@@ -269,7 +266,6 @@ pub const fn subsec_micros(&self) -> u32 { self.nanos / NANOS_PER_MICRO }
     /// assert_eq!(duration.subsec_nanos(), 10_000_000);
     /// ```
     #[stable(feature = "duration", since = "1.3.0")]
-    #[rustc_const_unstable(feature="duration_getters")]
     #[inline]
     pub const fn subsec_nanos(&self) -> u32 { self.nanos }
 
@@ -286,7 +282,7 @@ pub const fn subsec_nanos(&self) -> u32 { self.nanos }
     /// ```
     #[unstable(feature = "duration_as_u128", issue = "50202")]
     #[inline]
-    pub fn as_millis(&self) -> u128 {
+    pub const fn as_millis(&self) -> u128 {
         self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128
     }
 
@@ -303,7 +299,7 @@ pub fn as_millis(&self) -> u128 {
     /// ```
     #[unstable(feature = "duration_as_u128", issue = "50202")]
     #[inline]
-    pub fn as_micros(&self) -> u128 {
+    pub const fn as_micros(&self) -> u128 {
         self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128
     }
 
@@ -320,7 +316,7 @@ pub fn as_micros(&self) -> u128 {
     /// ```
     #[unstable(feature = "duration_as_u128", issue = "50202")]
     #[inline]
-    pub fn as_nanos(&self) -> u128 {
+    pub const fn as_nanos(&self) -> u128 {
         self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128
     }
 
@@ -478,7 +474,7 @@ pub fn checked_div(self, rhs: u32) -> Option<Duration> {
     /// ```
     #[unstable(feature = "duration_float", issue = "54361")]
     #[inline]
-    pub fn as_float_secs(&self) -> f64 {
+    pub const fn as_float_secs(&self) -> f64 {
         (self.secs as f64) + (self.nanos as f64) / (NANOS_PER_SEC as f64)
     }
 
index 3de855ac943157091696c035096c70399d5bd96e..e525c0574002b2d83e96d9007dcf289ee16b31ca 100644 (file)
@@ -2598,4 +2598,3 @@ pub mod conversions {
     ];
 
 }
-
index f2825887f36e2d28dae70de54776647af151f6ee..0114f9e9321e1878e54b0f96a7195665d4eeab52 100644 (file)
@@ -132,7 +132,7 @@ pub fn take_registered_region_obligations(&self) -> Vec<(ast::NodeId, RegionObli
     ///
     /// See the `region_obligations` field of `InferCtxt` for some
     /// comments about how this function fits into the overall expected
-    /// flow of the the inferencer. The key point is that it is
+    /// flow of the inferencer. The key point is that it is
     /// invoked after all type-inference variables have been bound --
     /// towards the end of regionck. This also ensures that the
     /// region-bound-pairs are available (see comments above regarding
index f21f949c9f5cd220d8508c0e95225d1c7e6c6fd0..781a0fa3f663a97fc1a3b7d86691c11faa195ad0 100644 (file)
@@ -62,16 +62,6 @@ macro_rules! span_bug {
     })
 }
 
-#[macro_export]
-macro_rules! static_assert {
-    ($name:ident: $test:expr) => {
-        // Use the bool to access an array such that if the bool is false, the access
-        // is out-of-bounds.
-        #[allow(dead_code)]
-        static $name: () = [()][!$test as usize];
-    }
-}
-
 #[macro_export]
 macro_rules! __impl_stable_hash_field {
     ($field:ident, $ctx:expr, $hasher:expr) => ($field.hash_stable($ctx, $hasher));
index 8a32e8f46c290778d4149a575582f830ee78d808..73800074cc7e88a18c5992d9976d99eacaaaf04d 100644 (file)
@@ -1719,14 +1719,14 @@ pub struct Statement<'tcx> {
     pub kind: StatementKind<'tcx>,
 }
 
+// `Statement` is used a lot. Make sure it doesn't unintentionally get bigger.
+#[cfg(target_arch = "x86_64")]
+static_assert!(MEM_SIZE_OF_STATEMENT: mem::size_of::<Statement<'_>>() == 56);
+
 impl<'tcx> Statement<'tcx> {
     /// Changes a statement to a nop. This is both faster than deleting instructions and avoids
     /// invalidating statement indices in `Location`s.
     pub fn make_nop(&mut self) {
-        // `Statement` contributes significantly to peak memory usage. Make
-        // sure it doesn't get bigger.
-        static_assert!(STATEMENT_IS_AT_MOST_56_BYTES: mem::size_of::<Statement<'_>>() <= 56);
-
         self.kind = StatementKind::Nop
     }
 
@@ -2611,7 +2611,7 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const<'_>) -> fmt::Resu
             _ => {}
         }
     }
-    // print function definitons
+    // print function definitions
     if let FnDef(did, _) = ty.sty {
         return write!(f, "{}", item_path_str(did));
     }
index a1e2b7a06468d0994bf76868942b3aa352097097..f3a0b7de903744eed856192dda2a88f301c05295 100644 (file)
@@ -142,7 +142,7 @@ fn traverse_successor(&mut self) {
         //
         // It does the actual traversal of the graph, while the `next` method on the iterator
         // just pops off of the stack. `visit_stack` is a stack containing pairs of nodes and
-        // iterators over the sucessors of those nodes. Each iteration attempts to get the next
+        // iterators over the successors of those nodes. Each iteration attempts to get the next
         // node from the top of the stack, then pushes that node and an iterator over the
         // successors to the top of the stack. This loop only grows `visit_stack`, stopping when
         // we reach a child that has no children that we haven't already visited.
@@ -163,7 +163,7 @@ fn traverse_successor(&mut self) {
         // The state of the stack starts out with just the root node (`A` in this case);
         //     [(A, [B, C])]
         //
-        // When the first call to `traverse_sucessor` happens, the following happens:
+        // When the first call to `traverse_successor` happens, the following happens:
         //
         //     [(B, [D]),  // `B` taken from the successors of `A`, pushed to the
         //                 // top of the stack along with the successors of `B`
index e237cab5ea135abde38e63f0fb5d56c9a8e42c6d..e44e1453b79654ff1ef0a9cf061ee607d2deaa1d 100644 (file)
@@ -366,7 +366,7 @@ pub fn is_from_trait(&self) -> bool {
     pub fn items(
         &self,
         tcx: TyCtxt<'a, 'gcx, 'tcx>,
-    ) -> impl Iterator<Item = ty::AssociatedItem> + 'a {
+    ) -> ty::AssociatedItemsIterator<'a, 'gcx, 'tcx> {
         tcx.associated_items(self.def_id())
     }
 
index 82095a2f5b01de7cc6031f5e068ee7db5e8c4395..f78fad9f7aa9a432a5e0a6bc5f88ad453ae8e43d 100644 (file)
@@ -823,12 +823,6 @@ fn hash_stable<W: StableHasherResult>(&self,
 
 impl<'tcx> CommonTypes<'tcx> {
     fn new(interners: &CtxtInterners<'tcx>) -> CommonTypes<'tcx> {
-        // Ensure our type representation does not grow
-        #[cfg(target_pointer_width = "64")]
-        static_assert!(ASSERT_TY_KIND: ::std::mem::size_of::<ty::TyKind<'_>>() <= 24);
-        #[cfg(target_pointer_width = "64")]
-        static_assert!(ASSERT_TYS: ::std::mem::size_of::<ty::TyS<'_>>() <= 32);
-
         let mk = |sty| CtxtInterners::intern_ty(interners, interners, sty);
         let mk_region = |r| {
             if let Some(r) = interners.region.borrow().get(&r) {
index ef9b3e3efab275f3421c3ea5eb9bcede113efa92..979cc9b115b5a2e6307631e1dd035956553eab2f 100644 (file)
@@ -514,6 +514,10 @@ pub struct TyS<'tcx> {
     outer_exclusive_binder: ty::DebruijnIndex,
 }
 
+// `TyS` is used a lot. Make sure it doesn't unintentionally get bigger.
+#[cfg(target_arch = "x86_64")]
+static_assert!(MEM_SIZE_OF_TY_S: ::std::mem::size_of::<TyS<'_>>() == 32);
+
 impl<'tcx> Ord for TyS<'tcx> {
     fn cmp(&self, other: &TyS<'tcx>) -> Ordering {
         self.sty.cmp(&other.sty)
@@ -2674,10 +2678,17 @@ pub fn find_field_index(self, ident: Ident, variant: &VariantDef) -> Option<usiz
     pub fn associated_items(
         self,
         def_id: DefId,
-    ) -> impl Iterator<Item = AssociatedItem> + 'a {
-        let def_ids = self.associated_item_def_ids(def_id);
-        Box::new((0..def_ids.len()).map(move |i| self.associated_item(def_ids[i])))
-            as Box<dyn Iterator<Item = AssociatedItem> + 'a>
+    ) -> AssociatedItemsIterator<'a, 'gcx, 'tcx> {
+        // Ideally, we would use `-> impl Iterator` here, but it falls
+        // afoul of the conservative "capture [restrictions]" we put
+        // in place, so we use a hand-written iterator.
+        //
+        // [restrictions]: https://github.com/rust-lang/rust/issues/34511#issuecomment-373423999
+        AssociatedItemsIterator {
+            tcx: self,
+            def_ids: self.associated_item_def_ids(def_id),
+            next_index: 0,
+        }
     }
 
     /// Returns `true` if the impls are the same polarity and the trait either
@@ -2874,6 +2885,22 @@ pub fn adjust_ident(self, mut ident: Ident, scope: DefId, block: NodeId) -> (Ide
     }
 }
 
+pub struct AssociatedItemsIterator<'a, 'gcx: 'tcx, 'tcx: 'a> {
+    tcx: TyCtxt<'a, 'gcx, 'tcx>,
+    def_ids: Lrc<Vec<DefId>>,
+    next_index: usize,
+}
+
+impl Iterator for AssociatedItemsIterator<'_, '_, '_> {
+    type Item = AssociatedItem;
+
+    fn next(&mut self) -> Option<AssociatedItem> {
+        let def_id = self.def_ids.get(self.next_index)?;
+        self.next_index += 1;
+        Some(self.tcx.associated_item(*def_id))
+    }
+}
+
 impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     pub fn with_freevars<T, F>(self, fid: NodeId, f: F) -> T where
         F: FnOnce(&[hir::Freevar]) -> T,
index ed7b2cffc46f6b689f22c9954eb0314ea1c08e06..27eafa7ab580f2b1c87c1d6f1df7ff044db88e6c 100644 (file)
         /// Gets a complete map from all types to their inherent impls.
         /// Not meant to be used directly outside of coherence.
         /// (Defined only for LOCAL_CRATE)
-        [] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum) -> CrateInherentImpls,
+        [] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum)
+            -> Lrc<CrateInherentImpls>,
 
         /// Checks all types in the krate for overlap in their inherent impls. Reports errors.
         /// Not meant to be used directly outside of coherence.
index 8bbfd92d688edd5581d6e2dfc3a0720c63de0259..efee39a1d63f95070fd2d1b8f256a512cd379688 100644 (file)
@@ -100,7 +100,7 @@ pub(super) struct JobOwner<'a, 'tcx: 'a, Q: QueryDescription<'tcx> + 'a> {
 }
 
 impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
-    /// Either gets a JobOwner corresponding the the query, allowing us to
+    /// Either gets a JobOwner corresponding the query, allowing us to
     /// start executing the query, or it returns with the result of the query.
     /// If the query is executing elsewhere, this will wait for it.
     /// If the query panicked, this will silently panic.
@@ -314,7 +314,7 @@ pub fn try_print_query_stack() {
     /// Try to read a node index for the node dep_node.
     /// A node will have an index, when it's already been marked green, or when we can mark it
     /// green. This function will mark the current task as a reader of the specified node, when
-    /// the a node index can be found for that node.
+    /// a node index can be found for that node.
     pub(super) fn try_mark_green_and_read(self, dep_node: &DepNode) -> Option<DepNodeIndex> {
         match self.dep_graph.node_color(dep_node) {
             Some(DepNodeColor::Green(dep_node_index)) => {
index a4130bf15cb8272f2bd726ae061b5f758a03a042..bd3a34cae90f4330c4aaf2cfa8c5bfe245dd1d5c 100644 (file)
@@ -211,6 +211,10 @@ pub enum TyKind<'tcx> {
     Error,
 }
 
+// `TyKind` is used a lot. Make sure it doesn't unintentionally get bigger.
+#[cfg(target_arch = "x86_64")]
+static_assert!(MEM_SIZE_OF_TY_KIND: ::std::mem::size_of::<TyKind<'_>>() == 24);
+
 /// A closure can be modeled as a struct that looks like:
 ///
 ///     struct Closure<'l0...'li, T0...Tj, CK, CS, U0...Uk> {
index 4f405858e350ce8269b9fba6dfe8512f2f6474ed..adcb9857ee3c259f6e2f44e61970a314a204ee55 100644 (file)
@@ -895,7 +895,7 @@ fn mul_add_r(mut self, multiplicand: Self, addend: Self, round: Round) -> Status
             }
 
             // The intermediate result of the multiplication has "2 * S::PRECISION"
-            // signicant bit; adjust the addend to be consistent with mul result.
+            // significant bit; adjust the addend to be consistent with mul result.
             let mut ext_addend_sig = [addend.sig[0], 0];
 
             // Extend the addend significand to ext_precision - 1. This guarantees
@@ -920,7 +920,7 @@ fn mul_add_r(mut self, multiplicand: Self, addend: Self, round: Round) -> Status
 
         // Convert the result having "2 * S::PRECISION" significant-bits back to the one
         // having "S::PRECISION" significant-bits. First, move the radix point from
-        // poision "2*S::PRECISION - 1" to "S::PRECISION - 1". The exponent need to be
+        // position "2*S::PRECISION - 1" to "S::PRECISION - 1". The exponent need to be
         // adjusted by "2*S::PRECISION - 1" - "S::PRECISION - 1" = "S::PRECISION".
         self.exp -= S::PRECISION as ExpInt + 1;
 
index eaa599e0cd0fa67f8382eda55fe7575f9aadf9ad..267d7e0d54b637c267054d7336401dcf0d61a3f3 100644 (file)
@@ -184,7 +184,7 @@ unsafe fn configure_llvm(sess: &Session) {
 ];
 
 /// When rustdoc is running, provide a list of all known features so that all their respective
-/// primtives may be documented.
+/// primitives may be documented.
 ///
 /// IMPORTANT: If you're adding another whitelist to the above lists, make sure to add it to this
 /// iterator!
index ae1d77f1521893f84a705b94c03ae89b880a76b0..e9ac92da684352a21b89c83594f73e356351129a 100644 (file)
@@ -613,7 +613,7 @@ fn debuginfo(&mut self) {
         // from the CodeView line tables in the object files.
         self.cmd.arg("/DEBUG");
 
-        // This will cause the Microsoft linker to embed .natvis info into the the PDB file
+        // This will cause the Microsoft linker to embed .natvis info into the PDB file
         let sysroot = self.sess.sysroot();
         let natvis_dir_path = sysroot.join("lib\\rustlib\\etc");
         if let Ok(natvis_dir) = fs::read_dir(&natvis_dir_path) {
index 07e5548216f3cee30dcf4fa17f434961053016e2..135abebdacb7acacb4499d1bc0c1176a2decf11f 100644 (file)
@@ -57,6 +57,7 @@
 
 pub use rustc_serialize::hex::ToHex;
 
+pub mod macros;
 pub mod svh;
 pub mod base_n;
 pub mod bit_set;
diff --git a/src/librustc_data_structures/macros.rs b/src/librustc_data_structures/macros.rs
new file mode 100644 (file)
index 0000000..3cc91b0
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+/// A simple static assertion macro. The first argument should be a unique
+/// ALL_CAPS identifier that describes the condition.
+#[macro_export]
+macro_rules! static_assert {
+    ($name:ident: $test:expr) => {
+        // Use the bool to access an array such that if the bool is false, the access
+        // is out-of-bounds.
+        #[allow(dead_code)]
+        static $name: () = [()][!$test as usize];
+    }
+}
index dee50f5ab2679eaba6023ca62d47f83c107d285b..2a8a0baf571b04475d654067ba82b23ae584c2e0 100644 (file)
@@ -490,7 +490,7 @@ fn create_dir(sess: &Session, path: &Path, dir_tag: &str) -> Result<(),()> {
     }
 }
 
-/// Allocate the lock-file and lock it.
+/// Allocate the lock-file and lock it.
 fn lock_directory(sess: &Session,
                   session_dir: &Path)
                   -> Result<(flock::Lock, PathBuf), ()> {
index 91008e8f9690ecf154c6c94d213ed5e906c0bebc..b3e159dd84457c14b2a35ca5d7821a84024195eb 100644 (file)
@@ -11,7 +11,7 @@
 use rustc::mir::{BasicBlock, Location, Mir};
 use rustc_data_structures::indexed_vec::{Idx, IndexVec};
 
-/// Maps between a MIR Location, which identifies the a particular
+/// Maps between a MIR Location, which identifies a particular
 /// statement within a basic block, to a "rich location", which
 /// identifies at a finer granularity. In particular, we distinguish
 /// the *start* of a statement and the *mid-point*. The mid-point is
index 3607ae4f5088d4b3bf97ad6b30ecf83f389660a3..2b7ef38d3edf940bfd4298619a703229eeb99dcf 100644 (file)
@@ -112,7 +112,7 @@ impl RegionValueElements {
         } = self.to_location(index);
         if statement_index == 0 {
             // If this is a basic block head, then the predecessors are
-            // the the terminators of other basic blocks
+            // the terminators of other basic blocks
             stack.extend(
                 mir.predecessors_for(block)
                     .iter()
index 9bc3fbe7c245a9ef3238439977640aabd963dba7..0c0f50c1fd70907fee7e855b88f8cc90b499649a 100644 (file)
@@ -1254,21 +1254,25 @@ fn process_use_tree(&mut self,
                     Vec::new()
                 };
 
-                let sub_span =
-                    self.span.sub_span_of_token(use_tree.span, token::BinOp(token::Star));
-                if !self.span.filter_generated(use_tree.span) {
-                    let span =
-                        self.span_from_span(sub_span.expect("No span found for use glob"));
-                    self.dumper.import(&access, Import {
-                        kind: ImportKind::GlobUse,
-                        ref_id: None,
-                        span,
-                        alias_span: None,
-                        name: "*".to_owned(),
-                        value: names.join(", "),
-                        parent,
-                    });
-                    self.write_sub_paths(&path);
+                // Otherwise it's a span with wrong macro expansion info, which
+                // we don't want to track anyway, since it's probably macro-internal `use`
+                if let Some(sub_span) =
+                    self.span.sub_span_of_token(use_tree.span, token::BinOp(token::Star))
+                {
+                    if !self.span.filter_generated(use_tree.span) {
+                        let span = self.span_from_span(sub_span);
+
+                        self.dumper.import(&access, Import {
+                            kind: ImportKind::GlobUse,
+                            ref_id: None,
+                            span,
+                            alias_span: None,
+                            name: "*".to_owned(),
+                            value: names.join(", "),
+                            parent,
+                        });
+                        self.write_sub_paths(&path);
+                    }
                 }
             }
             ast::UseTreeKind::Nested(ref nested_items) => {
index 7dfdb926c60ef63a0b9f8fe8d71fb0bfe451e660..091af449095aab80ef0876465dba968cdc1ab423 100644 (file)
@@ -548,7 +548,7 @@ pub struct FnCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
     /// current expression. As each subpart is processed, they may set
     /// the flag to `Always` etc.  Finally, at the end, we take the
     /// result and "union" it with the original value, so that when we
-    /// return the flag indicates if any subpart of the the parent
+    /// return the flag indicates if any subpart of the parent
     /// expression (up to and including this part) has diverged.  So,
     /// if you read it after evaluating a subexpression `X`, the value
     /// you get indicates whether any subexpression that was
index ec979dea4fd03fb0a03ba73cb85140f53c12b7b3..370f8857f1400926a45775992fbf01dee13826e2 100644 (file)
@@ -31,7 +31,7 @@
 /// On-demand query: yields a map containing all types mapped to their inherent impls.
 pub fn crate_inherent_impls<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                       crate_num: CrateNum)
-                                      -> CrateInherentImpls {
+                                      -> Lrc<CrateInherentImpls> {
     assert_eq!(crate_num, LOCAL_CRATE);
 
     let krate = tcx.hir.krate();
@@ -42,7 +42,7 @@ pub fn crate_inherent_impls<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         }
     };
     krate.visit_all_item_likes(&mut collect);
-    collect.impls_map
+    Lrc::new(collect.impls_map)
 }
 
 /// On-demand query: yields a vector of the inherent impls for a specific type.
index c39b71e33ca0cecfe1491bcead121dd6e4c5f472..5a020749f3577d4b2eaaf351d13ced1a26bb612d 100644 (file)
@@ -3499,13 +3499,16 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
         // forcefully don't inline if this is not public or if the
         // #[doc(no_inline)] attribute is present.
         // Don't inline doc(hidden) imports so they can be stripped at a later stage.
-        let denied = !self.vis.node.is_pub() || self.attrs.iter().any(|a| {
+        let mut denied = !self.vis.node.is_pub() || self.attrs.iter().any(|a| {
             a.name() == "doc" && match a.meta_item_list() {
                 Some(l) => attr::list_contains_name(&l, "no_inline") ||
                            attr::list_contains_name(&l, "hidden"),
                 None => false,
             }
         });
+        // Also check whether imports were asked to be inlined, in case we're trying to re-export a
+        // crate in Rust 2018+
+        let please_inline = self.attrs.lists("doc").has_word("inline");
         let path = self.path.clean(cx);
         let inner = if self.glob {
             if !denied {
@@ -3518,6 +3521,16 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
             Import::Glob(resolve_use_source(cx, path))
         } else {
             let name = self.name;
+            if !please_inline {
+                match path.def {
+                    Def::Mod(did) => if !did.is_local() && did.index == CRATE_DEF_INDEX {
+                        // if we're `pub use`ing an extern crate root, don't inline it unless we
+                        // were specifically asked for it
+                        denied = true;
+                    }
+                    _ => {}
+                }
+            }
             if !denied {
                 let mut visited = FxHashSet::default();
                 if let Some(items) = inline::try_inline(cx, path.def, name, &mut visited) {
index 4425712eed7a15aaf9fecc4ae761453769f31aac..55415e973c50ae0d0fc6775caac07debdb60d7bc 100644 (file)
     onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {
         if (hasClass(e, 'compile_fail')) {
             e.addEventListener("mouseover", function(event) {
-                e.previousElementSibling.childNodes[0].style.color = '#f00';
+                this.parentElement.previousElementSibling.childNodes[0].style.color = '#f00';
             });
             e.addEventListener("mouseout", function(event) {
-                e.previousElementSibling.childNodes[0].style.color = '';
+                this.parentElement.previousElementSibling.childNodes[0].style.color = '';
             });
         } else if (hasClass(e, 'ignore')) {
             e.addEventListener("mouseover", function(event) {
-                e.previousElementSibling.childNodes[0].style.color = '#ff9200';
+                this.parentElement.previousElementSibling.childNodes[0].style.color = '#ff9200';
             });
             e.addEventListener("mouseout", function(event) {
-                e.previousElementSibling.childNodes[0].style.color = '';
+                this.parentElement.previousElementSibling.childNodes[0].style.color = '';
             });
         }
         lineNumbersFunc(e);
index 1ae3b0b88c6dd5ea1f6120cf9471b7524da452d0..0f9104f91b4c028c94a34542303bdd15c9121417 100644 (file)
@@ -284,6 +284,7 @@ nav.sub {
 
 body:not(.source) .example-wrap {
        display: inline-flex;
+       margin-bottom: 10px;
 }
 
 .example-wrap {
@@ -303,6 +304,10 @@ body:not(.source) .example-wrap > pre.rust {
        width: 100%;
 }
 
+body:not(.source) .example-wrap > pre {
+       margin: 0;
+}
+
 #search {
        margin-left: 230px;
        position: relative;
index 87ffe0f15e45461032f31da6de9159016b7795c6..66718b95408ca160f90bb3fd6f40506addc8a1be 100644 (file)
@@ -1091,7 +1091,7 @@ pub fn from_bytes_with_nul(bytes: &[u8])
     /// [`CString`]: struct.CString.html
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn as_ptr(&self) -> *const c_char {
+    pub const fn as_ptr(&self) -> *const c_char {
         self.inner.as_ptr()
     }
 
index 96c92ceb5bb4127052b311a03b2ed4b5b86f6625..15fbb10592133f38112e8a022deaae6fff760a40 100644 (file)
@@ -16,7 +16,7 @@
 
 /// The entry point for panic of Rust threads.
 ///
-/// This allows a program to to terminate immediately and provide feedback
+/// This allows a program to terminate immediately and provide feedback
 /// to the caller of the program. `panic!` should be used when a program reaches
 /// an unrecoverable problem.
 ///
index d45a66ef6653257455594c7239fe002bc91acbb9..2517c45696a2db4875c82fcf8d05b87b3800cf9e 100644 (file)
@@ -424,7 +424,7 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
     /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false);
     /// ```
     #[stable(feature = "ip_shared", since = "1.12.0")]
-    pub fn is_unspecified(&self) -> bool {
+    pub const fn is_unspecified(&self) -> bool {
         self.inner.s_addr == 0
     }
 
@@ -862,7 +862,6 @@ impl Ipv6Addr {
     /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_ip")]
     pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16,
                      g: u16, h: u16) -> Ipv6Addr {
         Ipv6Addr {
@@ -1224,7 +1223,7 @@ pub fn to_ipv4(&self) -> Option<Ipv4Addr> {
     ///            [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
     /// ```
     #[stable(feature = "ipv6_to_octets", since = "1.12.0")]
-    pub fn octets(&self) -> [u8; 16] {
+    pub const fn octets(&self) -> [u8; 16] {
         self.inner.s6_addr
     }
 }
index a9219f75362db4dddb74cb879b98b305d05d5731..327ad7f64c23f299bc36b0d38563f2996547281c 100644 (file)
@@ -764,14 +764,15 @@ pub fn spawn(&mut self) -> io::Result<Child> {
     ///
     /// ```should_panic
     /// use std::process::Command;
+    /// use std::io::{self, Write};
     /// let output = Command::new("/bin/cat")
     ///                      .arg("file.txt")
     ///                      .output()
     ///                      .expect("failed to execute process");
     ///
     /// println!("status: {}", output.status);
-    /// println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
-    /// println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
+    /// io::stdout().write_all(&output.stdout).unwrap();
+    /// io::stderr().write_all(&output.stderr).unwrap();
     ///
     /// assert!(output.status.success());
     /// ```
@@ -951,6 +952,7 @@ pub fn piped() -> Stdio { Stdio(imp::Stdio::MakePipe) }
     ///
     /// ```no_run
     /// use std::process::{Command, Stdio};
+    /// use std::io::{self, Write};
     ///
     /// let output = Command::new("rev")
     ///     .stdin(Stdio::inherit())
@@ -958,7 +960,8 @@ pub fn piped() -> Stdio { Stdio(imp::Stdio::MakePipe) }
     ///     .output()
     ///     .expect("Failed to execute command");
     ///
-    /// println!("You piped in the reverse of: {}", String::from_utf8_lossy(&output.stdout));
+    /// print!("You piped in the reverse of: ");
+    /// io::stdout().write_all(&output.stdout).unwrap();
     /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn inherit() -> Stdio { Stdio(imp::Stdio::Inherit) }
index 2f17bc0548cad75c77fa58445fff0e92e99ffea5..808e19d6f120f0f069f6fb5bc7a940fbffaf2db9 100644 (file)
@@ -20,6 +20,8 @@
 use ptr::P;
 use rustc_data_structures::indexed_vec;
 use rustc_data_structures::indexed_vec::Idx;
+#[cfg(target_arch = "x86_64")]
+use rustc_data_structures::static_assert;
 use rustc_target::spec::abi::Abi;
 use source_map::{dummy_spanned, respan, Spanned};
 use symbol::{keywords, Symbol};
@@ -924,6 +926,10 @@ pub struct Expr {
     pub attrs: ThinVec<Attribute>,
 }
 
+// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
+#[cfg(target_arch = "x86_64")]
+static_assert!(MEM_SIZE_OF_EXPR: std::mem::size_of::<Expr>() == 88);
+
 impl Expr {
     /// Whether this expression would be valid somewhere that expects a value, for example, an `if`
     /// condition.
index 7a0a764d4639ae117bc78e33ce412a8b5d5c1f9a..f31d80acbfa4ef217b30586a553021142ce5b50d 100644 (file)
@@ -122,7 +122,7 @@ fn len(&self) -> usize {
         }
     }
 
-    /// The the `index`-th token tree of `self`.
+    /// The `index`-th token tree of `self`.
     fn get_tt(&self, index: usize) -> TokenTree {
         match *self {
             TtSeq(ref v) => v[index].clone(),
index 74363f3e5f7d968931a36fccfcd8489fa1dd8c6c..218486748315d6bf88da9b88757233d9a0b1d726 100644 (file)
@@ -496,7 +496,7 @@ fn parse_sep_and_kleene_op_2015<I>(
                         return (None, KleeneOp::ZeroOrMore);
                     }
 
-                    // #2 is a Kleene op, which is the the only valid option
+                    // #2 is a Kleene op, which is the only valid option
                     Ok(Ok((op, _))) => {
                         // Warn that `?` as a separator will be deprecated
                         sess.buffer_lint(
index 9fa0b40d49c20a2dd77ccb7553aa30cc27a25ffe..e519d48ac1d4d98fee30da05119d8534fce44902 100644 (file)
@@ -31,7 +31,7 @@ struct CheckId<T:HasId> { v: T }
 // In the code below, the impl of HasId for `&'a usize` does not
 // actually access the borrowed data, but the point is that the
 // interface to CheckId does not (and cannot) know that, and therefore
-// when encountering the a value V of type CheckId<S>, we must
+// when encountering a value V of type CheckId<S>, we must
 // conservatively force the type S to strictly outlive V.
 impl<T:HasId> Drop for CheckId<T> {
     fn drop(&mut self) {
diff --git a/src/test/rustdoc/inline_cross/auxiliary/use_crate.rs b/src/test/rustdoc/inline_cross/auxiliary/use_crate.rs
new file mode 100644 (file)
index 0000000..55202de
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub mod asdf {
+    pub struct SomeStruct;
+}
+
+pub trait SomeTrait {}
diff --git a/src/test/rustdoc/inline_cross/auxiliary/use_crate_2.rs b/src/test/rustdoc/inline_cross/auxiliary/use_crate_2.rs
new file mode 100644 (file)
index 0000000..1f11cbc
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub struct SomethingElse;
diff --git a/src/test/rustdoc/inline_cross/use_crate.rs b/src/test/rustdoc/inline_cross/use_crate.rs
new file mode 100644 (file)
index 0000000..a987044
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:use_crate.rs
+// aux-build:use_crate_2.rs
+// build-aux-docs
+// edition:2018
+// compile-flags:--extern use_crate --extern use_crate_2 -Z unstable-options
+
+// During the buildup to Rust 2018, rustdoc would eagerly inline `pub use some_crate;` as if it
+// were a module, so we changed it to make `pub use`ing crate roots remain as a `pub use` statement
+// in docs... unless you added `#[doc(inline)]`.
+
+#![crate_name = "local"]
+
+// @!has-dir local/use_crate
+// @has local/index.html
+// @has - '//code' 'pub use use_crate'
+pub use use_crate;
+
+// @has-dir local/asdf
+// @has local/asdf/index.html
+// @has local/index.html '//a/@href' 'asdf/index.html'
+pub use use_crate::asdf;
+
+// @has-dir local/use_crate_2
+// @has local/use_crate_2/index.html
+// @has local/index.html '//a/@href' 'use_crate_2/index.html'
+#[doc(inline)]
+pub use use_crate_2;
index d3307bb4d42c1076f23e1df42d9f9c4392bafb38..6cc7f1743ad07c440f9d63070ef479e4fcb0bac6 100644 (file)
@@ -18,6 +18,7 @@
 extern crate src_links_external;
 
 // @has foo/bar/index.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#11'
+#[doc(inline)]
 pub use src_links_external as bar;
 
 // @has foo/bar/struct.Foo.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#11'
index 4481b75840487440d363502b2ec0f832fce9164e..c8bed4a2b77e147c29913c9477b1edb6a9339e58 100644 (file)
@@ -10,8 +10,6 @@
 
 // compile-pass
 
-#![feature(duration_getters)]
-
 use std::time::Duration;
 
 fn main() {
index d6ffca09e96d84a2717d443efac48cd384ed76e9..4136a7b6a724f2416970fd87009541dfc377fe78 100644 (file)
@@ -23,13 +23,16 @@ unsafe impl Sync for Foo {}
 
 static FOO: Foo = Foo(UnsafeCell::new(42));
 
+fn foo() {}
+
 static BAR: () = unsafe {
     *FOO.0.get() = 5;
-    //~^ ERROR calls in statics are limited to constant functions, tuple structs and tuple variants
-
+    //~^ ERROR statements in statics are unstable (see issue #48821)
     // This error is caused by a separate bug that the feature gate error is reported
     // even though the feature gate "const_let" is active.
-    //~| statements in statics are unstable (see issue #48821)
+
+    foo();
+    //~^ ERROR calls in statics are limited to constant functions, tuple structs and tuple variants
 };
 
 fn main() {
index 8eaed1dcab116b099a8d952bd4475e17c0ec73f7..c2bba27e4d1e29992595d93cd3daef068e290857 100644 (file)
@@ -1,17 +1,17 @@
-error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
-  --> $DIR/mod-static-with-const-fn.rs:27:6
-   |
-LL |     *FOO.0.get() = 5;
-   |      ^^^^^^^^^^^
-
 error[E0658]: statements in statics are unstable (see issue #48821)
-  --> $DIR/mod-static-with-const-fn.rs:27:5
+  --> $DIR/mod-static-with-const-fn.rs:29:5
    |
 LL |     *FOO.0.get() = 5;
    |     ^^^^^^^^^^^^^^^^
    |
    = help: add #![feature(const_let)] to the crate attributes to enable
 
+error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
+  --> $DIR/mod-static-with-const-fn.rs:34:5
+   |
+LL |     foo();
+   |     ^^^^^
+
 error: aborting due to 2 previous errors
 
 Some errors occurred: E0015, E0658.
diff --git a/src/test/ui/consts/std/cell.rs b/src/test/ui/consts/std/cell.rs
new file mode 100644 (file)
index 0000000..cf6c0f2
--- /dev/null
@@ -0,0 +1,30 @@
+use std::cell::*;
+
+// not ok, because this would create a silent constant with interior mutability.
+// the rules could be relaxed in the future
+static FOO: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr());
+//~^ ERROR cannot borrow a constant which may contain interior mutability
+
+static FOO3: Wrap<Cell<u32>> = Wrap(Cell::new(42));
+// ok
+static FOO4: Wrap<*mut u32> = Wrap(FOO3.0.as_ptr());
+
+// not ok, because the `as_ptr` call takes a reference to a type with interior mutability
+// which is not allowed in constants
+const FOO2: *mut u32 = Cell::new(42).as_ptr();
+//~^ ERROR cannot borrow a constant which may contain interior mutability
+
+struct IMSafeTrustMe(UnsafeCell<u32>);
+unsafe impl Send for IMSafeTrustMe {}
+unsafe impl Sync for IMSafeTrustMe {}
+
+static BAR: IMSafeTrustMe = IMSafeTrustMe(UnsafeCell::new(5));
+
+
+struct Wrap<T>(T);
+unsafe impl<T> Send for Wrap<T> {}
+unsafe impl<T> Sync for Wrap<T> {}
+
+static BAR_PTR: Wrap<*mut u32> = Wrap(BAR.0.get());
+
+fn main() {}
diff --git a/src/test/ui/consts/std/cell.stderr b/src/test/ui/consts/std/cell.stderr
new file mode 100644 (file)
index 0000000..f75aadf
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
+  --> $DIR/cell.rs:5:35
+   |
+LL | static FOO: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr());
+   |                                   ^^^^^^^^^^^^^
+
+error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
+  --> $DIR/cell.rs:14:24
+   |
+LL | const FOO2: *mut u32 = Cell::new(42).as_ptr();
+   |                        ^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0492`.
diff --git a/src/test/ui/consts/std/char.rs b/src/test/ui/consts/std/char.rs
new file mode 100644 (file)
index 0000000..fe79059
--- /dev/null
@@ -0,0 +1,9 @@
+// run-pass
+
+static X: bool = 'a'.is_ascii();
+static Y: bool = 'รค'.is_ascii();
+
+fn main() {
+    assert!(X);
+    assert!(!Y);
+}
diff --git a/src/test/ui/consts/std/iter.rs b/src/test/ui/consts/std/iter.rs
new file mode 100644 (file)
index 0000000..e9af781
--- /dev/null
@@ -0,0 +1,9 @@
+// run-pass
+
+const I: std::iter::Empty<u32> = std::iter::empty();
+
+fn main() {
+    for i in I {
+        panic!("magical value creation: {}", i);
+    }
+}
diff --git a/src/test/ui/consts/std/slice.rs b/src/test/ui/consts/std/slice.rs
new file mode 100644 (file)
index 0000000..ad38105
--- /dev/null
@@ -0,0 +1,10 @@
+// compile-pass
+
+struct Wrap<T>(T);
+unsafe impl<T> Send for Wrap<T> {}
+unsafe impl<T> Sync for Wrap<T> {}
+
+static FOO: Wrap<*const u32> = Wrap([42, 44, 46].as_ptr());
+static BAR: Wrap<*const u8> = Wrap("hello".as_ptr());
+
+fn main() {}
index 5bb8bb024ed5145a636c3764d752b5bee0a4643e..c23b43dfff706e5d91fd1056a08600ce90c1c665 100644 (file)
@@ -13,7 +13,7 @@
 // not descend further into the mod for other occurrences of the same
 // error.
 //
-// This file sits on its own because the the "weird" occurrences here
+// This file sits on its own because the "weird" occurrences here
 // signal errors, making it incompatible with the "warnings only"
 // nature of issue-43106-gating-of-builtin-attrs.rs
 
diff --git a/src/test/ui/rfc-2306/convert-id-const-no-gate.rs b/src/test/ui/rfc-2306/convert-id-const-no-gate.rs
deleted file mode 100644 (file)
index 545c179..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// This test should fail since identity is not stable as a const fn yet.
-
-#![feature(convert_id)]
-
-fn main() {
-    const _FOO: u8 = ::std::convert::identity(42u8);
-}
diff --git a/src/test/ui/rfc-2306/convert-id-const-no-gate.stderr b/src/test/ui/rfc-2306/convert-id-const-no-gate.stderr
deleted file mode 100644 (file)
index dfd8619..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-error: `std::convert::identity` is not yet stable as a const fn
-  --> $DIR/convert-id-const-no-gate.rs:16:22
-   |
-LL |     const _FOO: u8 = ::std::convert::identity(42u8);
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: in Nightly builds, add `#![feature(const_convert_id)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
index c546f11914f814eacf7e734a1bedaf632a6ed031..2e71aee57c2f18abcf1b5f014b0537cf2310c2cd 100644 (file)
@@ -8,12 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// This test should pass since we've opted into 'identity' as an
-// unstable const fn.
+// This test should pass since 'identity' is const fn.
 
 // compile-pass
 
-#![feature(convert_id, const_convert_id)]
+#![feature(convert_id)]
 
 fn main() {
     const _FOO: u8 = ::std::convert::identity(42u8);
diff --git a/src/test/ui/rfc1445/phantom-data-is-structurally-matchable.rs b/src/test/ui/rfc1445/phantom-data-is-structurally-matchable.rs
new file mode 100644 (file)
index 0000000..af025b9
--- /dev/null
@@ -0,0 +1,53 @@
+// run-pass
+
+// This file checks that `PhantomData` is considered structurally matchable.
+
+use std::marker::PhantomData;
+
+fn main() {
+    let mut count = 0;
+
+    // A type which is not structurally matchable:
+    struct NotSM;
+
+    // And one that is:
+    #[derive(PartialEq, Eq)]
+    struct SM;
+
+    // Check that SM is #[structural_match]:
+    const CSM: SM = SM;
+    match SM {
+        CSM => count += 1,
+    };
+
+    // Check that PhantomData<T> is #[structural_match] even if T is not.
+    const CPD1: PhantomData<NotSM> = PhantomData;
+    match PhantomData {
+        CPD1 => count += 1,
+    };
+
+    // Check that PhantomData<T> is #[structural_match] when T is.
+    const CPD2: PhantomData<SM> = PhantomData;
+    match PhantomData {
+        CPD2 => count += 1,
+    };
+
+    // Check that a type which has a PhantomData is `#[structural_match]`.
+    #[derive(PartialEq, Eq, Default)]
+    struct Foo {
+        alpha: PhantomData<NotSM>,
+        beta: PhantomData<SM>,
+    }
+
+    const CFOO: Foo = Foo {
+        alpha: PhantomData,
+        beta: PhantomData,
+    };
+
+    match Foo::default() {
+        CFOO => count += 1,
+    };
+
+    // Final count must be 4 now if all
+    assert_eq!(count, 4);
+}
index f12dd31c402d9e85d11b1cc542ac477136290b5d..ed2114b653015806cbf948b7209473f9d466a2bb 100644 (file)
@@ -490,7 +490,7 @@ fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) {
             }
 
             if !self.compile_pass {
-                // run-pass implies must_compile_sucessfully
+                // run-pass implies must_compile_successfully
                 self.compile_pass = config.parse_compile_pass(ln) || self.run_pass;
             }