mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Pass crate environment to proc macros
This commit is contained in:
parent
798968e1e3
commit
70877428a8
6 changed files with 42 additions and 9 deletions
|
@ -51,6 +51,9 @@ pub struct ExpansionTask {
|
|||
pub attributes: Option<Subtree>,
|
||||
|
||||
pub lib: PathBuf,
|
||||
|
||||
/// Environment variables to set during macro expansion.
|
||||
pub env: Vec<(String, String)>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug, Default, Serialize, Deserialize)]
|
||||
|
@ -251,6 +254,7 @@ mod tests {
|
|||
macro_name: Default::default(),
|
||||
attributes: None,
|
||||
lib: Default::default(),
|
||||
env: Default::default(),
|
||||
};
|
||||
|
||||
let json = serde_json::to_string(&task).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue