Skip to content

Commit 34a5ea9

Browse files
committed
Auto merge of rust-lang#136878 - matthiaskrgr:rollup-opilhjv, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#135285 (it-self → itself, build-system → build system, type-alias → type alias) - rust-lang#135677 (Small `rustc_resolve` cleanups) - rust-lang#136239 (show supported register classes in error message) - rust-lang#136246 (include note on variance and example) - rust-lang#136354 (Update docs for impl keyword) - rust-lang#136786 (Remove the deduplicate_blocks pass) - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen) - rust-lang#136847 (Simplify intra-crate qualifiers.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 92bedea + 89ee41c commit 34a5ea9

File tree

46 files changed

+225
-556
lines changed

Some content is hidden

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

46 files changed

+225
-556
lines changed

compiler/rustc_ast_lowering/messages.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ ast_lowering_invalid_register =
112112
invalid register `{$reg}`: {$error}
113113
114114
ast_lowering_invalid_register_class =
115-
invalid register class `{$reg_class}`: {$error}
115+
invalid register class `{$reg_class}`: unknown register class
116+
.note = the following register classes are supported on this target: {$supported_register_classes}
116117
117118
ast_lowering_match_arm_with_no_body =
118119
`match` arm with no body

compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
152152
InlineAsmRegOrRegClass::RegClass(reg_class) => {
153153
asm::InlineAsmRegOrRegClass::RegClass(if let Some(asm_arch) = asm_arch {
154154
asm::InlineAsmRegClass::parse(asm_arch, reg_class).unwrap_or_else(
155-
|error| {
155+
|supported_register_classes| {
156+
let mut register_classes =
157+
format!("`{}`", supported_register_classes[0]);
158+
for m in &supported_register_classes[1..] {
159+
let _ = write!(register_classes, ", `{m}`");
160+
}
156161
self.dcx().emit_err(InvalidRegisterClass {
157162
op_span: *op_sp,
158163
reg_class,
159-
error,
164+
supported_register_classes: register_classes,
160165
});
161166
asm::InlineAsmRegClass::Err
162167
},

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ pub(crate) struct InvalidRegister<'a> {
197197
}
198198

199199
#[derive(Diagnostic)]
200+
#[note]
200201
#[diag(ast_lowering_invalid_register_class)]
201-
pub(crate) struct InvalidRegisterClass<'a> {
202+
pub(crate) struct InvalidRegisterClass {
202203
#[primary_span]
203204
pub op_span: Span,
204205
pub reg_class: Symbol,
205-
pub error: &'a str,
206+
pub supported_register_classes: String,
206207
}
207208

208209
#[derive(Diagnostic)]

compiler/rustc_codegen_gcc/src/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
400400
conv: Conv::C,
401401
can_unwind: false,
402402
};
403-
fn_abi.adjust_for_foreign_abi(self.cx, ExternAbi::C { unwind: false }).unwrap();
403+
fn_abi.adjust_for_foreign_abi(self.cx, ExternAbi::C { unwind: false });
404404

405405
let ret_indirect = matches!(fn_abi.ret.mode, PassMode::Indirect { .. });
406406

compiler/rustc_const_eval/src/errors.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustc_middle::mir::interpret::{
1616
};
1717
use rustc_middle::ty::{self, Mutability, Ty};
1818
use rustc_span::{Span, Symbol};
19-
use rustc_target::callconv::AdjustForForeignAbiError;
2019

2120
use crate::interpret::InternKind;
2221

@@ -936,9 +935,6 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> {
936935
InvalidProgramInfo::TooGeneric => const_eval_too_generic,
937936
InvalidProgramInfo::AlreadyReported(_) => const_eval_already_reported,
938937
InvalidProgramInfo::Layout(e) => e.diagnostic_message(),
939-
InvalidProgramInfo::FnAbiAdjustForForeignAbi(_) => {
940-
rustc_middle::error::middle_adjust_for_foreign_abi_error
941-
}
942938
}
943939
}
944940
fn add_args<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
@@ -953,12 +949,6 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> {
953949
}
954950
dummy_diag.cancel();
955951
}
956-
InvalidProgramInfo::FnAbiAdjustForForeignAbi(
957-
AdjustForForeignAbiError::Unsupported { arch, abi },
958-
) => {
959-
diag.arg("arch", arch);
960-
diag.arg("abi", abi.name());
961-
}
962952
}
963953
}
964954
}

compiler/rustc_const_eval/src/interpret/eval_context.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ impl<'tcx, M: Machine<'tcx>> FnAbiOfHelpers<'tcx> for InterpCx<'tcx, M> {
106106
) -> InterpErrorKind<'tcx> {
107107
match err {
108108
FnAbiError::Layout(err) => err_inval!(Layout(err)),
109-
FnAbiError::AdjustForForeignAbi(err) => {
110-
err_inval!(FnAbiAdjustForForeignAbi(err))
111-
}
112109
}
113110
}
114111
}

compiler/rustc_errors/src/diagnostic_impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ impl<I: rustc_type_ir::Interner> IntoDiagArg for rustc_type_ir::ExistentialTrait
108108
}
109109

110110
impl<I: rustc_type_ir::Interner> IntoDiagArg for rustc_type_ir::UnevaluatedConst<I> {
111-
fn into_diag_arg(self) -> rustc_errors::DiagArgValue {
111+
fn into_diag_arg(self) -> DiagArgValue {
112112
format!("{self:?}").into_diag_arg()
113113
}
114114
}
115115

116116
impl<I: rustc_type_ir::Interner> IntoDiagArg for rustc_type_ir::FnSig<I> {
117-
fn into_diag_arg(self) -> rustc_errors::DiagArgValue {
117+
fn into_diag_arg(self) -> DiagArgValue {
118118
format!("{self:?}").into_diag_arg()
119119
}
120120
}

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ use rustc_hir::definitions::{DefKey, DefPath, DefPathHash};
1010
use rustc_hir::intravisit::Visitor;
1111
use rustc_hir::*;
1212
use rustc_hir_pretty as pprust_hir;
13-
use rustc_middle::hir::nested_filter;
1413
use rustc_span::def_id::StableCrateId;
1514
use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol, kw, sym, with_metavar_spans};
1615

17-
use crate::hir::ModuleItems;
16+
use crate::hir::{ModuleItems, nested_filter};
1817
use crate::middle::debugger_visualizer::DebuggerVisualizerFile;
1918
use crate::query::LocalCrate;
2019
use crate::ty::TyCtxt;

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use rustc_feature::GateIssue;
1313
use rustc_hir::def_id::{DefId, LocalDefId, LocalDefIdMap};
1414
use rustc_hir::{self as hir, HirId};
1515
use rustc_macros::{Decodable, Encodable, HashStable, Subdiagnostic};
16-
use rustc_middle::ty::print::with_no_trimmed_paths;
1716
use rustc_session::Session;
1817
use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE};
1918
use rustc_session::lint::{BuiltinLintDiag, DeprecatedSinceKind, Level, Lint, LintBuffer};
@@ -23,6 +22,7 @@ use tracing::debug;
2322

2423
pub use self::StabilityLevel::*;
2524
use crate::ty::TyCtxt;
25+
use crate::ty::print::with_no_trimmed_paths;
2626

2727
#[derive(PartialEq, Clone, Copy, Debug)]
2828
pub enum StabilityLevel {

compiler/rustc_middle/src/mir/generic_graph.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use gsgdt::{Edge, Graph, Node, NodeStyle};
2-
use rustc_middle::mir::*;
2+
3+
use crate::mir::*;
34

45
/// Convert an MIR function into a gsgdt Graph
56
pub(crate) fn mir_fn_to_generic_graph<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'_>) -> Graph {

0 commit comments

Comments
 (0)