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

Fix non_local_definitions warning caused by derive(displaydoc::Display) #4567

Closed
0x009922 opened this issue May 8, 2024 · 6 comments · Fixed by #4674
Closed

Fix non_local_definitions warning caused by derive(displaydoc::Display) #4567

0x009922 opened this issue May 8, 2024 · 6 comments · Fixed by #4674
Assignees
Labels
Bug Something isn't working good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@0x009922
Copy link
Contributor

0x009922 commented May 8, 2024

Description

There are dozens of warnings like this (example CI run):

warning: non-local `impl` definition, they should be avoided as they go against expectation
  --> primitives/numeric/src/lib.rs:65:30
   |
65 | #[derive(Debug, Clone, Copy, displaydoc::Display)]
   |                              ^^^^^^^^^^^^^^^^^^^
   |
   = help: move this `impl` block outside the of the current constant `_DERIVE_Display_FOR_NumericError`
   = note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
   = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
   = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
   = note: the derive macro `displaydoc::Display` may come from an old version of the `displaydoc` crate, try updating your dependency with `cargo update -p displaydoc`
   = note: `#[warn(non_local_definitions)]` on by default
   = note: this warning originates in the derive macro `displaydoc::Display` (in Nightly builds, run with -Z macro-backtrace for more info)
@0x009922 0x009922 added Bug Something isn't working good first issue Good for newcomers iroha2 labels May 8, 2024
@Moses-main
Copy link

Hello, assign to me this issue.

@DCNick3
Copy link
Contributor

DCNick3 commented May 13, 2024

A proper fix require changes to displaydoc. There is already a PR open, but the maintainer hasn't been responding for two months =(

On our side we can just silence the warning and follow up on it later or use a git ref from this PR.

@nxsaken
Copy link
Contributor

nxsaken commented May 14, 2024

I think it should be fine to proceed with this and leave a TODO comment with a link to yaahc/displaydoc#46. Using the PR version of displaydoc feels like the cleaner solution to me.

@nxsaken
Copy link
Contributor

nxsaken commented May 14, 2024

@Moses-main hi, I'm assigning this issue to you. Let's use the PR version of displaydoc as I described in the comment above. Thank you!

@nxsaken nxsaken removed the iroha2 label May 17, 2024
@dmitrivenger dmitrivenger added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label May 21, 2024
@nxsaken
Copy link
Contributor

nxsaken commented May 23, 2024

@Moses-main hi, are you still planning to complete this?

@Moses-main
Copy link

Yes, I'd do something about it.

0x009922 added a commit that referenced this issue May 31, 2024
Signed-off-by: 0x009922 <43530070+0x009922@users.noreply.github.com>
@nxsaken nxsaken assigned 0x009922 and unassigned Moses-main May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants