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.
This commit is contained in:
@@ -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) };
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user