Landing: be9834cd7b36
Project / Subsystem
gcc / gccrs
Date
2026-06-27
Author
Lucas Ly Ba
Commit
be9834cd7b368c924c68eddf8dcb10b83422d662
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gccrs
- patch_id
- —
- commit_hash
- be9834cd7b368c924c68eddf8dcb10b83422d662
- source_type
- github
- headline
- gccrs: Warn about redundant 'Drop' bounds on generic parameters
- tldr
- gccrs now warns developers if a generic parameter is explicitly bound to `Drop`, as this is usually a mistake.
- author
- Lucas Ly Ba
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gccrs
- • lint
- • generics
- • rust
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-27T00:00:00.000Z
A new lint has been added to gccrs that warns developers when a generic parameter is given an explicit Drop bound. In Rust, the Drop trait is implicitly handled for types that need cleanup, and explicitly adding it as a bound to a generic parameter typically does not provide any useful constraint and is often a sign of a misunderstanding. This warning helps catch potential errors early in the development process.