Skip to content

Commit 54d5396

Browse files
idl: Update proc-macro2 usage for latest nightly (#3663)
1 parent 649b9d6 commit 54d5396

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The minor version will be incremented upon a breaking change and the patch versi
1515

1616
### Fixes
1717

18+
- idl: Update `proc-macro2` usage for latest nightly ([#3663](https://github.com/solana-foundation/anchor/pull/3663))
1819
- cli, docker: Replace `backpackapp/build` Docker image with `solanafoundation/anchor` ([#3619](https://github.com/coral-xyz/anchor/pull/3619)).
1920

2021
### Breaking

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lang/syn/src/idl/defined.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,11 @@ pub fn gen_idl_type(
496496
use crate::parser::context::CrateContext;
497497
use quote::ToTokens;
498498

499-
let source_path = proc_macro2::Span::call_site().source_file().path();
499+
// If no path was found, just return an empty path and let the find_path function handle it
500+
let source_path = proc_macro2::Span::call_site()
501+
.local_file()
502+
.unwrap_or_default();
503+
500504
if let Ok(Ok(ctx)) = find_path("lib.rs", &source_path).map(CrateContext::parse) {
501505
let name = path.path.segments.last().unwrap().ident.to_string();
502506
let alias = ctx.type_aliases().find(|ty| ty.ident == name);

0 commit comments

Comments
 (0)