Skip to content

Commit 33515d7

Browse files
committed
Auto merge of #3201 - RalfJung:rustup, r=RalfJung
Rustup
2 parents d368c40 + b8a5076 commit 33515d7

File tree

371 files changed

+2474
-1831
lines changed

Some content is hidden

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

371 files changed

+2474
-1831
lines changed

Cargo.lock

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ dependencies = [
509509

510510
[[package]]
511511
name = "clap_complete"
512-
version = "4.3.1"
512+
version = "4.4.4"
513513
source = "registry+https://github.com/rust-lang/crates.io-index"
514-
checksum = "7f6b5c519bab3ea61843a7923d074b04245624bb84a64a8c150f5deb014e388b"
514+
checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae"
515515
dependencies = [
516516
"clap",
517517
]
@@ -580,7 +580,7 @@ dependencies = [
580580
"clap",
581581
"indoc",
582582
"itertools",
583-
"opener",
583+
"opener 0.5.2",
584584
"shell-escape",
585585
"walkdir",
586586
]
@@ -2340,9 +2340,9 @@ dependencies = [
23402340

23412341
[[package]]
23422342
name = "mdbook"
2343-
version = "0.4.31"
2343+
version = "0.4.36"
23442344
source = "registry+https://github.com/rust-lang/crates.io-index"
2345-
checksum = "7b67ee4a744f36e6280792016c17e69921b51df357181d1eb17d620fcc3609f3"
2345+
checksum = "80992cb0e05f22cc052c99f8e883f1593b891014b96a8b4637fd274d7030c85e"
23462346
dependencies = [
23472347
"ammonia",
23482348
"anyhow",
@@ -2355,7 +2355,8 @@ dependencies = [
23552355
"log",
23562356
"memchr",
23572357
"once_cell",
2358-
"opener",
2358+
"opener 0.6.1",
2359+
"pathdiff",
23592360
"pulldown-cmark",
23602361
"regex",
23612362
"serde",
@@ -2544,6 +2545,15 @@ dependencies = [
25442545
"minimal-lexical",
25452546
]
25462547

2548+
[[package]]
2549+
name = "normpath"
2550+
version = "1.1.1"
2551+
source = "registry+https://github.com/rust-lang/crates.io-index"
2552+
checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5"
2553+
dependencies = [
2554+
"windows-sys 0.48.0",
2555+
]
2556+
25472557
[[package]]
25482558
name = "ntapi"
25492559
version = "0.4.1"
@@ -2631,6 +2641,17 @@ dependencies = [
26312641
"winapi",
26322642
]
26332643

2644+
[[package]]
2645+
name = "opener"
2646+
version = "0.6.1"
2647+
source = "registry+https://github.com/rust-lang/crates.io-index"
2648+
checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788"
2649+
dependencies = [
2650+
"bstr",
2651+
"normpath",
2652+
"winapi",
2653+
]
2654+
26342655
[[package]]
26352656
name = "openssl"
26362657
version = "0.10.55"

compiler/rustc_abi/src/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
pub trait LayoutCalculator {
1515
type TargetDataLayoutRef: Borrow<TargetDataLayout>;
1616

17-
fn delay_bug(&self, txt: String);
17+
fn delayed_bug(&self, txt: String);
1818
fn current_data_layout(&self) -> Self::TargetDataLayoutRef;
1919

2020
fn scalar_pair<FieldIdx: Idx, VariantIdx: Idx>(
@@ -792,7 +792,7 @@ pub trait LayoutCalculator {
792792
let only_variant = &variants[VariantIdx::new(0)];
793793
for field in only_variant {
794794
if field.is_unsized() {
795-
self.delay_bug("unsized field in union".to_string());
795+
self.delayed_bug("unsized field in union".to_string());
796796
}
797797

798798
align = align.max(field.align);
@@ -1038,7 +1038,7 @@ fn univariant<
10381038
for &i in &inverse_memory_index {
10391039
let field = &fields[i];
10401040
if !sized {
1041-
this.delay_bug(format!(
1041+
this.delayed_bug(format!(
10421042
"univariant: field #{} comes after unsized field",
10431043
offsets.len(),
10441044
));

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
327327
),
328328
ExprKind::Yield(opt_expr) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
329329
ExprKind::Err => hir::ExprKind::Err(
330-
self.tcx.sess.delay_span_bug(e.span, "lowered ExprKind::Err"),
330+
self.tcx.sess.span_delayed_bug(e.span, "lowered ExprKind::Err"),
331331
),
332332
ExprKind::Try(sub_expr) => self.lower_expr_try(e.span, sub_expr),
333333

@@ -799,7 +799,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
799799
self.expr_ident_mut(span, task_context_ident, task_context_hid)
800800
} else {
801801
// Use of `await` outside of an async context, we cannot use `task_context` here.
802-
self.expr_err(span, self.tcx.sess.delay_span_bug(span, "no task_context hir id"))
802+
self.expr_err(span, self.tcx.sess.span_delayed_bug(span, "no task_context hir id"))
803803
};
804804
let new_unchecked = self.expr_call_lang_item_fn_mut(
805805
span,

compiler/rustc_ast_lowering/src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ fn make_count<'hir>(
267267
ctx.expr(
268268
sp,
269269
hir::ExprKind::Err(
270-
ctx.tcx.sess.delay_span_bug(sp, "lowered bad format_args count"),
270+
ctx.tcx.sess.span_delayed_bug(sp, "lowered bad format_args count"),
271271
),
272272
)
273273
}
@@ -306,7 +306,7 @@ fn make_format_spec<'hir>(
306306
}
307307
Err(_) => ctx.expr(
308308
sp,
309-
hir::ExprKind::Err(ctx.tcx.sess.delay_span_bug(sp, "lowered bad format_args count")),
309+
hir::ExprKind::Err(ctx.tcx.sess.span_delayed_bug(sp, "lowered bad format_args count")),
310310
),
311311
};
312312
let &FormatOptions {

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
256256
&ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
257257
|this| match ty {
258258
None => {
259-
let guar = this.tcx.sess.delay_span_bug(
259+
let guar = this.tcx.sess.span_delayed_bug(
260260
span,
261261
"expected to lower type alias type, but it was missing",
262262
);
@@ -863,7 +863,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
863863
&ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
864864
|this| match ty {
865865
None => {
866-
let guar = this.tcx.sess.delay_span_bug(
866+
let guar = this.tcx.sess.span_delayed_bug(
867867
i.span,
868868
"expected to lower associated type, but it was missing",
869869
);
@@ -996,7 +996,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
996996
fn lower_block_expr_opt(&mut self, span: Span, block: Option<&Block>) -> hir::Expr<'hir> {
997997
match block {
998998
Some(block) => self.lower_block_expr(block),
999-
None => self.expr_err(span, self.tcx.sess.delay_span_bug(span, "no block")),
999+
None => self.expr_err(span, self.tcx.sess.span_delayed_bug(span, "no block")),
10001000
}
10011001
}
10021002

@@ -1006,7 +1006,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10061006
&[],
10071007
match expr {
10081008
Some(expr) => this.lower_expr_mut(expr),
1009-
None => this.expr_err(span, this.tcx.sess.delay_span_bug(span, "no block")),
1009+
None => this.expr_err(span, this.tcx.sess.span_delayed_bug(span, "no block")),
10101010
},
10111011
)
10121012
})

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use rustc_data_structures::fx::FxHashMap;
5454
use rustc_data_structures::sorted_map::SortedMap;
5555
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
5656
use rustc_data_structures::sync::Lrc;
57-
use rustc_errors::{DiagnosticArgFromDisplay, Handler, StashKey};
57+
use rustc_errors::{DiagnosticArgFromDisplay, StashKey};
5858
use rustc_hir as hir;
5959
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
6060
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
@@ -763,10 +763,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
763763
self.resolver.get_import_res(id).present_items()
764764
}
765765

766-
fn diagnostic(&self) -> &Handler {
767-
self.tcx.sess.diagnostic()
768-
}
769-
770766
/// Reuses the span but adds information like the kind of the desugaring and features that are
771767
/// allowed inside this span.
772768
fn mark_span_with_reason(
@@ -1326,7 +1322,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13261322
let kind = match &t.kind {
13271323
TyKind::Infer => hir::TyKind::Infer,
13281324
TyKind::Err => {
1329-
hir::TyKind::Err(self.tcx.sess.delay_span_bug(t.span, "TyKind::Err lowered"))
1325+
hir::TyKind::Err(self.tcx.sess.span_delayed_bug(t.span, "TyKind::Err lowered"))
13301326
}
13311327
// FIXME(unnamed_fields): IMPLEMENTATION IN PROGRESS
13321328
#[allow(rustc::untranslatable_diagnostic)]
@@ -1510,7 +1506,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15101506
}
15111507
TyKind::MacCall(_) => panic!("`TyKind::MacCall` should have been expanded by now"),
15121508
TyKind::CVarArgs => {
1513-
let guar = self.tcx.sess.delay_span_bug(
1509+
let guar = self.tcx.sess.span_delayed_bug(
15141510
t.span,
15151511
"`TyKind::CVarArgs` should have been handled elsewhere",
15161512
);
@@ -1653,7 +1649,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16531649
} else {
16541650
self.tcx
16551651
.sess
1656-
.delay_span_bug(lifetime.ident.span, "no def-id for fresh lifetime");
1652+
.span_delayed_bug(lifetime.ident.span, "no def-id for fresh lifetime");
16571653
continue;
16581654
}
16591655
}
@@ -2515,9 +2511,10 @@ impl<'hir> GenericArgsCtor<'hir> {
25152511
let hir_id = lcx.next_id();
25162512

25172513
let Some(host_param_id) = lcx.host_param_id else {
2518-
lcx.tcx
2519-
.sess
2520-
.delay_span_bug(span, "no host param id for call in const yet no errors reported");
2514+
lcx.tcx.sess.span_delayed_bug(
2515+
span,
2516+
"no host param id for call in const yet no errors reported",
2517+
);
25212518
return;
25222519
};
25232520

compiler/rustc_ast_lowering/src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
139139

140140
// We should've returned in the for loop above.
141141

142-
self.diagnostic().span_bug(
142+
self.tcx.sess.diagnostic().span_bug(
143143
p.span,
144144
format!(
145145
"lower_qpath: no final extension segment in {}..{}",

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<'a> PostExpansionVisitor<'a> {
102102
}
103103
Err(abi::AbiDisabled::Unrecognized) => {
104104
if self.sess.opts.pretty.map_or(true, |ppm| ppm.needs_hir()) {
105-
self.sess.parse_sess.span_diagnostic.delay_span_bug(
105+
self.sess.diagnostic().span_delayed_bug(
106106
span,
107107
format!(
108108
"unrecognized ABI not caught in lowering: {}",
@@ -515,7 +515,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
515515
}
516516
};
517517
}
518-
gate_all!(c_str_literals, "`c\"..\"` literals are experimental");
519518
gate_all!(
520519
if_let_guard,
521520
"`if let` guards are experimental",
@@ -628,7 +627,7 @@ fn maybe_stage_features(sess: &Session, features: &Features, krate: &ast::Crate)
628627
if all_stable {
629628
err.sugg = Some(attr.span);
630629
}
631-
sess.parse_sess.span_diagnostic.emit_err(err);
630+
sess.diagnostic().emit_err(err);
632631
}
633632
}
634633
}

compiler/rustc_attr/src/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
945945
assert!(attr.has_name(sym::repr), "expected `#[repr(..)]`, found: {attr:?}");
946946
use ReprAttr::*;
947947
let mut acc = Vec::new();
948-
let diagnostic = &sess.parse_sess.span_diagnostic;
948+
let diagnostic = sess.diagnostic();
949949

950950
if let Some(items) = attr.meta_item_list() {
951951
for item in items {
@@ -1060,9 +1060,9 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
10601060
// Not a word we recognize. This will be caught and reported by
10611061
// the `check_mod_attrs` pass, but this pass doesn't always run
10621062
// (e.g. if we only pretty-print the source), so we have to gate
1063-
// the `delay_span_bug` call as follows:
1063+
// the `span_delayed_bug` call as follows:
10641064
if sess.opts.pretty.map_or(true, |pp| pp.needs_analysis()) {
1065-
diagnostic.delay_span_bug(item.span(), "unrecognized representation hint");
1065+
diagnostic.span_delayed_bug(item.span(), "unrecognized representation hint");
10661066
}
10671067
}
10681068
}

0 commit comments

Comments
 (0)