Skip to content
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

Rust 1.62 doesn't like the docstring on instrinsics #374

Closed
9names opened this issue Jul 3, 2022 · 1 comment · Fixed by #378
Closed

Rust 1.62 doesn't like the docstring on instrinsics #374

9names opened this issue Jul 3, 2022 · 1 comment · Fixed by #378

Comments

@9names
Copy link
Member

9names commented Jul 3, 2022

In the new Rust release (1.62.0), cargo doc has a failing test for the code in this docstring, which CI is upset about.

I plan to merge a small PR that comments out the code to get it to work again. This issue is to remind us to investigate and either report or fix (depending on whether this breakage is our fault or cargo doc's)

The code that breaks is here

/// intrinsics! {

I've quoted it below to make it a bit more accessible.

/// The macro used to define overridden intrinsics.
///
/// This is heavily inspired by the macro used by compiler-builtins.  The idea
/// is to abstract anything special that needs to be done to override an
/// intrinsic function.  Intrinsic generation is disabled for non-ARM targets
/// so things like CI and docs generation do not have problems.  Additionally
/// they can be disabled with the crate feature `disable-intrinsics` for
/// testing or comparing performance.
///
/// Like the compiler-builtins macro, it accepts a series of functions that
/// looks like normal Rust code:
///
///     intrinsics! {
///         extern "C" fn foo(a: i32) -> u32 {
///             // ...
///         }
///
///         #[nonstandard_attribute]
///         extern "C" fn bar(a: i32) -> u32 {
///             // ...
///         }
///     }
///
/// Each function can also be decorated with nonstandard attributes to control
/// additional behaviour:
///
/// * `slower_than_default` - indicates that the override is slower than the
///   default implementation.  Currently this just disables the override
///   entirely.
/// * `bootrom_v2` - indicates that the override is only available
///   on a V2 bootrom or higher.  Only enabled when the feature
///   `rom-v2-intrinsics` is set.
/// * `alias` - accepts a list of names to alias the intrinsic to.
/// * `aeabi` - accepts a list of ARM EABI names to alias to.
///
macro_rules! intrinsics {
@jannic
Copy link
Member

jannic commented Jul 6, 2022

Looks like before 1.62, non-expored macros were not doc-tested:
rust-lang/rust#97030
rust-lang/rust#98749

jannic added a commit that referenced this issue Jul 7, 2022
While the code block fails to compile, it's still code and not random text. Marking it with `ignore` allows for proper syntax highlighting, for example.

According to rust-lang/rust#97030 (comment) this is the proper fix, so this closes #374
9names pushed a commit that referenced this issue Jul 8, 2022
While the code block fails to compile, it's still code and not random text. Marking it with `ignore` allows for proper syntax highlighting, for example.

According to rust-lang/rust#97030 (comment) this is the proper fix, so this closes #374
ExplodingWaffle pushed a commit to ExplodingWaffle/rp-hal that referenced this issue Aug 14, 2022
While the code block fails to compile, it's still code and not random text. Marking it with `ignore` allows for proper syntax highlighting, for example.

According to rust-lang/rust#97030 (comment) this is the proper fix, so this closes rp-rs#374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants