diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 7f6d627536da..35cd7441c66b 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -621,27 +621,24 @@ pub trait Iterator { /// Basic usage: /// /// ``` - /// let a = ["1", "2", "lol"]; + /// let a = ["1", "lol", "3", "NaN", "5"]; /// /// let mut iter = a.iter().filter_map(|s| s.parse().ok()); /// /// assert_eq!(iter.next(), Some(1)); - /// assert_eq!(iter.next(), Some(2)); + /// assert_eq!(iter.next(), Some(3)); + /// assert_eq!(iter.next(), Some(5)); /// assert_eq!(iter.next(), None); /// ``` /// /// Here's the same example, but with [`filter`] and [`map`]: /// /// ``` - /// let a = ["1", "2", "lol"]; - /// - /// let mut iter = a.iter() - /// .map(|s| s.parse()) - /// .filter(|s| s.is_ok()) - /// .map(|s| s.unwrap()); - /// + /// let a = ["1", "lol", "3", "NaN", "5"]; + /// let mut iter = a.iter().map(|s| s.parse()).filter(|s| s.is_ok()).map(|s| s.unwrap()); /// assert_eq!(iter.next(), Some(1)); - /// assert_eq!(iter.next(), Some(2)); + /// assert_eq!(iter.next(), Some(3)); + /// assert_eq!(iter.next(), Some(5)); /// assert_eq!(iter.next(), None); /// ``` /// diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs index 80c48c7b28ef..4ce0740130b9 100644 --- a/src/libcore/ops/deref.rs +++ b/src/libcore/ops/deref.rs @@ -35,13 +35,13 @@ /// /// For more details, visit [the chapter in *The Rust Programming Language*] /// [book] as well as the reference sections on [the dereference operator] -/// [ref-deref-op], [the `Deref` trait][ref-deref-trait], and [type coercions]. +/// [ref-deref-op], [method resolution] and [type coercions]. /// /// [book]: ../../book/second-edition/ch15-02-deref.html /// [`DerefMut`]: trait.DerefMut.html /// [more]: #more-on-deref-coercion /// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator -/// [ref-deref-trait]: ../../reference/the-deref-trait.html +/// [method resolution]: ../../reference/expressions/method-call-expr.html /// [type coercions]: ../../reference/type-coercions.html /// /// # Examples @@ -122,13 +122,13 @@ impl<'a, T: ?Sized> Deref for &'a mut T { /// /// For more details, visit [the chapter in *The Rust Programming Language*] /// [book] as well as the reference sections on [the dereference operator] -/// [ref-deref-op], [the `Deref` trait][ref-deref-trait], and [type coercions]. +/// [ref-deref-op], [method resolution] and [type coercions]. /// /// [book]: ../../book/second-edition/ch15-02-deref.html /// [`Deref`]: trait.Deref.html /// [more]: #more-on-deref-coercion /// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator -/// [ref-deref-trait]: ../../reference/the-deref-trait.html +/// [method resolution]: ../../reference/expressions/method-call-expr.html /// [type coercions]: ../../reference/type-coercions.html /// /// # Examples diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 625edc02b772..41ccd88b4a88 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -265,10 +265,12 @@ impl Span { #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct LineColumn { /// The 1-indexed line in the source file on which the span starts or ends (inclusive). - line: usize, + #[unstable(feature = "proc_macro", issue = "38356")] + pub line: usize, /// The 0-indexed column (in UTF-8 characters) in the source file on which /// the span starts or ends (inclusive). - column: usize + #[unstable(feature = "proc_macro", issue = "38356")] + pub column: usize } /// The source file of a given `Span`. diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index d6f72fb116dc..a9200a3c8059 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -635,9 +635,13 @@ impl Session { self.perf_stats.incr_comp_hashes_count.get()); println!("Total number of bytes hashed for incr. comp.: {}", self.perf_stats.incr_comp_bytes_hashed.get()); - println!("Average bytes hashed per incr. comp. HIR node: {}", - self.perf_stats.incr_comp_bytes_hashed.get() / - self.perf_stats.incr_comp_hashes_count.get()); + if self.perf_stats.incr_comp_hashes_count.get() != 0 { + println!("Average bytes hashed per incr. comp. HIR node: {}", + self.perf_stats.incr_comp_bytes_hashed.get() / + self.perf_stats.incr_comp_hashes_count.get()); + } else { + println!("Average bytes hashed per incr. comp. HIR node: N/A"); + } println!("Total time spent computing symbol hashes: {}", duration_to_secs_str(self.perf_stats.symbol_hash_time.get())); println!("Total time spent decoding DefPath tables: {}", diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 8bfcb0cca05b..29d3d31e4515 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -810,9 +810,8 @@ impl RustcDefaultCalls { PrintRequest::TargetCPUs | PrintRequest::TargetFeatures => { rustc_trans::print(*req, sess); } - PrintRequest::NativeStaticLibs => { - println!("Native static libs can be printed only during linking"); - } + // Any output here interferes with Cargo's parsing of other printed output + PrintRequest::NativeStaticLibs => {} } } return Compilation::Stop; diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 7e623a0af17c..96f98efe4aaa 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -123,9 +123,6 @@ pub struct RawTable { marker: marker::PhantomData<(K, V)>, } -unsafe impl Send for RawTable {} -unsafe impl Sync for RawTable {} - // An unsafe view of a RawTable bucket // Valid indexes are within [0..table_capacity) pub struct RawBucket { diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 072a9144f17a..e0a14f9b14f8 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -969,11 +969,19 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, // linkage will stay as external, and internal will stay as internal. std::set ExportedGUIDs; for (auto &List : Ret->Index) { +#if LLVM_VERSION_GE(5, 0) + for (auto &GVS: List.second.SummaryList) { +#else for (auto &GVS: List.second) { +#endif if (GlobalValue::isLocalLinkage(GVS->linkage())) continue; auto GUID = GVS->getOriginalName(); +#if LLVM_VERSION_GE(5, 0) + if (GVS->flags().Live) +#else if (!DeadSymbols.count(GUID)) +#endif ExportedGUIDs.insert(GUID); } }