diff options
| author | est31 <MTest31@outlook.com> | 2020-09-24 19:10:34 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2020-09-24 19:10:34 +0200 |
| commit | 12ada5cf4bebabd7dc240a3a993eaebbdf2ed3d3 (patch) | |
| tree | 020abefeac2912f6a80bd110f96d7a5bb045701e /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 893fadd11a52aa26fc19c67ee1b79f03d6a1bed3 (diff) | |
| download | rust-12ada5cf4bebabd7dc240a3a993eaebbdf2ed3d3.tar.gz rust-12ada5cf4bebabd7dc240a3a993eaebbdf2ed3d3.zip | |
Remove TrustedLen requirement from BuilderMethods::switch
The main use case of TrustedLen is allowing APIs to specialize on it, but no use of it uses that specialization. Instead, only the .len() function provided by ExactSizeIterator is used, which is already required to be accurate. Thus, the TrustedLen requirement on BuilderMethods::switch is redundant.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 23a3be1a2f2..27061acd5af 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -21,7 +21,6 @@ use rustc_target::abi::{self, Align, Size}; use rustc_target::spec::{HasTargetSpec, Target}; use std::borrow::Cow; use std::ffi::CStr; -use std::iter::TrustedLen; use std::ops::{Deref, Range}; use std::ptr; use tracing::debug; @@ -179,7 +178,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { &mut self, v: &'ll Value, else_llbb: &'ll BasicBlock, - cases: impl ExactSizeIterator<Item = (u128, &'ll BasicBlock)> + TrustedLen, + cases: impl ExactSizeIterator<Item = (u128, &'ll BasicBlock)>, ) { let switch = unsafe { llvm::LLVMBuildSwitch(self.llbuilder, v, else_llbb, cases.len() as c_uint) }; |
