Skip to content

Commit dee12bb

Browse files
committed
Auto merge of #68506 - tmandry:rollup-kz9d33v, r=tmandry
Rollup of 7 pull requests Successful merges: - #68424 (Suggest borrowing `Vec<NonCopy>` in for loop) - #68438 (Account for non-types in substs for opaque type error messages) - #68469 (Avoid overflow in `std::iter::Skip::count`) - #68473 (Enable ASan on Fuchsia) - #68479 (Implement `unused_parens` for block return values) - #68483 (Add my (@flip1995) name to .mailmap) - #68500 (Clear out std, not std tools) Failed merges: r? @ghost
2 parents 62f227b + 7f8a61d commit dee12bb

File tree

25 files changed

+198
-39
lines changed

25 files changed

+198
-39
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ Peter Liniker <peter.liniker+github@gmail.com>
211211
Phil Dawes <phil@phildawes.net> Phil Dawes <pdawes@drw.com>
212212
Philipp Brüschweiler <blei42@gmail.com> <blei42@gmail.com>
213213
Philipp Brüschweiler <blei42@gmail.com> <bruphili@student.ethz.ch>
214+
Philipp Krones <hello@philkrones.com> flip1995 <hello@philkrones.com>
214215
Philipp Matthias Schäfer <philipp.matthias.schaefer@posteo.de>
215216
Przemysław Wesołek <jest@go.art.pl> Przemek Wesołek <jest@go.art.pl>
216217
Rafael Ávila de Espíndola <respindola@mozilla.com> Rafael Avila de Espindola <espindola@dream.(none)>

src/bootstrap/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ impl<'a> Builder<'a> {
874874
//
875875
// Only clear out the directory if we're compiling std; otherwise, we
876876
// should let Cargo take care of things for us (via depdep info)
877-
if !self.config.dry_run && mode == Mode::ToolStd && cmd == "build" {
877+
if !self.config.dry_run && mode == Mode::Std && cmd == "build" {
878878
self.clear_if_dirty(&out_dir, &self.rustc(compiler));
879879
}
880880

src/bootstrap/native.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,24 @@ fn supported_sanitizers(out_dir: &Path, target: Interned<String>) -> Vec<Sanitiz
659659
});
660660
}
661661
}
662+
"x86_64-fuchsia" => {
663+
for s in &["asan"] {
664+
result.push(SanitizerRuntime {
665+
cmake_target: format!("clang_rt.{}-x86_64", s),
666+
path: out_dir.join(&format!("build/lib/fuchsia/libclang_rt.{}-x86_64.a", s)),
667+
name: format!("librustc_rt.{}.a", s),
668+
});
669+
}
670+
}
671+
"aarch64-fuchsia" => {
672+
for s in &["asan"] {
673+
result.push(SanitizerRuntime {
674+
cmake_target: format!("clang_rt.{}-aarch64", s),
675+
path: out_dir.join(&format!("build/lib/fuchsia/libclang_rt.{}-aarch64.a", s)),
676+
name: format!("librustc_rt.{}.a", s),
677+
});
678+
}
679+
}
662680
_ => {}
663681
}
664682
result

src/libcore/iter/adapters/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,8 +1815,14 @@ where
18151815
}
18161816

18171817
#[inline]
1818-
fn count(self) -> usize {
1819-
self.iter.count().saturating_sub(self.n)
1818+
fn count(mut self) -> usize {
1819+
if self.n > 0 {
1820+
// nth(n) skips n+1
1821+
if self.iter.nth(self.n - 1).is_none() {
1822+
return 0;
1823+
}
1824+
}
1825+
self.iter.count()
18201826
}
18211827

18221828
#[inline]

src/libcore/option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ use crate::{
151151

152152
/// The `Option` type. See [the module level documentation](index.html) for more.
153153
#[derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
154+
#[rustc_diagnostic_item = "option_type"]
154155
#[stable(feature = "rust1", since = "1.0.0")]
155156
pub enum Option<T> {
156157
/// No value

src/libcore/result.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ use crate::ops::{self, Deref, DerefMut};
242242
/// [`Err`]: enum.Result.html#variant.Err
243243
#[derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
244244
#[must_use = "this `Result` may be an `Err` variant, which should be handled"]
245+
#[rustc_diagnostic_item = "result_type"]
245246
#[stable(feature = "rust1", since = "1.0.0")]
246247
pub enum Result<T, E> {
247248
/// Contains the success value

src/librustc/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,7 @@ impl<'tcx> AdtDef {
24102410

24112411
#[inline]
24122412
pub fn variant_range(&self) -> Range<VariantIdx> {
2413-
(VariantIdx::new(0)..VariantIdx::new(self.variants.len()))
2413+
VariantIdx::new(0)..VariantIdx::new(self.variants.len())
24142414
}
24152415

24162416
/// Computes the discriminant value used by a specific variant.

src/librustc/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl<'tcx> GeneratorSubsts<'tcx> {
529529
pub fn variant_range(&self, def_id: DefId, tcx: TyCtxt<'tcx>) -> Range<VariantIdx> {
530530
// FIXME requires optimized MIR
531531
let num_variants = tcx.generator_layout(def_id).variant_fields.len();
532-
(VariantIdx::new(0)..VariantIdx::new(num_variants))
532+
VariantIdx::new(0)..VariantIdx::new(num_variants)
533533
}
534534

535535
/// The discriminant for the given variant. Panics if the `variant_index` is

src/librustc_codegen_ssa/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ fn link_sanitizer_runtime(sess: &Session, crate_type: config::CrateType, linker:
777777
linker.args(&["-Wl,-rpath".into(), "-Xlinker".into(), rpath.into()]);
778778
linker.link_dylib(Symbol::intern(&libname));
779779
}
780-
"x86_64-unknown-linux-gnu" => {
780+
"x86_64-unknown-linux-gnu" | "x86_64-fuchsia" | "aarch64-fuchsia" => {
781781
let filename = format!("librustc_rt.{}.a", name);
782782
let path = default_tlib.join(&filename);
783783
linker.link_whole_rlib(&path);

src/librustc_data_structures/sorted_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<K: Ord, V> SortedMap<K, V> {
132132
R: RangeBounds<K>,
133133
{
134134
let (start, end) = self.range_slice_indices(range);
135-
(&self.data[start..end])
135+
&self.data[start..end]
136136
}
137137

138138
#[inline]

0 commit comments

Comments
 (0)