diff options
| author | Ralf Jung <post@ralfj.de> | 2020-09-26 12:58:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-26 12:58:24 +0200 |
| commit | 7c47b1e5f4920c5a15a9bc1c744f088646b031a3 (patch) | |
| tree | f6d9b9425b0aaf7e496473123cccfae8618af118 /compiler/rustc_codegen_llvm/src | |
| parent | 7ff5b44a58357e11d15dc0ce34972f93c1bc6e57 (diff) | |
| parent | 12ada5cf4bebabd7dc240a3a993eaebbdf2ed3d3 (diff) | |
| download | rust-7c47b1e5f4920c5a15a9bc1c744f088646b031a3.tar.gz rust-7c47b1e5f4920c5a15a9bc1c744f088646b031a3.zip | |
Rollup merge of #77161 - est31:swich_len_already_trusted, r=petrochenkov
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')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/lib.rs | 1 |
2 files changed, 1 insertions, 3 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) }; diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 456e9c7ce75..f14493e6043 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -12,7 +12,6 @@ #![feature(in_band_lifetimes)] #![feature(nll)] #![feature(or_patterns)] -#![feature(trusted_len)] #![recursion_limit = "256"] use back::write::{create_informational_target_machine, create_target_machine}; |
