Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Test $crate
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 19, 2018
1 parent 7e0f9a3 commit edad180
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion demo-hack-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate proc_macro_hack;
proc_macro_expr_impl! {
/// Add one to an expression.
pub fn add_one_impl(input: &str) -> String {
format!("1 + {}", input)
format!("$crate::ONE + {}", input)
}
}

Expand Down
2 changes: 2 additions & 0 deletions demo-hack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ extern crate demo_hack_impl;
#[doc(hidden)]
pub use demo_hack_impl::*;

pub const ONE: u8 = 1;

proc_macro_expr_decl! {
/// Add one to an expression.
add_one! => add_one_impl
Expand Down

0 comments on commit edad180

Please sign in to comment.