Skip to content

Commit

Permalink
Use core instead of std
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Mar 30, 2023
1 parent 7109084 commit 07601a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ impl ErrorMessage {
None => (Span::call_site(), Span::call_site()),
};

// std::compile_error!($message)
// core::compile_error!($message)
TokenStream::from_iter(vec![
TokenTree::Ident(Ident::new("std", start)),
TokenTree::Ident(Ident::new("core", start)),
TokenTree::Punct({
let mut punct = Punct::new(':', Spacing::Joint);
punct.set_span(start);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ fn parse_crate_root_custom_inner_attribute() {
let error = syn::parse2::<Item>(tokens).unwrap_err();
assert_eq!(
error.to_compile_error().to_string(),
r#"std :: compile_error ! { "expected square brackets" }"#
r#"core :: compile_error ! { "expected square brackets" }"#
);
}

0 comments on commit 07601a8

Please sign in to comment.