mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
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:
commit
50f6c3ece0
@ -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);
|
||||
/// ```
|
||||
///
|
||||
|
@ -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
|
||||
|
@ -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`.
|
||||
|
@ -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: {}",
|
||||
|
@ -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;
|
||||
|
@ -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> {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user