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

Too many non-local impl definition for sp :: FieldOffsets in rust nightly 1.81 #5490

Closed
wuanzhuan opened this issue Jun 26, 2024 · 5 comments

Comments

@wuanzhuan
Copy link

There are too many warning when i update rust to nightly1.81(from nightly 1.75)

warning: non-local impl definition, impl blocks should be written at the same level as their item
--> out\main.rs:12:17
|
12 | # [derive (sp :: FieldOffsets , Default)] # [const_field_offset (sp :: const_field_offset)] # [repr (C)] # [pin] struct InnerEnablesData {
| ^----------------- ---------------- InnerEnablesData is not local
| |
| Unpin is not local
|
= note: the derive macro sp::FieldOffsets defines the non-local impl, and may need to be changed
= note: the derive macro sp::FieldOffsets may come from an old version of the const_field_offset_macro crate, try updating your dependency with cargo update -p const_field_offset_macro
= note: impl may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
= note: an impl is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the impl
help: move the impl block outside of this associated constant FIELD_OFFSETS
--> C:\Users\wuanz\dev\github.com\wuanzhuan\system_monitor\target\debug\build\sys_monitor-cd7b756010b34e61\out\main.rs:12:17
|
12 | # [derive (sp :: FieldOffsets , Default)] # [const_field_offset (sp :: const_field_offset)] # [repr (C)] # [pin] struct InnerEnablesData {
| ^^^^^^^^^^^^^^^^^^ may need to be moved as well
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue rust-lang/rust#120363
= note: #[warn(non_local_definitions)] on by default
= note: this warning originates in the derive macro sp::FieldOffsets (in Nightly builds, run with -Z macro-backtrace for more info)

warning: non-local impl definition, impl blocks should be written at the same level as their item
--> C:\Users\wuanz\dev\github.com\wuanzhuan\system_monitor\target\debug\build\sys_monitor-cd7b756010b34e61\out\main.rs:70:17
|
70 | # [derive (sp :: FieldOffsets , Default)] # [const_field_offset (sp :: const_field_offset)] # [repr (C)] # [pin] struct InnerEventsViewData {
| ^----------------- ------------------- InnerEventsViewData is not local
| |
| Unpin is not local
|
= note: the derive macro sp::FieldOffsets defines the non-local impl, and may need to be changed
= note: the derive macro sp::FieldOffsets may come from an old version of the const_field_offset_macro crate, try updating your dependency with cargo update -p const_field_offset_macro
= note: impl may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
= note: an impl is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the impl
help: move the impl block outside of this associated constant FIELD_OFFSETS
--> C:\Users\wuanz\dev\github.com\wuanzhuan\system_monitor\target\debug\build\sys_monitor-cd7b756010b34e61\out\main.rs:70:17
|
70 | # [derive (sp :: FieldOffsets , Default)] # [const_field_offset (sp :: const_field_offset)] # [repr (C)] # [pin] struct InnerEventsViewData {
| ^^^^^^^^^^^^^^^^^^ may need to be moved as well
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue rust-lang/rust#120363
= note: this warning originates in the derive macro sp::FieldOffsets (in Nightly builds, run with -Z macro-backtrace for more info)

warning: non-local impl definition, impl blocks should be written at the same level as their item
--> C:\Users\wuanz\dev\github.com\wuanzhuan\system_monitor\target\debug\build\sys_monitor-cd7b756010b34e61\out\main.rs:163:17
|
163 | # [derive (sp :: FieldOffsets , Default)] # [const_field_offset (sp :: const_field_offset)] # [repr (C)] # [pin] struct InnerColorSchemeSelector_261 {
| ^----------------- ---------------------------- InnerColorSchemeSelector_261 is not local
| |
| Unpin is not local
|
= note: the derive macro sp::FieldOffsets defines the non-local impl, and may need to be changed
= note: the derive macro sp::FieldOffsets may come from an old version of the const_field_offset_macro crate, try updating your dependency with cargo update -p const_field_offset_macro
= note: impl may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
= note: an impl is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the impl
help: move the impl block outside of this associated constant FIELD_OFFSETS
--> C:\Users\wuanz\dev\github.com\wuanzhuan\system_monitor\target\debug\build\sys_monitor-cd7b756010b34e61\out\main.rs:163:17
|
163 | # [derive (sp :: FieldOffsets , Default)] # [const_field_offset (sp :: const_field_offset)] # [repr (C)] # [pin] struct InnerColorSchemeSelector_261 {
| ^^^^^^^^^^^^^^^^^^ may need to be moved as well
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue rust-lang/rust#120363
= note: this warning originates in the derive macro sp::FieldOffsets (in Nightly builds, run with -Z macro-backtrace for more info)

@ogoffart
Copy link
Member

Thanks for filling an issue.

What version of Slint are you using?
I believe this is already fixed in the master branch.

@wuanzhuan
Copy link
Author

slint version is 1.6

@ogoffart
Copy link
Member

Actually, the warning comes from the const-field-offset crate, and it should have been fixed in the 0.5.1 version of it in commit aa7360a
Can you try to run cargo update and see if that helps?

@wuanzhuan
Copy link
Author

Have already been solved after cargo update. thanks

@ogoffart
Copy link
Member

(I believe all the warning were fixed as part of #4706 , so now i updated the Cargo.toml to make sure an old version can't be used)

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

No branches or pull requests

2 participants