Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lang/syn/src/idl/defined.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::PathBuf;

use anyhow::{anyhow, Result};
use proc_macro2::TokenStream;
use quote::quote;
Expand Down Expand Up @@ -495,11 +497,7 @@ pub fn gen_idl_type(
use crate::parser::context::CrateContext;
use quote::ToTokens;

// If no path was found, just return an empty path and let the find_path function handle it
let source_path = proc_macro2::Span::call_site()
.unwrap()
.local_file()
.unwrap_or_default();
let source_path = PathBuf::from(proc_macro2::Span::call_site().file());

if let Ok(Ok(ctx)) = find_path("lib.rs", &source_path).map(CrateContext::parse) {
let name = path.path.segments.last().unwrap().ident.to_string();
Expand Down
Loading