about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-09-16 20:18:53 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-09-17 10:24:43 +1000
commit108f8c8164d2f2f8b7d67f6b9b124cd7e81f5c82 (patch)
treeb3191a08682b8c216adacef22ead4fa8e7bb1a26
parent410a2de0c0f1dbd1d0ba26dca3dbb3b5cafee610 (diff)
downloadrust-108f8c8164d2f2f8b7d67f6b9b124cd7e81f5c82.tar.gz
rust-108f8c8164d2f2f8b7d67f6b9b124cd7e81f5c82.zip
Remove unneeded bounds from `CodegenMethods` and `BuilderMethods`.
Some of these are pulled in indirectly, e.g. `MiscMethods` via
`TypeMethods`.
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/builder.rs5
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/mod.rs9
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>;