Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 24c0b81

Browse files
committed
Auto merge of rust-lang#109043 - matthiaskrgr:rollup-genkz0e, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#108726 (tidy: enforce comment blocks to have an even number of backticks) - rust-lang#108797 (Allow binary files to go through the `FileLoader`) - rust-lang#108841 (Add suggestion to diagnostic when user has array but trait wants slice. (rebased)) - rust-lang#108984 (bootstrap: document tidy) - rust-lang#109013 (Give proper error message when tcx wasn't passed to decoder) - rust-lang#109017 (remove duplicated calls to sort_string) - rust-lang#109018 (Expand on the allocator comment in `rustc-main`) - rust-lang#109028 (Add eslint checks for rustdoc-js tester) - rust-lang#109034 (Commit some tests for the new solver + lazy norm) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 150cb38 + 3166b4a commit 24c0b81

File tree

39 files changed

+914
-87
lines changed

39 files changed

+914
-87
lines changed

compiler/rustc/src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
// The two crates we link to here, `std` and `rustc_driver`, are both dynamic
2525
// libraries. So we must reference jemalloc symbols one way or another, because
2626
// this file is the only object code in the rustc executable.
27+
//
28+
// NOTE: if you are reading this comment because you want to set a custom `global_allocator` for
29+
// benchmarking, consider using the benchmarks in the `rustc-perf` collector suite instead:
30+
// https://github.com/rust-lang/rustc-perf/blob/master/collector/README.md#profiling
31+
//
32+
// NOTE: if you are reading this comment because you want to replace jemalloc with another allocator
33+
// to compare their performance, see
34+
// https://github.com/rust-lang/rust/commit/b90cfc887c31c3e7a9e6d462e2464db1fe506175#diff-43914724af6e464c1da2171e4a9b6c7e607d5bc1203fa95c0ab85be4122605ef
35+
// for an example of how to do so.
2736

2837
#[unix_sigpipe = "sig_dfl"]
2938
fn main() {

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ impl<'a> MethodDef<'a> {
10521052
/// ::core::hash::Hash::hash(&{ self.y }, state)
10531053
/// }
10541054
/// }
1055+
/// ```
10551056
fn expand_struct_method_body<'b>(
10561057
&self,
10571058
cx: &mut ExtCtxt<'_>,

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ fn build_enum_variant_member_di_node<'ll, 'tcx>(
438438
/// DW_TAG_structure_type (type of variant 1)
439439
/// DW_TAG_structure_type (type of variant 2)
440440
/// DW_TAG_structure_type (type of variant 3)
441+
/// ```
441442
struct VariantMemberInfo<'a, 'll> {
442443
variant_index: VariantIdx,
443444
variant_name: Cow<'a, str>,

compiler/rustc_error_codes/src/error_codes/E0368.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Add for Foo {
4141
4242
fn main() {
4343
let mut x: Foo = Foo(5);
44-
x += Foo(7); // error, `+= cannot be applied to the type `Foo`
44+
x += Foo(7); // error, `+=` cannot be applied to the type `Foo`
4545
}
4646
```
4747

compiler/rustc_error_codes/src/error_codes/E0710.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ An unknown tool name was found in a scoped lint.
33
Erroneous code examples:
44

55
```compile_fail,E0710
6-
#[allow(clipp::filter_map)] // error!`
6+
#[allow(clipp::filter_map)] // error!
77
fn main() {
88
// business logic
99
}
1010
```
1111

1212
```compile_fail,E0710
13-
#[warn(clipp::filter_map)] // error!`
13+
#[warn(clipp::filter_map)] // error!
1414
fn main() {
1515
// business logic
1616
}

compiler/rustc_hir_typeck/src/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
398398
///
399399
/// Here:
400400
/// - E would be `fn(&u32) -> &u32`.
401-
/// - S would be `fn(&u32) ->
401+
/// - S would be `fn(&u32) -> ?T`
402402
/// - E' is `&'!0 u32 -> &'!0 u32`
403403
/// - S' is `&'?0 u32 -> ?T`
404404
///

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
104104
let (mention_influencer, influencer_point) =
105105
if sup_origin.span().overlaps(param.param_ty_span) {
106106
// Account for `async fn` like in `async-await/issues/issue-62097.rs`.
107-
// The desugaring of `async `fn`s causes `sup_origin` and `param` to point at the same
107+
// The desugaring of `async fn`s causes `sup_origin` and `param` to point at the same
108108
// place (but with different `ctxt`, hence `overlaps` instead of `==` above).
109109
//
110110
// This avoids the following:

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@ impl<T: ParameterizedOverTcx> LazyArray<T> {
311311
impl<'a, 'tcx> DecodeContext<'a, 'tcx> {
312312
#[inline]
313313
fn tcx(&self) -> TyCtxt<'tcx> {
314-
debug_assert!(self.tcx.is_some(), "missing TyCtxt in DecodeContext");
315-
self.tcx.unwrap()
314+
let Some(tcx) = self.tcx else {
315+
bug!("No TyCtxt found for decoding. \
316+
You need to explicitly pass `(crate_metadata_ref, tcx)` to `decode` instead of just `crate_metadata_ref`.");
317+
};
318+
tcx
316319
}
317320

318321
#[inline]
@@ -454,7 +457,12 @@ impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for ast::AttrId {
454457
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for SyntaxContext {
455458
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> SyntaxContext {
456459
let cdata = decoder.cdata();
457-
let sess = decoder.sess.unwrap();
460+
461+
let Some(sess) = decoder.sess else {
462+
bug!("Cannot decode SyntaxContext without Session.\
463+
You need to explicitly pass `(crate_metadata_ref, tcx)` to `decode` instead of just `crate_metadata_ref`.");
464+
};
465+
458466
let cname = cdata.root.name;
459467
rustc_span::hygiene::decode_syntax_context(decoder, &cdata.hygiene_context, |_, id| {
460468
debug!("SpecializedDecoder<SyntaxContext>: decoding {}", id);
@@ -471,7 +479,11 @@ impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for SyntaxContext {
471479
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for ExpnId {
472480
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> ExpnId {
473481
let local_cdata = decoder.cdata();
474-
let sess = decoder.sess.unwrap();
482+
483+
let Some(sess) = decoder.sess else {
484+
bug!("Cannot decode ExpnId without Session. \
485+
You need to explicitly pass `(crate_metadata_ref, tcx)` to `decode` instead of just `crate_metadata_ref`.");
486+
};
475487

476488
let cnum = CrateNum::decode(decoder);
477489
let index = u32::decode(decoder);
@@ -520,7 +532,8 @@ impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for Span {
520532
let hi = lo + len;
521533

522534
let Some(sess) = decoder.sess else {
523-
bug!("Cannot decode Span without Session.")
535+
bug!("Cannot decode Span without Session. \
536+
You need to explicitly pass `(crate_metadata_ref, tcx)` to `decode` instead of just `crate_metadata_ref`.")
524537
};
525538

526539
// Index of the file in the corresponding crate's list of encoded files.

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ fn dump_matched_mir_node<'tcx, F>(
123123
// see notes on #41697 above
124124
let def_path =
125125
ty::print::with_forced_impl_filename_line!(tcx.def_path_str(body.source.def_id()));
126+
// ignore-tidy-odd-backticks the literal below is fine
126127
write!(file, "// MIR for `{}", def_path)?;
127128
match body.source.promoted {
128129
None => write!(file, "`")?,

compiler/rustc_middle/src/ty/error.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,8 @@ impl<'tcx> TypeError<'tcx> {
151151
.into(),
152152
RegionsPlaceholderMismatch => "one type is more general than the other".into(),
153153
ArgumentSorts(values, _) | Sorts(values) => {
154-
let mut expected = values.expected.sort_string(tcx);
155-
let mut found = values.found.sort_string(tcx);
156-
if expected == found {
157-
expected = values.expected.sort_string(tcx);
158-
found = values.found.sort_string(tcx);
159-
}
154+
let expected = values.expected.sort_string(tcx);
155+
let found = values.found.sort_string(tcx);
160156
report_maybe_different(&expected, &found).into()
161157
}
162158
Traits(values) => {

0 commit comments

Comments
 (0)