mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Merge #11810
11810: internal: rename the 1.47 proc macro ABI to 1.48 r=jonas-schievink a=jonas-schievink Closes https://github.com/rust-analyzer/rust-analyzer/issues/9898. We don't support 1.47, so rename it to reflect that. bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
This commit is contained in:
commit
d64f455e88
14 changed files with 10 additions and 10 deletions
|
@ -24,14 +24,14 @@
|
||||||
//!
|
//!
|
||||||
|
|
||||||
// pub(crate) so tests can use the TokenStream, more notes in test/utils.rs
|
// pub(crate) so tests can use the TokenStream, more notes in test/utils.rs
|
||||||
pub(crate) mod abi_1_47;
|
pub(crate) mod abi_1_48;
|
||||||
mod abi_1_54;
|
mod abi_1_54;
|
||||||
mod abi_1_56;
|
mod abi_1_56;
|
||||||
mod abi_1_57;
|
mod abi_1_57;
|
||||||
mod abi_1_58;
|
mod abi_1_58;
|
||||||
|
|
||||||
use super::dylib::LoadProcMacroDylibError;
|
use super::dylib::LoadProcMacroDylibError;
|
||||||
pub(crate) use abi_1_47::Abi as Abi_1_47;
|
pub(crate) use abi_1_48::Abi as Abi_1_48;
|
||||||
pub(crate) use abi_1_54::Abi as Abi_1_54;
|
pub(crate) use abi_1_54::Abi as Abi_1_54;
|
||||||
pub(crate) use abi_1_56::Abi as Abi_1_56;
|
pub(crate) use abi_1_56::Abi as Abi_1_56;
|
||||||
pub(crate) use abi_1_57::Abi as Abi_1_57;
|
pub(crate) use abi_1_57::Abi as Abi_1_57;
|
||||||
|
@ -50,7 +50,7 @@ impl PanicMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) enum Abi {
|
pub(crate) enum Abi {
|
||||||
Abi1_47(Abi_1_47),
|
Abi1_48(Abi_1_48),
|
||||||
Abi1_54(Abi_1_54),
|
Abi1_54(Abi_1_54),
|
||||||
Abi1_56(Abi_1_56),
|
Abi1_56(Abi_1_56),
|
||||||
Abi1_57(Abi_1_57),
|
Abi1_57(Abi_1_57),
|
||||||
|
@ -75,9 +75,9 @@ impl Abi {
|
||||||
// FIXME: this should use exclusive ranges when they're stable
|
// FIXME: this should use exclusive ranges when they're stable
|
||||||
// https://github.com/rust-lang/rust/issues/37854
|
// https://github.com/rust-lang/rust/issues/37854
|
||||||
match (info.version.0, info.version.1) {
|
match (info.version.0, info.version.1) {
|
||||||
(1, 47..=53) => {
|
(1, 48..=53) => {
|
||||||
let inner = unsafe { Abi_1_47::from_lib(lib, symbol_name) }?;
|
let inner = unsafe { Abi_1_48::from_lib(lib, symbol_name) }?;
|
||||||
Ok(Abi::Abi1_47(inner))
|
Ok(Abi::Abi1_48(inner))
|
||||||
}
|
}
|
||||||
(1, 54..=55) => {
|
(1, 54..=55) => {
|
||||||
let inner = unsafe { Abi_1_54::from_lib(lib, symbol_name) }?;
|
let inner = unsafe { Abi_1_54::from_lib(lib, symbol_name) }?;
|
||||||
|
@ -106,7 +106,7 @@ impl Abi {
|
||||||
attributes: Option<&tt::Subtree>,
|
attributes: Option<&tt::Subtree>,
|
||||||
) -> Result<tt::Subtree, PanicMessage> {
|
) -> Result<tt::Subtree, PanicMessage> {
|
||||||
match self {
|
match self {
|
||||||
Self::Abi1_47(abi) => abi.expand(macro_name, macro_body, attributes),
|
Self::Abi1_48(abi) => abi.expand(macro_name, macro_body, attributes),
|
||||||
Self::Abi1_54(abi) => abi.expand(macro_name, macro_body, attributes),
|
Self::Abi1_54(abi) => abi.expand(macro_name, macro_body, attributes),
|
||||||
Self::Abi1_56(abi) => abi.expand(macro_name, macro_body, attributes),
|
Self::Abi1_56(abi) => abi.expand(macro_name, macro_body, attributes),
|
||||||
Self::Abi1_57(abi) => abi.expand(macro_name, macro_body, attributes),
|
Self::Abi1_57(abi) => abi.expand(macro_name, macro_body, attributes),
|
||||||
|
@ -116,7 +116,7 @@ impl Abi {
|
||||||
|
|
||||||
pub fn list_macros(&self) -> Vec<(String, ProcMacroKind)> {
|
pub fn list_macros(&self) -> Vec<(String, ProcMacroKind)> {
|
||||||
match self {
|
match self {
|
||||||
Self::Abi1_47(abi) => abi.list_macros(),
|
Self::Abi1_48(abi) => abi.list_macros(),
|
||||||
Self::Abi1_54(abi) => abi.list_macros(),
|
Self::Abi1_54(abi) => abi.list_macros(),
|
||||||
Self::Abi1_56(abi) => abi.list_macros(),
|
Self::Abi1_56(abi) => abi.list_macros(),
|
||||||
Self::Abi1_57(abi) => abi.list_macros(),
|
Self::Abi1_57(abi) => abi.list_macros(),
|
||||||
|
|
|
@ -11,14 +11,14 @@ pub mod fixtures {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_string(code: &str) -> Option<crate::abis::abi_1_47::TokenStream> {
|
fn parse_string(code: &str) -> Option<crate::abis::abi_1_48::TokenStream> {
|
||||||
// This is a bit strange. We need to parse a string into a token stream into
|
// This is a bit strange. We need to parse a string into a token stream into
|
||||||
// order to create a tt::SubTree from it in fixtures. `into_subtree` is
|
// order to create a tt::SubTree from it in fixtures. `into_subtree` is
|
||||||
// implemented by all the ABIs we have so we arbitrarily choose one ABI to
|
// implemented by all the ABIs we have so we arbitrarily choose one ABI to
|
||||||
// write a `parse_string` function for and use that. The tests don't really
|
// write a `parse_string` function for and use that. The tests don't really
|
||||||
// care which ABI we're using as the `into_subtree` function isn't part of
|
// care which ABI we're using as the `into_subtree` function isn't part of
|
||||||
// the ABI and shouldn't change between ABI versions.
|
// the ABI and shouldn't change between ABI versions.
|
||||||
crate::abis::abi_1_47::TokenStream::from_str(code).ok()
|
crate::abis::abi_1_48::TokenStream::from_str(code).ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn assert_expand(macro_name: &str, ra_fixture: &str, expect: Expect) {
|
pub fn assert_expand(macro_name: &str, ra_fixture: &str, expect: Expect) {
|
||||||
|
|
Loading…
Reference in a new issue