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

(Minor) Compiler warnings on rust >=1.66 (const_err lint) #2455

Closed
optout21 opened this issue Jul 26, 2023 · 1 comment · Fixed by #2681
Closed

(Minor) Compiler warnings on rust >=1.66 (const_err lint) #2455

optout21 opened this issue Jul 26, 2023 · 1 comment · Fixed by #2681

Comments

@optout21
Copy link
Contributor

On Rust toolchain v >= 1.66, 3 compiler warnings are generated, due to usage of #[deny(const_err)], which has been removed, and converted to a hard error.

To fix:

  • Remove these lines, relying on the fact that CI has builds with newer compiler version, so any eventual mis-use will be detected
    or
  • Wrap these lines in conditional compilation (e.g. #[rustversion::before(1.66)]), so that it's active only on older versions. However, making a directive conditional may not be trivial.
warning: lint `const_err` has been removed: converted into hard error, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> for more information
    --> lightning/src/ln/channelmanager.rs:1253:8
     |
1253 | #[deny(const_err)]
     |        ^^^^^^^^^
     |
     = note: `#[warn(renamed_and_removed_lints)]` on by default
@TheBlueMatt
Copy link
Collaborator

We've not bothered to remove it, as we wanted to keep older versions of rustc (at least from our MSRV) enforcing the const-err (which we use as assertions in various places). We definitely shouldn't add a dependency to use the rustversion conditional compilation, but I think we could probably remove them now given most folks are using toolchains where const_err generates the warning.

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