Skip to content

fix: remove forbidden #[must_use] on trait impls for Rust 2026 toolchain#71

Merged
yegor256 merged 6 commits into
yegor256:masterfrom
Gaotax2006:master
May 12, 2026
Merged

fix: remove forbidden #[must_use] on trait impls for Rust 2026 toolchain#71
yegor256 merged 6 commits into
yegor256:masterfrom
Gaotax2006:master

Conversation

@Gaotax2006
Copy link
Copy Markdown
Contributor

Saw the build was broken on current master due to newer rustc promoting these to hard errors with #![deny(warnings)].

Changes:

  1. Removed #[must_use] from 4 trait-impl methods (Clone::clone, Default::default, Iterator::next ×2) — this attribute is no longer permitted on trait implementations in recent Rust editions
  2. Fixed elided lifetime in Stack::iter(&self) -> Iter<V,N>Iter<'_, V, N>

Baseline now compiles cleanly with cargo test --all-features on rustc 1.94.1.

@Gaotax2006
Copy link
Copy Markdown
Contributor Author

CI is all green. This PR fixes 3 Rust compilation errors () that occur with the latest stable Rust toolchain. The change is minimal: adding lifetime annotations in 3 places.

Would appreciate a review when you get a chance.

Gaotax2006 and others added 2 commits May 12, 2026 00:48
Co-authored-by: Gaotax2006 <gaotax2006@users.noreply.github.com>
@yegor256
Copy link
Copy Markdown
Owner

@Gaotax2006 what README.txt is for?

@Gaotax2006
Copy link
Copy Markdown
Contributor Author

@yegor256 Sorry about that — the README.txt and VERSION.txt were accidentally included from another experiment. I have removed them from the branch. The PR now only contains the Formatter lifetime annotations.

@yegor256 yegor256 merged commit 319e4ec into yegor256:master May 12, 2026
3 checks passed
@yegor256
Copy link
Copy Markdown
Owner

@Gaotax2006 thanks!

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