Skip to content

Commit 6b2983a

Browse files
committed
Auto merge of #69606 - JohnTitor:rollup-i3nrrcf, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #69397 (bootstrap: Remove commit hash from LLVM version suffix to avoid rebuilds) - #69549 (Improve MinGW detection when cross compiling ) - #69562 (Don't `bug` when taking discriminant of generator during dataflow) - #69579 (parser: Remove `Parser::prev_span`) - #69580 (use .copied() instead of .map(|x| *x) on iterators) - #69583 (Do not ICE on invalid type node after parse recovery) - #69605 (Use `opt_def_id()` over `def_id()`) Failed merges: r? @ghost
2 parents ee50590 + 47d87d7 commit 6b2983a

File tree

40 files changed

+368
-309
lines changed

40 files changed

+368
-309
lines changed

src/bootstrap/dist.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,14 @@ fn make_win_dist(
234234
}
235235
}
236236

237-
let target_tools = ["gcc.exe", "ld.exe", "dlltool.exe", "libwinpthread-1.dll"];
237+
let compiler = if target_triple == "i686-pc-windows-gnu" {
238+
"i686-w64-mingw32-gcc.exe"
239+
} else if target_triple == "x86_64-pc-windows-gnu" {
240+
"x86_64-w64-mingw32-gcc.exe"
241+
} else {
242+
"gcc.exe"
243+
};
244+
let target_tools = [compiler, "ld.exe", "dlltool.exe", "libwinpthread-1.dll"];
238245
let mut rustc_dlls = vec!["libwinpthread-1.dll"];
239246
if target_triple.starts_with("i686-") {
240247
rustc_dlls.push("libgcc_s_dw2-1.dll");

src/bootstrap/native.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,8 @@ impl Step for Llvm {
241241
cfg.define("LLVM_VERSION_SUFFIX", suffix);
242242
}
243243
} else {
244-
let mut default_suffix =
245-
format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel,);
246-
if let Some(sha) = llvm_info.sha_short() {
247-
default_suffix.push_str("-");
248-
default_suffix.push_str(sha);
249-
}
244+
let default_suffix =
245+
format!("-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel);
250246
cfg.define("LLVM_VERSION_SUFFIX", default_suffix);
251247
}
252248

src/librustc/ich/hcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::cmp::Ord;
2020

2121
fn compute_ignored_attr_names() -> FxHashSet<Symbol> {
2222
debug_assert!(!ich::IGNORED_ATTRIBUTES.is_empty());
23-
ich::IGNORED_ATTRIBUTES.iter().map(|&s| s).collect()
23+
ich::IGNORED_ATTRIBUTES.iter().copied().collect()
2424
}
2525

2626
/// This is the context state available during incr. comp. hashing. It contains

src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ impl<'tcx> ScopeTree {
635635
/// Used to sanity check visit_expr call count when
636636
/// calculating generator interiors.
637637
pub fn body_expr_count(&self, body_id: hir::BodyId) -> Option<usize> {
638-
self.body_expr_count.get(&body_id).map(|r| *r)
638+
self.body_expr_count.get(&body_id).copied()
639639
}
640640
}
641641

src/librustc_ast_lowering/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11791179
let from_err_expr =
11801180
self.wrap_in_try_constructor(sym::from_error, unstable_span, from_expr, try_span);
11811181
let thin_attrs = ThinVec::from(attrs);
1182-
let catch_scope = self.catch_scopes.last().map(|x| *x);
1182+
let catch_scope = self.catch_scopes.last().copied();
11831183
let ret_expr = if let Some(catch_node) = catch_scope {
11841184
let target_id = Ok(self.lower_node_id(catch_node));
11851185
self.arena.alloc(self.expr(

src/librustc_builtin_macros/asm.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn parse_inline_asm<'a>(
151151

152152
let constraint = parse_asm_str(&mut p)?;
153153

154-
let span = p.prev_span;
154+
let span = p.prev_token.span;
155155

156156
p.expect(&token::OpenDelim(token::Paren))?;
157157
let expr = p.parse_expr()?;
@@ -202,15 +202,15 @@ fn parse_inline_asm<'a>(
202202
if constraint.as_str().starts_with('=') {
203203
struct_span_err!(
204204
cx.parse_sess.span_diagnostic,
205-
p.prev_span,
205+
p.prev_token.span,
206206
E0662,
207207
"input operand constraint contains '='"
208208
)
209209
.emit();
210210
} else if constraint.as_str().starts_with('+') {
211211
struct_span_err!(
212212
cx.parse_sess.span_diagnostic,
213-
p.prev_span,
213+
p.prev_token.span,
214214
E0663,
215215
"input operand constraint contains '+'"
216216
)
@@ -233,11 +233,11 @@ fn parse_inline_asm<'a>(
233233
let s = parse_asm_str(&mut p)?;
234234

235235
if OPTIONS.iter().any(|&opt| s == opt) {
236-
cx.span_warn(p.prev_span, "expected a clobber, found an option");
236+
cx.span_warn(p.prev_token.span, "expected a clobber, found an option");
237237
} else if s.as_str().starts_with('{') || s.as_str().ends_with('}') {
238238
struct_span_err!(
239239
cx.parse_sess.span_diagnostic,
240-
p.prev_span,
240+
p.prev_token.span,
241241
E0664,
242242
"clobber should not be surrounded by braces"
243243
)
@@ -259,7 +259,7 @@ fn parse_inline_asm<'a>(
259259
} else if option == sym::intel {
260260
dialect = AsmDialect::Intel;
261261
} else {
262-
cx.span_warn(p.prev_span, "unrecognized option");
262+
cx.span_warn(p.prev_token.span, "unrecognized option");
263263
}
264264

265265
if p.token == token::Comma {

src/librustc_builtin_macros/assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn parse_assert<'a>(
106106
let custom_message =
107107
if let token::Literal(token::Lit { kind: token::Str, .. }) = parser.token.kind {
108108
let mut err = cx.struct_span_warn(parser.token.span, "unexpected string literal");
109-
let comma_span = parser.prev_span.shrink_to_hi();
109+
let comma_span = parser.prev_token.span.shrink_to_hi();
110110
err.span_suggestion_short(
111111
comma_span,
112112
"try adding a comma",

src/librustc_builtin_macros/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'a, 'b> Context<'a, 'b> {
359359
refs.sort();
360360
refs.dedup();
361361
let (arg_list, mut sp) = if refs.len() == 1 {
362-
let spans: Vec<_> = spans.into_iter().filter_map(|sp| sp.map(|sp| *sp)).collect();
362+
let spans: Vec<_> = spans.into_iter().filter_map(|sp| sp.copied()).collect();
363363
(
364364
format!("argument {}", refs[0]),
365365
if spans.is_empty() {

src/librustc_expand/mbe/macro_rules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ fn check_matcher_core(
970970
msg,
971971
ts[..ts.len() - 1]
972972
.iter()
973-
.map(|s| *s)
973+
.copied()
974974
.collect::<Vec<_>>()
975975
.join(", "),
976976
ts[ts.len() - 1],

src/librustc_metadata/rmeta/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl<'tcx> EncodeContext<'tcx> {
503503
},
504504
proc_macro_data,
505505
proc_macro_stability: if is_proc_macro {
506-
tcx.lookup_stability(DefId::local(CRATE_DEF_INDEX)).map(|stab| *stab)
506+
tcx.lookup_stability(DefId::local(CRATE_DEF_INDEX)).copied()
507507
} else {
508508
None
509509
},

0 commit comments

Comments
 (0)