Skip to content

Commit 4a2327f

Browse files
authoredMar 6, 2024
Unrolled build for rust-lang#121382
Rollup merge of rust-lang#121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco Rework `untranslatable_diagnostic` lint Currently it only checks calls to functions marked with `#[rustc_lint_diagnostics]`. This PR changes it to check calls to any function with an `impl Into<{D,Subd}iagnosticMessage>` parameter. This greatly improves its coverage and doesn't rely on people remembering to add `#[rustc_lint_diagnostics]`. It also lets us add `#[rustc_lint_diagnostics]` to a number of functions that don't have an `impl Into<{D,Subd}iagnosticMessage>`, such as `Diag::span`. r? ``@davidtwco``
2 parents bfe762e + 3591e77 commit 4a2327f

File tree

42 files changed

+302
-86
lines changed

Some content is hidden

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

42 files changed

+302
-86
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,

0 commit comments

Comments
 (0)