-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find assert
in $crate::core using [no_std]
#55482
Comments
This may be related to the issue where macros (it seems limited to built-in ones) don't work when called qualified with their path. Playground fn main() {
// These macros are built into the compiler and calling them qualified
// with their path does not work:
//
// let _ = std::column!();
// let _ = std::format_args!("blah");
// let _ = std::concat!("abc", "def");
// But it works with non built-in macros:
let _ = std::format!("blah");
let _ = std::vec![0, 1];
} |
It should be possible to make a proxy macro |
This is a bug. The documentation of libcore shows assert being provided by core. I understand that there is nuance around built-in macros but it's clear to me that |
Triage: the docs of libcore should probably be updated. |
Is the request for |
@dtolnay @steveklabnik you've said contradicting things: @dtolnay said |
It's possible there was a rustdoc issue also. According to #55482 (comment), rustdoc was showing |
Heh, after all that it turns out this compiles as-is (maybe assert was moved to core recently?). I'll add a test for it. |
… path. Fixes rust-lang#74355 The issue with the built-in derives may be related to: rust-lang#55482 (comment)
Compiling the above code generates this error message:
However, this compiles:
Note that for the
assert_eq
invokation both versions$crate::core::assert_eq!
and justassert_eq!
works.Is this intended behaviour or a bug?
Try it yourself at the playground.
The text was updated successfully, but these errors were encountered: