Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d64f455

Browse files
bors[bot]Jonas Schievink
and
Jonas Schievink
authored
11810: internal: rename the 1.47 proc macro ABI to 1.48 r=jonas-schievink a=jonas-schievink Closes rust-lang/rust-analyzer#9898. We don't support 1.47, so rename it to reflect that. bors r+ Co-authored-by: Jonas Schievink <[email protected]>
2 parents f3d1a53 + ea0325b commit d64f455

File tree

14 files changed

+10
-10
lines changed

14 files changed

+10
-10
lines changed

crates/proc_macro_srv/src/abis/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
//!
2525
2626
// pub(crate) so tests can use the TokenStream, more notes in test/utils.rs
27-
pub(crate) mod abi_1_47;
27+
pub(crate) mod abi_1_48;
2828
mod abi_1_54;
2929
mod abi_1_56;
3030
mod abi_1_57;
3131
mod abi_1_58;
3232

3333
use super::dylib::LoadProcMacroDylibError;
34-
pub(crate) use abi_1_47::Abi as Abi_1_47;
34+
pub(crate) use abi_1_48::Abi as Abi_1_48;
3535
pub(crate) use abi_1_54::Abi as Abi_1_54;
3636
pub(crate) use abi_1_56::Abi as Abi_1_56;
3737
pub(crate) use abi_1_57::Abi as Abi_1_57;
@@ -50,7 +50,7 @@ impl PanicMessage {
5050
}
5151

5252
pub(crate) enum Abi {
53-
Abi1_47(Abi_1_47),
53+
Abi1_48(Abi_1_48),
5454
Abi1_54(Abi_1_54),
5555
Abi1_56(Abi_1_56),
5656
Abi1_57(Abi_1_57),
@@ -75,9 +75,9 @@ impl Abi {
7575
// FIXME: this should use exclusive ranges when they're stable
7676
// https://github.com/rust-lang/rust/issues/37854
7777
match (info.version.0, info.version.1) {
78-
(1, 47..=53) => {
79-
let inner = unsafe { Abi_1_47::from_lib(lib, symbol_name) }?;
80-
Ok(Abi::Abi1_47(inner))
78+
(1, 48..=53) => {
79+
let inner = unsafe { Abi_1_48::from_lib(lib, symbol_name) }?;
80+
Ok(Abi::Abi1_48(inner))
8181
}
8282
(1, 54..=55) => {
8383
let inner = unsafe { Abi_1_54::from_lib(lib, symbol_name) }?;
@@ -106,7 +106,7 @@ impl Abi {
106106
attributes: Option<&tt::Subtree>,
107107
) -> Result<tt::Subtree, PanicMessage> {
108108
match self {
109-
Self::Abi1_47(abi) => abi.expand(macro_name, macro_body, attributes),
109+
Self::Abi1_48(abi) => abi.expand(macro_name, macro_body, attributes),
110110
Self::Abi1_54(abi) => abi.expand(macro_name, macro_body, attributes),
111111
Self::Abi1_56(abi) => abi.expand(macro_name, macro_body, attributes),
112112
Self::Abi1_57(abi) => abi.expand(macro_name, macro_body, attributes),
@@ -116,7 +116,7 @@ impl Abi {
116116

117117
pub fn list_macros(&self) -> Vec<(String, ProcMacroKind)> {
118118
match self {
119-
Self::Abi1_47(abi) => abi.list_macros(),
119+
Self::Abi1_48(abi) => abi.list_macros(),
120120
Self::Abi1_54(abi) => abi.list_macros(),
121121
Self::Abi1_56(abi) => abi.list_macros(),
122122
Self::Abi1_57(abi) => abi.list_macros(),

crates/proc_macro_srv/src/tests/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ pub mod fixtures {
1111
}
1212
}
1313

14-
fn parse_string(code: &str) -> Option<crate::abis::abi_1_47::TokenStream> {
14+
fn parse_string(code: &str) -> Option<crate::abis::abi_1_48::TokenStream> {
1515
// This is a bit strange. We need to parse a string into a token stream into
1616
// order to create a tt::SubTree from it in fixtures. `into_subtree` is
1717
// implemented by all the ABIs we have so we arbitrarily choose one ABI to
1818
// write a `parse_string` function for and use that. The tests don't really
1919
// care which ABI we're using as the `into_subtree` function isn't part of
2020
// the ABI and shouldn't change between ABI versions.
21-
crate::abis::abi_1_47::TokenStream::from_str(code).ok()
21+
crate::abis::abi_1_48::TokenStream::from_str(code).ok()
2222
}
2323

2424
pub fn assert_expand(macro_name: &str, ra_fixture: &str, expect: Expect) {

0 commit comments

Comments
 (0)