From 9a2e2450f968f60877f595d0609c15ad5ee821fa Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Wed, 17 May 2017 09:40:46 -0400 Subject: add thiscall calling convention support This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044. --- src/libsyntax/abi.rs | 2 ++ src/libsyntax/feature_gate.rs | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 30641515a41..ed2eb209906 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -20,6 +20,7 @@ pub enum Abi { Stdcall, Fastcall, Vectorcall, + Thiscall, Aapcs, Win64, SysV64, @@ -55,6 +56,7 @@ const AbiDatas: &'static [AbiData] = &[ AbiData {abi: Abi::Stdcall, name: "stdcall", generic: false }, AbiData {abi: Abi::Fastcall, name: "fastcall", generic: false }, AbiData {abi: Abi::Vectorcall, name: "vectorcall", generic: false}, + AbiData {abi: Abi::Thiscall, name: "thiscall", generic: false}, AbiData {abi: Abi::Aapcs, name: "aapcs", generic: false }, AbiData {abi: Abi::Win64, name: "win64", generic: false }, AbiData {abi: Abi::SysV64, name: "sysv64", generic: false }, diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index e1b7d4681ad..f9fe072ef87 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -352,6 +352,9 @@ declare_features! ( // Allows use of the :vis macro fragment specifier (active, macro_vis_matcher, "1.18.0", Some(41022)), + + // rustc internal + (active, abi_thiscall, "1.19.0", None), ); declare_features! ( @@ -1051,6 +1054,10 @@ impl<'a> PostExpansionVisitor<'a> { gate_feature_post!(&self, abi_vectorcall, span, "vectorcall is experimental and subject to change"); }, + Abi::Thiscall => { + gate_feature_post!(&self, abi_thiscall, span, + "thiscall is experimental and subject to change"); + }, Abi::RustCall => { gate_feature_post!(&self, unboxed_closures, span, "rust-call ABI is subject to change"); -- cgit 1.4.1-3-g733a5