You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run Rust beta by default, which is currently at v1.62.
Running cargo test on my machine, libcnb main fails with:
...
failures:
---- src/newtypes.rs - newtypes::libcnb_newtype (line 24) stdout ----
error: cannot find macro `buildpack_id` in this scope
--> src/newtypes.rs:45:13
|
23 | let bp_id = buildpack_id!("foo");
| ^^^^^^^^^^^^
|
= note: consider importing this macro:
libcnb_data::buildpack_id
error: cannot find macro `libcnb_newtype` in this scope
--> src/newtypes.rs:25:1
|
3 | libcnb_newtype!(
| ^^^^^^^^^^^^^^
error[E0412]: cannot find type `BuildpackId` in this scope
--> src/newtypes.rs:42:27
|
20 | let bp_id = "bar".parse::<BuildpackId>().unwrap();
| ^^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use libcnb_data::buildpack::BuildpackId;
|
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0412`.
Couldn't compile the test.
failures:
src/newtypes.rs - newtypes::libcnb_newtype (line 24)
This appears to be due to the fact that until Rust 1.62, doctests that contain non-exported macro_rules! macros were not tested: rust-lang/rust#96630
As of Rust 1.62, doctests that contain non-exported `macro_rules!`
macros are now tested, when they were not before.
This causes `cargo test` to fail for this repository, due to the
`libcnb_newtype!` doctest trying to test a private macro.
Doctests can only test things that are public, so we can to either:
1. Make `libcnb_newtype!` public.
2. Annotate the doctest with `compile_fail`, so failure is expected.
3. Remove the example from the doctest.
I've gone with option (2), since it's useful to have the example (so
that people working on libcnb's codebase can use the macro more
easily), however the macro is really an internal thing, so I don't think
we want to export it publicly.
Fixes#410.
GUS-W-11312457.
As of Rust 1.62, doctests that contain non-exported `macro_rules!`
macros are now tested, when they were not before.
This causes `cargo test` to fail for this repository, due to the
`libcnb_newtype!` doctest trying to test a private macro.
Doctests can only test things that are public, so we have to either:
1. Make `libcnb_newtype!` public.
2. Annotate the doctest with `compile_fail`, so failure is expected.
3. Remove the code example from the doctest.
I've gone with option (2), since it's useful to have the example (so
that people working on libcnb's codebase can use the macro more
easily), however the macro is really an internal thing, so I don't think
we want to export it publicly.
Fixes#410.
GUS-W-11312457.
I run Rust beta by default, which is currently at v1.62.
Running
cargo test
on my machine, libcnbmain
fails with:This appears to be due to the fact that until Rust 1.62, doctests that contain non-exported
macro_rules!
macros were not tested:rust-lang/rust#96630
GUS-W-11312457.
The text was updated successfully, but these errors were encountered: