Skip to content

Conversation

@A6GibKm
Copy link
Contributor

@A6GibKm A6GibKm commented Feb 21, 2025

These were tested with https://gitlab.gnome.org/World/Rust/libadwaita-rs/-/merge_requests/94 and it solves the remaining issues. There are more changes that are likely needed. This would benefit from gtk-rs/gtk-rs-core#1663.

@sdroege
Copy link
Member

sdroege commented Feb 22, 2025

Does this continue to compile without warnings (and clippy lints) with 1.80?

@A6GibKm
Copy link
Contributor Author

A6GibKm commented Feb 22, 2025

Libadwaita-rs: Yes, gtk4-rs: Not even close.

@A6GibKm A6GibKm marked this pull request as draft February 22, 2025 11:36
@sdroege
Copy link
Member

sdroege commented Feb 22, 2025

Then we can't really merge this until we update our MSRV to 1.85

@sdroege
Copy link
Member

sdroege commented Dec 2, 2025

Then we can't really merge this until we update our MSRV to 1.85

That happened (1.86)

@A6GibKm A6GibKm force-pushed the rust-2024 branch 2 times, most recently from 5f7dcbc to 9862644 Compare December 2, 2025 12:41
@A6GibKm
Copy link
Contributor Author

A6GibKm commented Dec 2, 2025

I tested the current state against gtk4-rs and gtk-rs-core. They pass

cargo clippy --features=v4_20
cargo clippy --features=v2_84

respectively, when edition = 2021.

There was a warning:

error[E0308]: mismatched types
   --> glib/src/gstring.rs:154:37
    |
154 |                 end_ptr.offset_from(ptr as *const u8) as usize + 1,
    |                         ----------- ^^^^^^^^^^^^^^^^ expected `*const i8`, found `*const u8`
    |                         |
    |                         arguments to this method are incorrect
    |
    = note: expected raw pointer `*const i8`
               found raw pointer `*const u8`
note: method defined here
   --> /rustc/e4662966273ed58b51f9ff8d682accc202aa1210/library/core/src/ptr/const_ptr.rs:664:25

on manual code though.

When using edition 2024, gtk4-rs builds with warnings and gtk-rs-core throws enough warnings to fill the terminal and I cannot say whether they are all restricted to manual code.

When it comes to libadwaita-rs

cargo clippy --features=v1_8

passes with both editions with unrelated warnings.

@sdroege
Copy link
Member

sdroege commented Dec 2, 2025

In any case, I think we want to avoid requiring applications to use edition 2024. At least 2021 should also work for applications, ideally also 2018 still.

@A6GibKm
Copy link
Contributor Author

A6GibKm commented Dec 2, 2025

Applications can choose whichever edition they want. I have all my apps using 2024 atm. This just allows the bindings themselves to use this edition.

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 this pull request may close these issues.

2 participants