From d755be69e8617544d1e382d690b97917bdede419 Mon Sep 17 00:00:00 2001 From: matthewjasper Date: Sat, 9 Dec 2017 13:50:07 +0000 Subject: [PATCH 1/7] Use a better link for method resolution in Deref docs --- src/libcore/ops/deref.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs index 80c48c7b28e..4ce0740130b 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 From dffa36c0052d9758f8f28d35d62ab3fdca4e53cc Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Mon, 11 Dec 2017 15:52:58 +0900 Subject: [PATCH 2/7] ThinLTO: updates for LLVM 5 refs: https://github.com/llvm-mirror/llvm/commit/ccb80b9c0f60f33780e5e29bf66a87bb56968b99 https://github.com/llvm-mirror/llvm/commit/e611018a3f1237c9328763027db4a616ed7be04a --- src/rustllvm/PassWrapper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 072a9144f17..e0a14f9b14f 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); } } From 0ccf1af4378dabbb944a57490e28a2ee528fe23c Mon Sep 17 00:00:00 2001 From: Nika Layzell Date: Tue, 12 Dec 2017 12:14:54 -0500 Subject: [PATCH 3/7] Expose the line and column fields from the proc_macro::LineColumn struct --- src/libproc_macro/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 4a6841aedca..6516040adb8 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`. From 2f33093ed6377dbd3ffb94d41333d3e06b6efa3d Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 12 Dec 2017 22:09:40 +0000 Subject: [PATCH 4/7] Remove message that prevents Cargo from working with --print=native-static-libs --- src/librustc_driver/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d9b67e2d27f..f67425b2334 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; From 524c3ff472a54a42c75257b803abc9dc34c7302c Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Wed, 13 Dec 2017 14:53:39 +0100 Subject: [PATCH 5/7] Remove Sync and Send implementation for RawTable The implementation was introduced when changing hash storage from Unique to *mut, but it was changed back to Unique. --- src/libstd/collections/hash/table.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 7e623a0af17..96f98efe4aa 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 { From 7b5981aad4431f04c8c599d80d9a21d50d680ae1 Mon Sep 17 00:00:00 2001 From: varkor Date: Thu, 14 Dec 2017 14:19:57 +0000 Subject: [PATCH 6/7] Fix division-by-zero ICE in -Z perf-stats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An invalid average now simply prints “N/A”. Fixes #46725. --- src/librustc/session/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 36c1966bdc8..85e24b16752 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: {}", From 6f6ece29913cc5faf86dedfd2a4548e789935008 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 15 Dec 2017 02:07:12 +0200 Subject: [PATCH 7/7] doc: a better example Closes #46734 --- src/libcore/iter/iterator.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 7f6d627536d..35cd7441c66 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); /// ``` ///