@@ -24,7 +24,6 @@ use rustc_span::{Span, DUMMY_SP};
2424use syntax:: ast:: LitKind ;
2525
2626use rustc_index:: vec:: { Idx , IndexVec } ;
27- use rustc_target:: spec:: abi:: Abi ;
2827
2928use std:: cell:: Cell ;
3029use std:: { cmp, iter, mem, usize} ;
@@ -106,11 +105,10 @@ pub enum Candidate {
106105 /// Promotion of the `x` in `[x; 32]`.
107106 Repeat ( Location ) ,
108107
109- /// Currently applied to function calls where the callee has the unstable
110- /// `#[rustc_args_required_const]` attribute as well as the SIMD shuffle
111- /// intrinsic. The intrinsic requires the arguments are indeed constant and
112- /// the attribute currently provides the semantic requirement that arguments
113- /// must be constant.
108+ /// Function calls where the callee has the unstable
109+ /// `#[rustc_args_required_const]` attribute. The attribute requires that
110+ /// the arguments be constant, usually because they are encoded as an
111+ /// immediate operand in a platform intrinsic.
114112 Argument { bb : BasicBlock , index : usize } ,
115113}
116114
@@ -218,17 +216,6 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
218216
219217 if let TerminatorKind :: Call { ref func, .. } = * kind {
220218 if let ty:: FnDef ( def_id, _) = func. ty ( self . body , self . tcx ) . kind {
221- let fn_sig = self . tcx . fn_sig ( def_id) ;
222- if let Abi :: RustIntrinsic | Abi :: PlatformIntrinsic = fn_sig. abi ( ) {
223- let name = self . tcx . item_name ( def_id) ;
224- // FIXME(eddyb) use `#[rustc_args_required_const(2)]` for shuffles.
225- if name. as_str ( ) . starts_with ( "simd_shuffle" ) {
226- self . candidates . push ( Candidate :: Argument { bb : location. block , index : 2 } ) ;
227-
228- return ; // Don't double count `simd_shuffle` candidates
229- }
230- }
231-
232219 if let Some ( constant_args) = args_required_const ( self . tcx , def_id) {
233220 for index in constant_args {
234221 self . candidates . push ( Candidate :: Argument { bb : location. block , index } ) ;
@@ -730,8 +717,7 @@ pub fn validate_candidates(
730717 . filter ( |& candidate| {
731718 validator. explicit = candidate. forces_explicit_promotion ( ) ;
732719
733- // FIXME(eddyb) also emit the errors for shuffle indices
734- // and `#[rustc_args_required_const]` arguments here.
720+ // FIXME(eddyb) also emit the errors for `#[rustc_args_required_const]` arguments here.
735721
736722 let is_promotable = validator. validate_candidate ( candidate) . is_ok ( ) ;
737723 match candidate {
0 commit comments