Remove unneeded bounds from CodegenMethods and BuilderMethods.

Some of these are pulled in indirectly, e.g. `MiscMethods` via
`TypeMethods`.
This commit is contained in:
Nicholas Nethercote 2024-09-16 20:18:53 +10:00
parent 410a2de0c0
commit 108f8c8164
2 changed files with 2 additions and 12 deletions

View File

@ -2,13 +2,12 @@ use std::assert_matches::assert_matches;
use std::ops::Deref; use std::ops::Deref;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; 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_middle::ty::{Instance, Ty};
use rustc_session::config::OptLevel; use rustc_session::config::OptLevel;
use rustc_span::Span; use rustc_span::Span;
use rustc_target::abi::call::FnAbi; use rustc_target::abi::call::FnAbi;
use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange}; use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange};
use rustc_target::spec::HasTargetSpec;
use super::abi::AbiBuilderMethods; use super::abi::AbiBuilderMethods;
use super::asm::AsmBuilderMethods; use super::asm::AsmBuilderMethods;
@ -45,8 +44,6 @@ pub trait BuilderMethods<'a, 'tcx>:
+ IntrinsicCallBuilderMethods<'tcx> + IntrinsicCallBuilderMethods<'tcx>
+ AsmBuilderMethods<'tcx> + AsmBuilderMethods<'tcx>
+ StaticBuilderMethods + StaticBuilderMethods
+ HasParamEnv<'tcx>
+ HasTargetSpec
{ {
type CodegenCx: CodegenMethods<'tcx> type CodegenCx: CodegenMethods<'tcx>
+ BackendTypes< + BackendTypes<

View File

@ -27,9 +27,6 @@ mod write;
use std::fmt; use std::fmt;
use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt};
use rustc_target::spec::HasTargetSpec;
pub use self::abi::AbiBuilderMethods; pub use self::abi::AbiBuilderMethods;
pub use self::asm::{AsmBuilderMethods, AsmMethods, GlobalAsmOperandRef, InlineAsmOperandRef}; pub use self::asm::{AsmBuilderMethods, AsmMethods, GlobalAsmOperandRef, InlineAsmOperandRef};
pub use self::backend::{BackendTypes, CodegenBackend, ExtraBackendMethods}; 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 CodegenObject = Copy + PartialEq + fmt::Debug;
pub trait CodegenMethods<'tcx> = TypeMethods<'tcx> pub trait CodegenMethods<'tcx> = TypeMethods<'tcx>
+ MiscMethods<'tcx>
+ ConstMethods<'tcx> + ConstMethods<'tcx>
+ StaticMethods + StaticMethods
+ DebugInfoMethods<'tcx> + DebugInfoMethods<'tcx>
+ AsmMethods<'tcx> + AsmMethods<'tcx>
+ PreDefineMethods<'tcx> + PreDefineMethods<'tcx>;
+ HasParamEnv<'tcx>
+ HasTyCtxt<'tcx>
+ HasTargetSpec;