Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #122097

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a9a9798
Removing absolute path in proc-macro
sundeep-kokkonda Mar 4, 2024
678e217
bootstrap: print test name on failure even with `verbose-tests=false`
jyn514 Jul 10, 2023
8bfe9db
libtest: Print the names of failed tests eagerly
jyn514 Nov 5, 2023
d602394
Change message type in bug functions.
nnethercote Feb 21, 2024
6120de9
Fix linting paths with qself in `unused_qualifications`
Alexendoo Mar 5, 2024
efe5a40
remove all-zero GEP
erikdesjardins Feb 25, 2024
b2c6b12
Helper function for resolve_path
kornelski Mar 1, 2024
da8cbe4
Suggest correct path in include_bytes!
kornelski Mar 1, 2024
b7d58ee
Rewrite the `untranslatable_diagnostic` lint.
nnethercote Feb 20, 2024
3591e77
Add missing `#[rustc_lint_diagnostics]` attributes.
nnethercote Feb 28, 2024
9f287dd
Change the documented implicit value of `-C instrument-coverage` to `…
Zalathar Oct 25, 2023
7303014
avoid overlapping privacy suggestion for single nested imports
bvanjoi Feb 16, 2024
7a0202b
Rollup merge of #113518 - jyn514:streaming-failures, r=cuviper
matthiaskrgr Mar 6, 2024
5c3c891
Rollup merge of #117199 - Zalathar:instrument-coverage-on, r=oli-obk,…
matthiaskrgr Mar 6, 2024
c50ce22
Rollup merge of #121190 - bvanjoi:fix-114884, r=petrochenkov
matthiaskrgr Mar 6, 2024
966acdf
Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnosti…
matthiaskrgr Mar 6, 2024
e3c356a
Rollup merge of #121833 - kornelski:parent_include, r=estebank
matthiaskrgr Mar 6, 2024
b1c307f
Rollup merge of #121959 - sundeep-kokkonda:patch-2, r=davidtwco
matthiaskrgr Mar 6, 2024
f868abd
Rollup merge of #122038 - Alexendoo:unused-qualifications, r=petroche…
matthiaskrgr Mar 6, 2024
3c02620
Rollup merge of #122051 - erikdesjardins:cleanup, r=nikic
matthiaskrgr Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::borrow::{Borrow, Cow};
use std::cmp;
use std::fmt::{self, Write};
use std::iter;
use std::ops::Bound;
use std::ops::Deref;
use std::{borrow::Borrow, cmp, iter, ops::Bound};

use rustc_index::Idx;
use tracing::debug;
Expand Down Expand Up @@ -32,7 +35,7 @@ where
pub trait LayoutCalculator {
type TargetDataLayoutRef: Borrow<TargetDataLayout>;

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

fn scalar_pair<FieldIdx: Idx, VariantIdx: Idx>(
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::collections::hash_map::Entry;
use std::fmt::Write;

impl<'a, 'hir> LoweringContext<'a, 'hir> {
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
pub(crate) fn lower_inline_asm(
&mut self,
sp: Span,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
}

#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn lower_expr_yield(&mut self, span: Span, opt_expr: Option<&Expr>) -> hir::ExprKind<'hir> {
let yielded =
opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| self.expr_unit(span));
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
self.expr_block(block)
}

#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen {
match c.value.kind {
ExprKind::Underscore => {
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::errors;
macro_rules! gate {
($visitor:expr, $feature:ident, $span:expr, $explain:expr) => {{
if !$visitor.features.$feature && !$span.allows_unstable(sym::$feature) {
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
feature_err(&$visitor.sess, sym::$feature, $span, $explain).emit();
}
}};
Expand All @@ -34,6 +35,7 @@ macro_rules! gate {
macro_rules! gate_alt {
($visitor:expr, $has_feature:expr, $name:expr, $span:expr, $explain:expr) => {{
if !$has_feature && !$span.allows_unstable($name) {
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
feature_err(&$visitor.sess, $name, $span, $explain).emit();
}
}};
Expand Down Expand Up @@ -73,6 +75,7 @@ struct PostExpansionVisitor<'a> {
}

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

Expand Down Expand Up @@ -579,6 +582,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
if let Ok(snippet) = sm.span_to_snippet(span)
&& snippet == "!"
{
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
feature_err(sess, sym::never_patterns, span, "`!` patterns are experimental")
.emit();
} else {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ pub struct Condition {
}

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

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

/// Evaluate a cfg-like condition (with `any` and `all`), using `eval` to
/// evaluate individual items.
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
pub fn eval_condition(
cfg: &ast::MetaItem,
sess: &Session,
Expand Down
6 changes: 6 additions & 0 deletions compiler/rustc_borrowck/src/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
/// LL | for (key, value) in dict {
/// | ^^^^
/// ```
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
pub(super) fn add_moved_or_invoked_closure_note(
&self,
location: Location,
Expand Down Expand Up @@ -585,6 +586,7 @@ impl UseSpans<'_> {
}

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

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

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

#[allow(rustc::diagnostic_outside_of_impl)]
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn explain_captures(
&mut self,
err: &mut Diag<'_>,
Expand Down
13 changes: 10 additions & 3 deletions compiler/rustc_borrowck/src/diagnostics/region_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
// For generic associated types (GATs) which implied 'static requirement
// from higher-ranked trait bounds (HRTB). Try to locate span of the trait
// and the span which bounded to the trait for adding 'static lifetime suggestion
#[allow(rustc::diagnostic_outside_of_impl)]
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn suggest_static_lifetime_for_gat_from_hrtb(
&self,
diag: &mut Diag<'_>,
Expand Down Expand Up @@ -254,9 +256,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {

hrtb_bounds.iter().for_each(|bound| {
let Trait(PolyTraitRef { trait_ref, span: trait_span, .. }, _) = bound else { return; };
// FIXME: make this translatable
#[allow(rustc::diagnostic_outside_of_impl)]
#[allow(rustc::untranslatable_diagnostic)]
diag.span_note(
*trait_span,
"due to current limitations in the borrow checker, this implies a `'static` lifetime"
Expand Down Expand Up @@ -580,6 +579,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
/// executing...
/// = note: ...therefore, returned references to captured variables will escape the closure
/// ```
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
fn report_fnmut_error(
&self,
errci: &ErrorConstraintInfo<'tcx>,
Expand Down Expand Up @@ -761,6 +761,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
/// | ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it
/// | is returning data with lifetime `'b`
/// ```
#[allow(rustc::diagnostic_outside_of_impl)] // FIXME
fn report_general_error(&self, errci: &ErrorConstraintInfo<'tcx>) -> Diag<'tcx> {
let ErrorConstraintInfo {
fr,
Expand Down Expand Up @@ -822,6 +823,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
/// LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + 'a {
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/// ```
#[allow(rustc::diagnostic_outside_of_impl)]
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn add_static_impl_trait_suggestion(
&self,
diag: &mut Diag<'_>,
Expand Down Expand Up @@ -972,6 +975,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
self.suggest_constrain_dyn_trait_in_impl(diag, &visitor.0, ident, self_ty);
}

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

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