File tree 5 files changed +7
-38
lines changed
src/tools/rust-analyzer/crates
ide-completion/src/completions
5 files changed +7
-38
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,6 @@ pub enum FnAbi {
400
400
Rust ,
401
401
RustCall ,
402
402
RustCold ,
403
- RustIntrinsic ,
404
403
Stdcall ,
405
404
StdcallUnwind ,
406
405
System ,
@@ -457,7 +456,6 @@ impl FnAbi {
457
456
s if * s == sym:: riscv_dash_interrupt_dash_s => FnAbi :: RiscvInterruptS ,
458
457
s if * s == sym:: rust_dash_call => FnAbi :: RustCall ,
459
458
s if * s == sym:: rust_dash_cold => FnAbi :: RustCold ,
460
- s if * s == sym:: rust_dash_intrinsic => FnAbi :: RustIntrinsic ,
461
459
s if * s == sym:: Rust => FnAbi :: Rust ,
462
460
s if * s == sym:: stdcall_dash_unwind => FnAbi :: StdcallUnwind ,
463
461
s if * s == sym:: stdcall => FnAbi :: Stdcall ,
@@ -500,7 +498,6 @@ impl FnAbi {
500
498
FnAbi :: Rust => "Rust" ,
501
499
FnAbi :: RustCall => "rust-call" ,
502
500
FnAbi :: RustCold => "rust-cold" ,
503
- FnAbi :: RustIntrinsic => "rust-intrinsic" ,
504
501
FnAbi :: Stdcall => "stdcall" ,
505
502
FnAbi :: StdcallUnwind => "stdcall-unwind" ,
506
503
FnAbi :: System => "system" ,
Original file line number Diff line number Diff line change @@ -59,19 +59,7 @@ impl Evaluator<'_> {
59
59
60
60
let function_data = self . db . function_data ( def) ;
61
61
let attrs = self . db . attrs ( def. into ( ) ) ;
62
- let is_intrinsic = attrs. by_key ( & sym:: rustc_intrinsic) . exists ( )
63
- // Keep this around for a bit until extern "rustc-intrinsic" abis are no longer used
64
- || ( match & function_data. abi {
65
- Some ( abi) => * abi == sym:: rust_dash_intrinsic,
66
- None => match def. lookup ( self . db . upcast ( ) ) . container {
67
- hir_def:: ItemContainerId :: ExternBlockId ( block) => {
68
- let id = block. lookup ( self . db . upcast ( ) ) . id ;
69
- id. item_tree ( self . db . upcast ( ) ) [ id. value ] . abi . as_ref ( )
70
- == Some ( & sym:: rust_dash_intrinsic)
71
- }
72
- _ => false ,
73
- } ,
74
- } ) ;
62
+ let is_intrinsic = attrs. by_key ( & sym:: rustc_intrinsic) . exists ( ) ;
75
63
76
64
if is_intrinsic {
77
65
return self . exec_intrinsic (
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ use hir_def::{
18
18
TypeOrConstParamId ,
19
19
} ;
20
20
use hir_expand:: name:: Name ;
21
- use intern:: sym;
22
21
use rustc_abi:: TargetDataLayout ;
23
22
use rustc_hash:: FxHashSet ;
24
23
use smallvec:: { smallvec, SmallVec } ;
@@ -303,26 +302,13 @@ pub fn is_fn_unsafe_to_call(
303
302
304
303
let loc = func. lookup ( db. upcast ( ) ) ;
305
304
match loc. container {
306
- hir_def:: ItemContainerId :: ExternBlockId ( block) => {
307
- let id = block. lookup ( db. upcast ( ) ) . id ;
308
- let is_intrinsic_block =
309
- id. item_tree ( db. upcast ( ) ) [ id. value ] . abi . as_ref ( ) == Some ( & sym:: rust_dash_intrinsic) ;
310
- if is_intrinsic_block {
311
- // legacy intrinsics
312
- // extern "rust-intrinsic" intrinsics are unsafe unless they have the rustc_safe_intrinsic attribute
313
- if db. attrs ( func. into ( ) ) . by_key ( & sym:: rustc_safe_intrinsic) . exists ( ) {
314
- Unsafety :: Safe
315
- } else {
316
- Unsafety :: Unsafe
317
- }
305
+ hir_def:: ItemContainerId :: ExternBlockId ( _block) => {
306
+ // Function in an `extern` block are always unsafe to call, except when
307
+ // it is marked as `safe`.
308
+ if data. is_safe ( ) {
309
+ Unsafety :: Safe
318
310
} else {
319
- // Function in an `extern` block are always unsafe to call, except when
320
- // it is marked as `safe`.
321
- if data. is_safe ( ) {
322
- Unsafety :: Safe
323
- } else {
324
- Unsafety :: Unsafe
325
- }
311
+ Unsafety :: Unsafe
326
312
}
327
313
}
328
314
_ => Unsafety :: Safe ,
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ const SUPPORTED_CALLING_CONVENTIONS: &[&str] = &[
36
36
"wasm" ,
37
37
"system" ,
38
38
"system-unwind" ,
39
- "rust-intrinsic" ,
40
39
"rust-call" ,
41
40
"unadjusted" ,
42
41
] ;
Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ define_symbols! {
125
125
riscv_dash_interrupt_dash_s = "riscv-interrupt-s" ,
126
126
rust_dash_call = "rust-call" ,
127
127
rust_dash_cold = "rust-cold" ,
128
- rust_dash_intrinsic = "rust-intrinsic" ,
129
128
stdcall_dash_unwind = "stdcall-unwind" ,
130
129
system_dash_unwind = "system-unwind" ,
131
130
sysv64_dash_unwind = "sysv64-unwind" ,
You can’t perform that action at this time.
0 commit comments