Skip to content

Commit

Permalink
Auto merge of #46745 - steveklabnik:rollup, r=steveklabnik
Browse files Browse the repository at this point in the history
Rollup of 7 pull requests

- Successful merges: #46601, #46652, #46690, #46705, #46710, #46728, #46737
- Failed merges:
  • Loading branch information
bors committed Dec 15, 2017
2 parents 5a0dc2d + b98de5d commit 50f6c3e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 25 deletions.
17 changes: 7 additions & 10 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/// ```
///
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
10 changes: 7 additions & 3 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}",
Expand Down
5 changes: 2 additions & 3 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions src/libstd/collections/hash/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ pub struct RawTable<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
// Valid indexes are within [0..table_capacity)
pub struct RawBucket<K, V> {
Expand Down
8 changes: 8 additions & 0 deletions src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,19 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
// linkage will stay as external, and internal will stay as internal.
std::set<GlobalValue::GUID> 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);
}
}
Expand Down

0 comments on commit 50f6c3e

Please sign in to comment.