@@ -24,7 +24,6 @@ use rustc_span::{Span, DUMMY_SP};
24
24
use syntax:: ast:: LitKind ;
25
25
26
26
use rustc_index:: vec:: { Idx , IndexVec } ;
27
- use rustc_target:: spec:: abi:: Abi ;
28
27
29
28
use std:: cell:: Cell ;
30
29
use std:: { cmp, iter, mem, usize} ;
@@ -106,11 +105,10 @@ pub enum Candidate {
106
105
/// Promotion of the `x` in `[x; 32]`.
107
106
Repeat ( Location ) ,
108
107
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.
114
112
Argument { bb : BasicBlock , index : usize } ,
115
113
}
116
114
@@ -218,17 +216,6 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
218
216
219
217
if let TerminatorKind :: Call { ref func, .. } = * kind {
220
218
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
-
232
219
if let Some ( constant_args) = args_required_const ( self . tcx , def_id) {
233
220
for index in constant_args {
234
221
self . candidates . push ( Candidate :: Argument { bb : location. block , index } ) ;
@@ -730,8 +717,7 @@ pub fn validate_candidates(
730
717
. filter ( |& candidate| {
731
718
validator. explicit = candidate. forces_explicit_promotion ( ) ;
732
719
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.
735
721
736
722
let is_promotable = validator. validate_candidate ( candidate) . is_ok ( ) ;
737
723
match candidate {
0 commit comments