Skip to content

Commit 003d8d3

Browse files
committed
Auto merge of #89530 - workingjubilee:rollup-ua14iq6, r=workingjubilee
Rollup of 13 pull requests Successful merges: - #83655 ([aarch64] add target feature outline-atomics) - #87091 (implement advance_(back_)_by on more iterators) - #88451 (Fix an ICE caused by type mismatch errors being ignored) - #88452 (VecDeque: improve performance for From<[T; N]>) - #89400 (Improve wording of `map_or_else` docs) - #89407 (Recommend running `cargo clean` in E0514 output) - #89443 (Include the length in BTree hashes) - #89444 (rustdoc: use slice::contains instead of open-coding it) - #89447 (Improve error message for missing angle brackets in `[_]::method`) - #89453 (Consistently use 'supertrait'.) - #89483 (Practice diagnostic message convention) - #89500 (Fix ICE with buffered lint referring to AST node deleted by everybody_loops) - #89508 (Stabilize `const_panic`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 175b8db + 9866b09 commit 003d8d3

File tree

174 files changed

+922
-535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+922
-535
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,8 @@ impl Expr {
12111211
}
12121212
}
12131213

1214+
ExprKind::Underscore => TyKind::Infer,
1215+
12141216
// This expression doesn't look like a type syntactically.
12151217
_ => return None,
12161218
};

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ impl<'a> AstValidator<'a> {
590590
)
591591
.span_label(self.current_extern_span(), "in this `extern` block")
592592
.note(&format!(
593-
"This limitation may be lifted in the future; see issue #{} <https://github.com/rust-lang/rust/issues/{}> for more information",
593+
"this limitation may be lifted in the future; see issue #{} <https://github.com/rust-lang/rust/issues/{}> for more information",
594594
n, n,
595595
))
596596
.emit();

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#![feature(bool_to_option)]
44
#![feature(box_patterns)]
5-
#![feature(const_panic)]
5+
#![cfg_attr(bootstrap, feature(const_panic))]
66
#![feature(crate_visibility_modifier)]
77
#![feature(format_args_capture)]
88
#![feature(in_band_lifetimes)]

compiler/rustc_builtin_macros/src/concat_idents.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn expand_concat_idents<'cx>(
1212
tts: TokenStream,
1313
) -> Box<dyn base::MacResult + 'cx> {
1414
if tts.is_empty() {
15-
cx.span_err(sp, "concat_idents! takes 1 or more arguments.");
15+
cx.span_err(sp, "concat_idents! takes 1 or more arguments");
1616
return DummyResult::any(sp);
1717
}
1818

@@ -22,7 +22,7 @@ pub fn expand_concat_idents<'cx>(
2222
match e {
2323
TokenTree::Token(Token { kind: token::Comma, .. }) => {}
2424
_ => {
25-
cx.span_err(sp, "concat_idents! expecting comma.");
25+
cx.span_err(sp, "concat_idents! expecting comma");
2626
return DummyResult::any(sp);
2727
}
2828
}
@@ -34,7 +34,7 @@ pub fn expand_concat_idents<'cx>(
3434
}
3535
}
3636

37-
cx.span_err(sp, "concat_idents! requires ident args.");
37+
cx.span_err(sp, "concat_idents! requires ident args");
3838
return DummyResult::any(sp);
3939
}
4040
}

compiler/rustc_builtin_macros/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
382382
.note(
383383
"errors in this attribute were erroneously \
384384
allowed and will become a hard error in a \
385-
future release.",
385+
future release",
386386
)
387387
.emit();
388388
ShouldPanic::Yes(None)

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ pub fn llvm_global_features(sess: &Session) -> Vec<String> {
416416
// -Ctarget-features
417417
features.extend(sess.opts.cg.target_feature.split(',').flat_map(&filter));
418418

419+
// FIXME: Move outline-atomics to target definition when earliest supported LLVM is 12.
420+
if get_version() >= (12, 0, 0) && sess.target.llvm_target.contains("aarch64-unknown-linux") {
421+
features.push("+outline-atomics".to_string());
422+
}
423+
419424
features
420425
}
421426

compiler/rustc_const_eval/src/transform/check_consts/check.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,6 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
887887

888888
// At this point, we are calling a function, `callee`, whose `DefId` is known...
889889
if is_lang_panic_fn(tcx, callee) {
890-
self.check_op(ops::Panic);
891-
892890
// `begin_panic` and `panic_display` are generic functions that accept
893891
// types other than str. Check to enforce that only str can be used in
894892
// const-eval.

compiler/rustc_const_eval/src/transform/check_consts/ops.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -368,23 +368,6 @@ impl NonConstOp for MutDeref {
368368
}
369369
}
370370

371-
#[derive(Debug)]
372-
pub struct Panic;
373-
impl NonConstOp for Panic {
374-
fn status_in_item(&self, _: &ConstCx<'_, '_>) -> Status {
375-
Status::Unstable(sym::const_panic)
376-
}
377-
378-
fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
379-
feature_err(
380-
&ccx.tcx.sess.parse_sess,
381-
sym::const_panic,
382-
span,
383-
&format!("panicking in {}s is unstable", ccx.const_kind()),
384-
)
385-
}
386-
}
387-
388371
/// A call to a `panic()` lang item where the first argument is _not_ a `&str`.
389372
#[derive(Debug)]
390373
pub struct PanicNonStr;
@@ -407,7 +390,7 @@ impl NonConstOp for RawPtrComparison {
407390
let mut err = ccx
408391
.tcx
409392
.sess
410-
.struct_span_err(span, "pointers cannot be reliably compared during const eval.");
393+
.struct_span_err(span, "pointers cannot be reliably compared during const eval");
411394
err.note(
412395
"see issue #53020 <https://github.com/rust-lang/rust/issues/53020> \
413396
for more information",
@@ -443,7 +426,7 @@ impl NonConstOp for RawPtrToIntCast {
443426
let mut err = ccx
444427
.tcx
445428
.sess
446-
.struct_span_err(span, "pointers cannot be cast to integers during const eval.");
429+
.struct_span_err(span, "pointers cannot be cast to integers during const eval");
447430
err.note("at compile-time, pointers do not have an integer value");
448431
err.note(
449432
"avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior",

compiler/rustc_data_structures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(associated_type_bounds)]
1212
#![feature(auto_traits)]
1313
#![feature(bool_to_option)]
14-
#![feature(const_panic)]
14+
#![cfg_attr(bootstrap, feature(const_panic))]
1515
#![feature(control_flow_enum)]
1616
#![feature(core_intrinsics)]
1717
#![feature(extend_one)]

compiler/rustc_driver/src/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ trait PrinterSupport: pprust::PpAnn {
8888
/// Produces the pretty-print annotation object.
8989
///
9090
/// (Rust does not yet support upcasting from a trait object to
91-
/// an object for one of its super-traits.)
91+
/// an object for one of its supertraits.)
9292
fn pp_ann(&self) -> &dyn pprust::PpAnn;
9393
}
9494

@@ -104,7 +104,7 @@ trait HirPrinterSupport<'hir>: pprust_hir::PpAnn {
104104
/// Produces the pretty-print annotation object.
105105
///
106106
/// (Rust does not yet support upcasting from a trait object to
107-
/// an object for one of its super-traits.)
107+
/// an object for one of its supertraits.)
108108
fn pp_ann(&self) -> &dyn pprust_hir::PpAnn;
109109
}
110110

0 commit comments

Comments
 (0)