Skip to content

Commit cf3248a

Browse files
committed
Auto merge of #122097 - matthiaskrgr:rollup-musrvu6, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #113518 (bootstrap/libtest: print test name eagerly on failure even with `verbose-tests=false` / `--quiet`) - #117199 (Change the documented implicit value of `-C instrument-coverage` to `=yes`) - #121190 (avoid overlapping privacy suggestion for single nested imports) - #121382 (Rework `untranslatable_diagnostic` lint) - #121833 (Suggest correct path in include_bytes!) - #121959 (Removing absolute path in proc-macro) - #122038 (Fix linting paths with qself in `unused_qualifications`) - #122051 (cleanup: remove zero-offset GEP) r? `@ghost` `@rustbot` modify labels: rollup
2 parents bfe762e + 3c02620 commit cf3248a

File tree

66 files changed

+894
-244
lines changed

Some content is hidden

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

66 files changed

+894
-244
lines changed

compiler/rustc_abi/src/layout.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
use std::borrow::{Borrow, Cow};
2+
use std::cmp;
13
use std::fmt::{self, Write};
4+
use std::iter;
5+
use std::ops::Bound;
26
use std::ops::Deref;
3-
use std::{borrow::Borrow, cmp, iter, ops::Bound};
47

58
use rustc_index::Idx;
69
use tracing::debug;
@@ -32,7 +35,7 @@ where
3235
pub trait LayoutCalculator {
3336
type TargetDataLayoutRef: Borrow<TargetDataLayout>;
3437

35-
fn delayed_bug(&self, txt: String);
38+
fn delayed_bug(&self, txt: impl Into<Cow<'static, str>>);
3639
fn current_data_layout(&self) -> Self::TargetDataLayoutRef;
3740

3841
fn scalar_pair<FieldIdx: Idx, VariantIdx: Idx>(

compiler/rustc_ast_lowering/src/asm.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use std::collections::hash_map::Entry;
2222
use std::fmt::Write;
2323

2424
impl<'a, 'hir> LoweringContext<'a, 'hir> {
25+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
2526
pub(crate) fn lower_inline_asm(
2627
&mut self,
2728
sp: Span,

compiler/rustc_ast_lowering/src/expr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
15131513
}
15141514
}
15151515

1516+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
15161517
fn lower_expr_yield(&mut self, span: Span, opt_expr: Option<&Expr>) -> hir::ExprKind<'hir> {
15171518
let yielded =
15181519
opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| self.expr_unit(span));

compiler/rustc_ast_lowering/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22722272
self.expr_block(block)
22732273
}
22742274

2275+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
22752276
fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen {
22762277
match c.value.kind {
22772278
ExprKind::Underscore => {

compiler/rustc_ast_passes/src/feature_gate.rs

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::errors;
1717
macro_rules! gate {
1818
($visitor:expr, $feature:ident, $span:expr, $explain:expr) => {{
1919
if !$visitor.features.$feature && !$span.allows_unstable(sym::$feature) {
20+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
2021
feature_err(&$visitor.sess, sym::$feature, $span, $explain).emit();
2122
}
2223
}};
@@ -34,6 +35,7 @@ macro_rules! gate {
3435
macro_rules! gate_alt {
3536
($visitor:expr, $has_feature:expr, $name:expr, $span:expr, $explain:expr) => {{
3637
if !$has_feature && !$span.allows_unstable($name) {
38+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
3739
feature_err(&$visitor.sess, $name, $span, $explain).emit();
3840
}
3941
}};
@@ -73,6 +75,7 @@ struct PostExpansionVisitor<'a> {
7375
}
7476

7577
impl<'a> PostExpansionVisitor<'a> {
78+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
7679
fn check_abi(&self, abi: ast::StrLit, constness: ast::Const) {
7780
let ast::StrLit { symbol_unescaped, span, .. } = abi;
7881

@@ -579,6 +582,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
579582
if let Ok(snippet) = sm.span_to_snippet(span)
580583
&& snippet == "!"
581584
{
585+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
582586
feature_err(sess, sym::never_patterns, span, "`!` patterns are experimental")
583587
.emit();
584588
} else {

compiler/rustc_attr/src/builtin.rs

+3
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ pub struct Condition {
516516
}
517517

518518
/// Tests if a cfg-pattern matches the cfg set
519+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
519520
pub fn cfg_matches(
520521
cfg: &ast::MetaItem,
521522
sess: &Session,
@@ -566,6 +567,7 @@ fn try_gate_cfg(name: Symbol, span: Span, sess: &Session, features: Option<&Feat
566567
}
567568
}
568569

570+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
569571
fn gate_cfg(gated_cfg: &GatedCfg, cfg_span: Span, sess: &Session, features: &Features) {
570572
let (cfg, feature, has_feature) = gated_cfg;
571573
if !has_feature(features) && !cfg_span.allows_unstable(*feature) {
@@ -592,6 +594,7 @@ fn parse_version(s: Symbol) -> Option<RustcVersion> {
592594

593595
/// Evaluate a cfg-like condition (with `any` and `all`), using `eval` to
594596
/// evaluate individual items.
597+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
595598
pub fn eval_condition(
596599
cfg: &ast::MetaItem,
597600
sess: &Session,

compiler/rustc_borrowck/src/diagnostics/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
7676
/// LL | for (key, value) in dict {
7777
/// | ^^^^
7878
/// ```
79+
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
7980
pub(super) fn add_moved_or_invoked_closure_note(
8081
&self,
8182
location: Location,
@@ -585,6 +586,7 @@ impl UseSpans<'_> {
585586
}
586587

587588
/// Add a span label to the arguments of the closure, if it exists.
589+
#[allow(rustc::diagnostic_outside_of_impl)]
588590
pub(super) fn args_subdiag(
589591
self,
590592
dcx: &rustc_errors::DiagCtxt,
@@ -598,6 +600,7 @@ impl UseSpans<'_> {
598600

599601
/// Add a span label to the use of the captured variable, if it exists.
600602
/// only adds label to the `path_span`
603+
#[allow(rustc::diagnostic_outside_of_impl)]
601604
pub(super) fn var_path_only_subdiag(
602605
self,
603606
dcx: &rustc_errors::DiagCtxt,
@@ -635,6 +638,7 @@ impl UseSpans<'_> {
635638
}
636639

637640
/// Add a subdiagnostic to the use of the captured variable, if it exists.
641+
#[allow(rustc::diagnostic_outside_of_impl)]
638642
pub(super) fn var_subdiag(
639643
self,
640644
dcx: &rustc_errors::DiagCtxt,
@@ -1008,6 +1012,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
10081012
self.borrow_spans(span, borrow.reserve_location)
10091013
}
10101014

1015+
#[allow(rustc::diagnostic_outside_of_impl)]
1016+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
10111017
fn explain_captures(
10121018
&mut self,
10131019
err: &mut Diag<'_>,

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
201201
// For generic associated types (GATs) which implied 'static requirement
202202
// from higher-ranked trait bounds (HRTB). Try to locate span of the trait
203203
// and the span which bounded to the trait for adding 'static lifetime suggestion
204+
#[allow(rustc::diagnostic_outside_of_impl)]
205+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
204206
fn suggest_static_lifetime_for_gat_from_hrtb(
205207
&self,
206208
diag: &mut Diag<'_>,
@@ -254,9 +256,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
254256

255257
hrtb_bounds.iter().for_each(|bound| {
256258
let Trait(PolyTraitRef { trait_ref, span: trait_span, .. }, _) = bound else { return; };
257-
// FIXME: make this translatable
258-
#[allow(rustc::diagnostic_outside_of_impl)]
259-
#[allow(rustc::untranslatable_diagnostic)]
260259
diag.span_note(
261260
*trait_span,
262261
"due to current limitations in the borrow checker, this implies a `'static` lifetime"
@@ -580,6 +579,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
580579
/// executing...
581580
/// = note: ...therefore, returned references to captured variables will escape the closure
582581
/// ```
582+
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
583583
fn report_fnmut_error(
584584
&self,
585585
errci: &ErrorConstraintInfo<'tcx>,
@@ -761,6 +761,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
761761
/// | ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it
762762
/// | is returning data with lifetime `'b`
763763
/// ```
764+
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
764765
fn report_general_error(&self, errci: &ErrorConstraintInfo<'tcx>) -> Diag<'tcx> {
765766
let ErrorConstraintInfo {
766767
fr,
@@ -822,6 +823,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
822823
/// LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + 'a {
823824
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
824825
/// ```
826+
#[allow(rustc::diagnostic_outside_of_impl)]
827+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
825828
fn add_static_impl_trait_suggestion(
826829
&self,
827830
diag: &mut Diag<'_>,
@@ -972,6 +975,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
972975
self.suggest_constrain_dyn_trait_in_impl(diag, &visitor.0, ident, self_ty);
973976
}
974977

978+
#[allow(rustc::diagnostic_outside_of_impl)]
979+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
975980
#[instrument(skip(self, err), level = "debug")]
976981
fn suggest_constrain_dyn_trait_in_impl(
977982
&self,
@@ -1034,6 +1039,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
10341039
suggest_adding_lifetime_params(self.infcx.tcx, sub, ty_sup, ty_sub, diag);
10351040
}
10361041

1042+
#[allow(rustc::diagnostic_outside_of_impl)]
1043+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
10371044
fn suggest_move_on_borrowing_closure(&self, diag: &mut Diag<'_>) {
10381045
let map = self.infcx.tcx.hir();
10391046
let body_id = map.body_owned_by(self.mir_def_id());

0 commit comments

Comments
 (0)