badboy / mdbook-toc

A preprocessor for mdbook to add inline Table of Contents support.
Mozilla Public License 2.0
163 stars 20 forks source link

"there is not argument named `lvl` -> trying to run on NixOS, rust version 1.60 #25

Closed rubenmoor closed 2 years ago

rubenmoor commented 2 years ago

Initially I thought, I might have an outdated compiler. Maybe it's the other way round and I would need an older rust version?

The complete error output:

Building src/lib.rs (mdbook-toc)
Running rustc --crate-name mdbook_toc src/lib.rs --out-dir target/lib -L dependency=target/deps --cap-lints allow -C opt-level=3 -C codegen-units=12 --remap-path-prefix=/build=/ --extern clap=/nix/store/7xp30mwywwfysbw0f03jvp2pis847y0g-rust_clap-3.1.18-lib/lib/libclap-17a2d49504.rlib --extern log=/nix/store/axdxwy8p8ca8qrlmc029jkxxihw5hp1f-rust_log-0.4.17-lib/lib/liblog-e2499ee0d6.rlib --extern mdbook=/nix/store/7y7rn60m24gabhvxxd19mphr67c2lhvn-rust_mdbook-0.4.18-lib/lib/libmdbook-26a8710dc5.rlib --extern pulldown_cmark=/nix/store/2vzs56371k69mxnxdkx2sg14ydh37vqm-rust_pulldown-cmark-0.9.1-lib/lib/libpulldown_cmark-5e839933f8.rlib --extern serde_json=/nix/store/xm2z8ljqhqs27g90lbxdiz5m4f1hn4yp-rust_serde_json-1.0.81-lib/lib/libserde_json-8aec5f5528.rlib --extern toml=/nix/store/f5vkyjfp2dr5a973avnij3v95qf8qk1f-rust_toml-0.5.9-lib/lib/libtoml-953185daac.rlib --cfg feature="default" --edition 2018 -C metadata=4a561af255 -C extra-filename=-4a561af255 --crate-type lib --color always
error: there is no argument named `lvl`
   --> src/lib.rs:182:37
    |
182 |             log::trace!("Header(lvl={lvl}, fragment={fragment:?}, classes={classes:?})");
    |                                     ^^^^^

error: there is no argument named `fragment`
   --> src/lib.rs:182:53
    |
182 |             log::trace!("Header(lvl={lvl}, fragment={fragment:?}, classes={classes:?})");
    |                                                     ^^^^^^^^^^^^

error: there is no argument named `classes`
   --> src/lib.rs:182:75
    |
182 |             log::trace!("Header(lvl={lvl}, fragment={fragment:?}, classes={classes:?})");
    |                                                                           ^^^^^^^^^^^

error: there is no argument named `toc_found`
   --> src/lib.rs:222:28
    |
222 |     log::trace!("toc_found={toc_found} mark_start={mark_start:?} mark_end={mark_end:?}");
    |                            ^^^^^^^^^^^

error: there is no argument named `mark_start`
   --> src/lib.rs:222:51
    |
222 |     log::trace!("toc_found={toc_found} mark_start={mark_start:?} mark_end={mark_end:?}");
    |                                                   ^^^^^^^^^^^^^^

error: there is no argument named `mark_end`
   --> src/lib.rs:222:75
    |
222 |     log::trace!("toc_found={toc_found} mark_start={mark_start:?} mark_end={mark_end:?}");
    |                                                                           ^^^^^^^^^^^^

error: aborting due to 6 previous errors

builder for '/nix/store/5n93bb8cixkwikbx6l7k8dd6infhg9ar-rust_mdbook-toc-0.9.0.drv' failed with exit code 1
error: build of '/nix/store/5n93bb8cixkwikbx6l7k8dd6infhg9ar-rust_mdbook-toc-0.9.0.drv', '/nix/store/cd4d078k190bxrw09pbw5v370wrnh4y8-rust_mdbook-0.4.1.drv' failed
badboy commented 2 years ago

No, this code works from rust 1.58 onwards. Are you sure you're running 1.60? I just tested it locally with 1.60 and it compiles just fine.

rubenmoor commented 2 years ago

Thanks. My mistake. I am on NixOS, 21.11, with rust version 1.56. From 22.05 on, the rust version is 1.60.0.