Auto merge of #46745 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #46601, #46652, #46690, #46705, #46710, #46728, #46737
- Failed merges:
This commit is contained in:
bors 2017-12-15 16:08:07 +00:00
commit 50f6c3ece0
7 changed files with 32 additions and 25 deletions

View File

@ -621,27 +621,24 @@ pub trait Iterator {
/// Basic usage: /// 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()); /// let mut iter = a.iter().filter_map(|s| s.parse().ok());
/// ///
/// assert_eq!(iter.next(), Some(1)); /// 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); /// assert_eq!(iter.next(), None);
/// ``` /// ```
/// ///
/// Here's the same example, but with [`filter`] and [`map`]: /// Here's the same example, but with [`filter`] and [`map`]:
/// ///
/// ``` /// ```
/// let a = ["1", "2", "lol"]; /// 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());
/// 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(1));
/// assert_eq!(iter.next(), Some(2)); /// assert_eq!(iter.next(), Some(3));
/// assert_eq!(iter.next(), Some(5));
/// assert_eq!(iter.next(), None); /// assert_eq!(iter.next(), None);
/// ``` /// ```
/// ///

View File

@ -35,13 +35,13 @@
/// ///
/// For more details, visit [the chapter in *The Rust Programming Language*] /// For more details, visit [the chapter in *The Rust Programming Language*]
/// [book] as well as the reference sections on [the dereference operator] /// [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 /// [book]: ../../book/second-edition/ch15-02-deref.html
/// [`DerefMut`]: trait.DerefMut.html /// [`DerefMut`]: trait.DerefMut.html
/// [more]: #more-on-deref-coercion /// [more]: #more-on-deref-coercion
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator /// [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 /// [type coercions]: ../../reference/type-coercions.html
/// ///
/// # Examples /// # 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*] /// For more details, visit [the chapter in *The Rust Programming Language*]
/// [book] as well as the reference sections on [the dereference operator] /// [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 /// [book]: ../../book/second-edition/ch15-02-deref.html
/// [`Deref`]: trait.Deref.html /// [`Deref`]: trait.Deref.html
/// [more]: #more-on-deref-coercion /// [more]: #more-on-deref-coercion
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator /// [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 /// [type coercions]: ../../reference/type-coercions.html
/// ///
/// # Examples /// # Examples

View File

@ -265,10 +265,12 @@ impl Span {
#[derive(Copy, Clone, Debug, PartialEq, Eq)] #[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct LineColumn { pub struct LineColumn {
/// The 1-indexed line in the source file on which the span starts or ends (inclusive). /// 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 0-indexed column (in UTF-8 characters) in the source file on which
/// the span starts or ends (inclusive). /// the span starts or ends (inclusive).
column: usize #[unstable(feature = "proc_macro", issue = "38356")]
pub column: usize
} }
/// The source file of a given `Span`. /// The source file of a given `Span`.

View File

@ -635,9 +635,13 @@ impl Session {
self.perf_stats.incr_comp_hashes_count.get()); self.perf_stats.incr_comp_hashes_count.get());
println!("Total number of bytes hashed for incr. comp.: {}", println!("Total number of bytes hashed for incr. comp.: {}",
self.perf_stats.incr_comp_bytes_hashed.get()); self.perf_stats.incr_comp_bytes_hashed.get());
println!("Average bytes hashed per incr. comp. HIR node: {}", if self.perf_stats.incr_comp_hashes_count.get() != 0 {
self.perf_stats.incr_comp_bytes_hashed.get() / println!("Average bytes hashed per incr. comp. HIR node: {}",
self.perf_stats.incr_comp_hashes_count.get()); 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: {}", println!("Total time spent computing symbol hashes: {}",
duration_to_secs_str(self.perf_stats.symbol_hash_time.get())); duration_to_secs_str(self.perf_stats.symbol_hash_time.get()));
println!("Total time spent decoding DefPath tables: {}", println!("Total time spent decoding DefPath tables: {}",

View File

@ -810,9 +810,8 @@ impl RustcDefaultCalls {
PrintRequest::TargetCPUs | PrintRequest::TargetFeatures => { PrintRequest::TargetCPUs | PrintRequest::TargetFeatures => {
rustc_trans::print(*req, sess); rustc_trans::print(*req, sess);
} }
PrintRequest::NativeStaticLibs => { // Any output here interferes with Cargo's parsing of other printed output
println!("Native static libs can be printed only during linking"); PrintRequest::NativeStaticLibs => {}
}
} }
} }
return Compilation::Stop; return Compilation::Stop;

View File

@ -123,9 +123,6 @@ pub struct RawTable<K, V> {
marker: marker::PhantomData<(K, V)>, marker: marker::PhantomData<(K, V)>,
} }
unsafe impl<K: Send, V: Send> Send for RawTable<K, V> {}
unsafe impl<K: Sync, V: Sync> Sync for RawTable<K, V> {}
// An unsafe view of a RawTable bucket // An unsafe view of a RawTable bucket
// Valid indexes are within [0..table_capacity) // Valid indexes are within [0..table_capacity)
pub struct RawBucket<K, V> { pub struct RawBucket<K, V> {

View File

@ -969,11 +969,19 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
// linkage will stay as external, and internal will stay as internal. // linkage will stay as external, and internal will stay as internal.
std::set<GlobalValue::GUID> ExportedGUIDs; std::set<GlobalValue::GUID> ExportedGUIDs;
for (auto &List : Ret->Index) { for (auto &List : Ret->Index) {
#if LLVM_VERSION_GE(5, 0)
for (auto &GVS: List.second.SummaryList) {
#else
for (auto &GVS: List.second) { for (auto &GVS: List.second) {
#endif
if (GlobalValue::isLocalLinkage(GVS->linkage())) if (GlobalValue::isLocalLinkage(GVS->linkage()))
continue; continue;
auto GUID = GVS->getOriginalName(); auto GUID = GVS->getOriginalName();
#if LLVM_VERSION_GE(5, 0)
if (GVS->flags().Live)
#else
if (!DeadSymbols.count(GUID)) if (!DeadSymbols.count(GUID))
#endif
ExportedGUIDs.insert(GUID); ExportedGUIDs.insert(GUID);
} }
} }