Skip to content

Fix warnings - #431

Open
zachs18 wants to merge 2 commits into
servo:v2from
zachs18:fix-warnings
Open

Fix warnings#431
zachs18 wants to merge 2 commits into
servo:v2from
zachs18:fix-warnings

Conversation

@zachs18

@zachs18 zachs18 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Fixes unused_unsafe warnings on Rust >=1.92.0 by adding #[allow]s since the relevant code is not safe in the MSRV 1.83.0 declared in Cargo.toml (this could also be fixed by bumping MSRV to 1.92.0 and removing the unsafe blocks).

Fixes specialization syntax future-compatibility-warnings by moving the spec_traits module to a file (cc #427 ).

@alejandro-vaz alejandro-vaz mentioned this pull request Aug 21, 2026
1 task
@alejandro-vaz

alejandro-vaz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

for now I think we'll keep MSRV at 1.83, we might increase it in the future

you could implement the whole #427 modularization in this PR if you want

or open it on another

we can't fully merge modularization until we have #387 merged (I haven't reviewed it yet)

Comment thread src/spec_traits.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the clear API boundary here is not spec_traits.rs, I'd honestly say it is:

  • specialization.rs
  • with all the methods that involve specialization
  • lib.rs with a conditional compilation flag that includes specialization.rs only when the feature is enabled
  • the normal methods on SmallVec on lib.rs that also have specialization have a conditional compilation flag of feature disabled

Comment thread src/lib.rs
(unsafe {&raw const self.inline}) as *mut T
// pointer to it. reading it would be UB potentially, but for that downstream
// unsafe is required. This is no longer unsafe as of Rust 1.92.0.
#[allow(unused_unsafe, reason = "requires unsafe in MSRV 1.83.0")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is gold

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