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

Commit edad180

Browse files
committed
Test $crate
1 parent 7e0f9a3 commit edad180

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

demo-hack-impl/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extern crate proc_macro_hack;
44
proc_macro_expr_impl! {
55
/// Add one to an expression.
66
pub fn add_one_impl(input: &str) -> String {
7-
format!("1 + {}", input)
7+
format!("$crate::ONE + {}", input)
88
}
99
}
1010

demo-hack/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ extern crate demo_hack_impl;
1111
#[doc(hidden)]
1212
pub use demo_hack_impl::*;
1313

14+
pub const ONE: u8 = 1;
15+
1416
proc_macro_expr_decl! {
1517
/// Add one to an expression.
1618
add_one! => add_one_impl

0 commit comments

Comments
 (0)