bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.39k stars 3.59k forks source link

Rustdoc fails to build with `fake_variadic` in `all_tuples`. #16320

Open mintlu8 opened 2 weeks ago

mintlu8 commented 2 weeks ago

Bevy version

0.15.0-rc.3

What you did

Build rustdoc of a third party crate with command

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features

What went wrong

error: `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
    --> ../bevy_ecs-0.15.0-rc.3/src/query/fetch.rs:2178:1
     |
2178 | / all_tuples!(
2179 | |     #[doc(fake_variadic)]
2180 | |     impl_anytuple_fetch,
2181 | |     0,
...    |
2184 | |     S
2185 | | );
     | |_^
     |
     = note: this error originates in the macro `all_tuples` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
   --> ../bevy_ecs-0.15.0-rc.3/src/query/filter.rs:551:1
    |
551 | / all_tuples!(
552 | |     #[doc(fake_variadic)]
553 | |     impl_or_query_filter,
554 | |     0,
...   |
557 | |     S
558 | | );
    | |_^
    |
    = note: this error originates in the macro `all_tuples` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
    --> ../bevy_ecs-0.15.0-rc.3/src/query/filter.rs:1070:1
     |
1070 | / all_tuples!(
1071 | |     #[doc(fake_variadic)]
1072 | |     impl_archetype_or_filter_tuple,
1073 | |     0,
1074 | |     15,
1075 | |     F
1076 | | );
     | |_^
     |
     = note: this error originates in the macro `all_tuples` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
   --> ../bevy_ecs-0.15.0-rc.3/src/system/function_system.rs:348:1
    |
348 | / all_tuples!(
349 | |     #[doc(fake_variadic)]
350 | |     impl_build_system,
351 | |     0,
352 | |     16,
353 | |     P
354 | | );
    | |_^
    |
    = note: this error originates in the macro `all_tuples` (in Nightly builds, run with -Z macro-backtrace for more info)
BenjaminBrienen commented 2 weeks ago

I'm currently trying out:

PS C:\Users\BenjaminBrienen\source\bevy> set RUSTDOCFLAGS="--cfg docsrs" ; cargo +nightly doc --workspace --all-features --no-deps --document-private-items --keep-going
BenjaminBrienen commented 2 weeks ago

It's kind of stuck on the last step doc.txt

BenjaminBrienen commented 2 weeks ago

Ok, it finally finished successfully. I can't reproduce the issue.

Documenting bevy v0.15.0-dev (C:\Users\BenjaminBrienen\source\bevy)
 Documenting errors v0.0.0 (C:\Users\BenjaminBrienen\source\bevy\errors)                                                                                                                                            
 Documenting bevy_mobile_example v0.0.0 (C:\Users\BenjaminBrienen\source\bevy\examples\mobile)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6m 21s                                                                                                                                            
   Generated C:\Users\BenjaminBrienen\source\bevy\target\doc\bevy\index.html and 57 other files
mintlu8 commented 2 weeks ago

Ok, it finally finished successfully. I can't reproduce the issue.

Documenting bevy v0.15.0-dev (C:\Users\BenjaminBrienen\source\bevy)
 Documenting errors v0.0.0 (C:\Users\BenjaminBrienen\source\bevy\errors)                                                                                                                                            
 Documenting bevy_mobile_example v0.0.0 (C:\Users\BenjaminBrienen\source\bevy\examples\mobile)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6m 21s                                                                                                                                            
   Generated C:\Users\BenjaminBrienen\source\bevy\target\doc\bevy\index.html and 57 other files

The problem goes away with --no-deps.

BenjaminBrienen commented 2 weeks ago

Image The tag didn't actually work if I look at the output

BenjaminBrienen commented 2 weeks ago

I think I was missing RUSTFLAGS='--cfg docsrs_dep'

BenjaminBrienen commented 2 weeks ago

@MrGVSV I get this when building the docs. Do you have any insight as to why the the marker isn't working?

Image

set RUSTDOCFLAGS="--cfg docsrs" ; set RUSTFLAGS='--cfg docsrs_dep' ; cargo +nightly doc --workspace --all-features --no-deps --document-private-items --keep-going
MrGVSV commented 2 weeks ago

@MrGVSV I get this when building the docs. Do you have any insight as to why the the marker isn't working?

I'm not sure. I was also getting that for some of my local builds too 🤔