Skip to content

Commit c26db43

Browse files
committed
Auto merge of rust-lang#134349 - jieyouxu:rollup-zqn0jox, r=jieyouxu
Rollup of 4 pull requests Successful merges: - rust-lang#134111 (Fix `--nocapture` for run-make tests) - rust-lang#134329 (Add m68k_target_feature) - rust-lang#134331 (bootstrap: make ./x test error-index work) - rust-lang#134339 (Pass `TyCtxt` to early diagostics decoration) r? `@ghost` `@rustbot` modify labels: rollup
2 parents d185062 + 56545ca commit c26db43

File tree

18 files changed

+184
-171
lines changed

18 files changed

+184
-171
lines changed

compiler/rustc_feature/src/unstable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ declare_features! (
332332
(unstable, hexagon_target_feature, "1.27.0", Some(44839)),
333333
(unstable, lahfsahf_target_feature, "1.78.0", Some(44839)),
334334
(unstable, loongarch_target_feature, "1.73.0", Some(44839)),
335+
(unstable, m68k_target_feature, "CURRENT_RUSTC_VERSION", Some(134328)),
335336
(unstable, mips_target_feature, "1.27.0", Some(44839)),
336337
(unstable, powerpc_target_feature, "1.27.0", Some(44839)),
337338
(unstable, prfchw_target_feature, "1.78.0", Some(44839)),

compiler/rustc_interface/src/passes.rs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ fn pre_expansion_lint<'a>(
7676
|| {
7777
rustc_lint::check_ast_node(
7878
sess,
79+
None,
7980
features,
8081
true,
8182
lint_store,
@@ -310,6 +311,7 @@ fn early_lint_checks(tcx: TyCtxt<'_>, (): ()) {
310311
let lint_store = unerased_lint_store(tcx.sess);
311312
rustc_lint::check_ast_node(
312313
sess,
314+
Some(tcx),
313315
tcx.features(),
314316
false,
315317
lint_store,

compiler/rustc_lint/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ lint_unexpected_cfg_add_build_rs_println = or consider adding `{$build_rs_printl
806806
lint_unexpected_cfg_add_cargo_feature = consider using a Cargo feature instead
807807
lint_unexpected_cfg_add_cargo_toml_lint_cfg = or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:{$cargo_toml_lint_cfg}
808808
lint_unexpected_cfg_add_cmdline_arg = to expect this configuration use `{$cmdline_arg}`
809-
lint_unexpected_cfg_cargo_update = the {$macro_kind} `{$macro_name}` may come from an old version of it's defining crate, try updating your dependencies with `cargo update`
809+
lint_unexpected_cfg_cargo_update = the {$macro_kind} `{$macro_name}` may come from an old version of the `{$crate_name}` crate, try updating your dependency with `cargo update -p {$crate_name}`
810810
811811
lint_unexpected_cfg_define_features = consider defining some features in `Cargo.toml`
812812
lint_unexpected_cfg_doc_cargo = see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

compiler/rustc_lint/src/context.rs

+1-35
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_middle::ty::layout::{LayoutError, LayoutOfHelpers, TyAndLayout};
2020
use rustc_middle::ty::print::{PrintError, PrintTraitRefExt as _, Printer, with_no_trimmed_paths};
2121
use rustc_middle::ty::{self, GenericArg, RegisteredTools, Ty, TyCtxt, TypingEnv, TypingMode};
2222
use rustc_session::lint::{
23-
BuiltinLintDiag, FutureIncompatibleInfo, Level, Lint, LintBuffer, LintExpectationId, LintId,
23+
FutureIncompatibleInfo, Level, Lint, LintBuffer, LintExpectationId, LintId,
2424
};
2525
use rustc_session::{LintStoreMarker, Session};
2626
use rustc_span::Span;
@@ -33,8 +33,6 @@ use self::TargetLint::*;
3333
use crate::levels::LintLevelsBuilder;
3434
use crate::passes::{EarlyLintPassObject, LateLintPassObject};
3535

36-
mod diagnostics;
37-
3836
type EarlyLintPassFactory = dyn Fn() -> EarlyLintPassObject + sync::DynSend + sync::DynSync;
3937
type LateLintPassFactory =
4038
dyn for<'tcx> Fn(TyCtxt<'tcx>) -> LateLintPassObject<'tcx> + sync::DynSend + sync::DynSync;
@@ -511,38 +509,6 @@ pub struct EarlyContext<'a> {
511509
pub buffered: LintBuffer,
512510
}
513511

514-
impl EarlyContext<'_> {
515-
/// Emit a lint at the appropriate level, with an associated span and an existing
516-
/// diagnostic.
517-
///
518-
/// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature
519-
#[rustc_lint_diagnostics]
520-
pub fn span_lint_with_diagnostics(
521-
&self,
522-
lint: &'static Lint,
523-
span: MultiSpan,
524-
diagnostic: BuiltinLintDiag,
525-
) {
526-
self.opt_span_lint_with_diagnostics(lint, Some(span), diagnostic);
527-
}
528-
529-
/// Emit a lint at the appropriate level, with an optional associated span and an existing
530-
/// diagnostic.
531-
///
532-
/// [`lint_level`]: rustc_middle::lint::lint_level#decorate-signature
533-
#[rustc_lint_diagnostics]
534-
pub fn opt_span_lint_with_diagnostics(
535-
&self,
536-
lint: &'static Lint,
537-
span: Option<MultiSpan>,
538-
diagnostic: BuiltinLintDiag,
539-
) {
540-
self.opt_span_lint(lint, span, |diag| {
541-
diagnostics::decorate_lint(self.sess(), diagnostic, diag);
542-
});
543-
}
544-
}
545-
546512
pub trait LintContext {
547513
fn sess(&self) -> &Session;
548514

0 commit comments

Comments
 (0)