From 108f8c8164d2f2f8b7d67f6b9b124cd7e81f5c82 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 16 Sep 2024 20:18:53 +1000 Subject: Remove unneeded bounds from `CodegenMethods` and `BuilderMethods`. Some of these are pulled in indirectly, e.g. `MiscMethods` via `TypeMethods`. --- compiler/rustc_codegen_ssa/src/traits/builder.rs | 5 +---- compiler/rustc_codegen_ssa/src/traits/mod.rs | 9 +-------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs index 352a6ede82f..c88bd7c82bc 100644 --- a/compiler/rustc_codegen_ssa/src/traits/builder.rs +++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs @@ -2,13 +2,12 @@ use std::assert_matches::assert_matches; use std::ops::Deref; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; -use rustc_middle::ty::layout::{FnAbiOf, HasParamEnv, LayoutOf, TyAndLayout}; +use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout}; use rustc_middle::ty::{Instance, Ty}; use rustc_session::config::OptLevel; use rustc_span::Span; use rustc_target::abi::call::FnAbi; use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange}; -use rustc_target::spec::HasTargetSpec; use super::abi::AbiBuilderMethods; use super::asm::AsmBuilderMethods; @@ -45,8 +44,6 @@ pub trait BuilderMethods<'a, 'tcx>: + IntrinsicCallBuilderMethods<'tcx> + AsmBuilderMethods<'tcx> + StaticBuilderMethods - + HasParamEnv<'tcx> - + HasTargetSpec { type CodegenCx: CodegenMethods<'tcx> + BackendTypes< diff --git a/compiler/rustc_codegen_ssa/src/traits/mod.rs b/compiler/rustc_codegen_ssa/src/traits/mod.rs index a81eb38ff05..f662a766bb8 100644 --- a/compiler/rustc_codegen_ssa/src/traits/mod.rs +++ b/compiler/rustc_codegen_ssa/src/traits/mod.rs @@ -27,9 +27,6 @@ mod write; use std::fmt; -use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt}; -use rustc_target::spec::HasTargetSpec; - pub use self::abi::AbiBuilderMethods; pub use self::asm::{AsmBuilderMethods, AsmMethods, GlobalAsmOperandRef, InlineAsmOperandRef}; pub use self::backend::{BackendTypes, CodegenBackend, ExtraBackendMethods}; @@ -50,12 +47,8 @@ pub use self::write::{ModuleBufferMethods, ThinBufferMethods, WriteBackendMethod pub trait CodegenObject = Copy + PartialEq + fmt::Debug; pub trait CodegenMethods<'tcx> = TypeMethods<'tcx> - + MiscMethods<'tcx> + ConstMethods<'tcx> + StaticMethods + DebugInfoMethods<'tcx> + AsmMethods<'tcx> - + PreDefineMethods<'tcx> - + HasParamEnv<'tcx> - + HasTyCtxt<'tcx> - + HasTargetSpec; + + PreDefineMethods<'tcx>; -- cgit 1.4.1-3-g733a5