]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #55663 - varkor:must_use-traits, r=estebank
authorbors <bors@rust-lang.org>
Tue, 20 Nov 2018 15:15:53 +0000 (15:15 +0000)
committerbors <bors@rust-lang.org>
Tue, 20 Nov 2018 15:15:53 +0000 (15:15 +0000)
Allow #[must_use] on traits

Addresses https://github.com/rust-lang/rust/issues/55506, but we'll probably want to add it to some library traits like `Iterator` before the issue is considered fixed. Fixes https://github.com/rust-lang/rust/issues/51560.

`#[must_use]` is already permitted on traits, with no effect, so this seems like a bug fix, but I might be overlooking something. This currently warns for `impl Trait` or `dyn Trait` when the `Trait` is `#[must_use]` (although I don't think the latter is currently possible, so it's simply future-proofed).


Trivial merge