Skip to content

Commit 4981994

Browse files
authored
Rollup merge of #137263 - compiler-errors:inherentless, r=lcnr
Register `USAGE_OF_TYPE_IR_INHERENT`, remove inherent usages I implemented a lint to discourage the usage of `rustc_type_ir::inherent` but never actually enabled it. People started using `rustc_type_ir::inherent` methods through globs, lol. r? fmease or reassign as you please
2 parents 80e861c + 047e77c commit 4981994

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

compiler/rustc_lint/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ fn register_internals(store: &mut LintStore) {
641641
LintId::of(LINT_PASS_IMPL_WITHOUT_MACRO),
642642
LintId::of(USAGE_OF_QUALIFIED_TY),
643643
LintId::of(NON_GLOB_IMPORT_OF_TYPE_IR_INHERENT),
644+
LintId::of(USAGE_OF_TYPE_IR_INHERENT),
644645
LintId::of(BAD_OPT_ACCESS),
645646
LintId::of(SPAN_USE_EQ_CTXT),
646647
],

compiler/rustc_monomorphize/src/mono_checks/abi_check.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! This module ensures that if a function's ABI requires a particular target feature,
22
//! that target feature is enabled both on the callee and all callers.
3-
use rustc_abi::{BackendRepr, RegKind};
3+
use rustc_abi::{BackendRepr, ExternAbi, RegKind};
44
use rustc_hir::CRATE_HIR_ID;
55
use rustc_middle::mir::{self, traversal};
6-
use rustc_middle::ty::inherent::*;
76
use rustc_middle::ty::{self, Instance, InstanceKind, Ty, TyCtxt};
87
use rustc_session::lint::builtin::ABI_UNSUPPORTED_VECTOR_TYPES;
98
use rustc_span::def_id::DefId;
@@ -97,7 +96,7 @@ fn check_call_site_abi<'tcx>(
9796
span: Span,
9897
caller: InstanceKind<'tcx>,
9998
) {
100-
if callee.fn_sig(tcx).abi().is_rust() {
99+
if callee.fn_sig(tcx).abi() == ExternAbi::Rust {
101100
// "Rust" ABI never passes arguments in vector registers.
102101
return;
103102
}

compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use rustc_middle::ty::{
1818
TypeFoldable, TypeFolder, TypeSuperFoldable, TypeckResults,
1919
};
2020
use rustc_span::{BytePos, DUMMY_SP, FileName, Ident, Span, sym};
21-
use rustc_type_ir::inherent::*;
2221
use rustc_type_ir::visit::TypeVisitableExt;
2322
use tracing::{debug, instrument, warn};
2423

@@ -217,7 +216,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for ClosureEraser<'a, 'tcx> {
217216
// `_` because then we'd end up with `Vec<_, _>`, instead of
218217
// `Vec<_>`.
219218
arg
220-
} else if let GenericArgKind::Type(_) = arg.kind() {
219+
} else if let GenericArgKind::Type(_) = arg.unpack() {
221220
// We don't replace lifetime or const params, only type params.
222221
self.new_infer().into()
223222
} else {

0 commit comments

Comments
 (0)