Commit 0179bf3b79

0179bf3b7981b27b6baf6c1745006ac630ef0cc9

parent: 618b603707

Unregistered key

Austin Ray <austin@austinray.io> · 2021-04-04 22:16 UTC

fix: remove #[used] from non-static fields

Rust 1.51 has a regression restricting the `#[used]` attribute[0] to
static fields. As such, it's not possible to build `weechat-matrix-rs`
on stable or nightly Rust. According to the `#[used]` RFC[1], the
attribute is for static variables so it's unclear if the new behavior is
the correct one.

However, to prevent clippy from complaining during CI, replace with
`#[allow(dead_code)]`

[0] https://github.com/rust-lang/rust/issues/82668
[1] https://rust-lang.github.io/rfcs/2386-used.html

Layout: unified · split

src/bar_items/mod.rs +3 −3
@@ -10,11 +10,11 @@ use buffer_plugin::BufferPlugin;
1010use status::Status;
1111
1212pub struct BarItems {
13 #[used]
13 #[allow(dead_code)]
1414 status: BarItem,
15 #[used]
15 #[allow(dead_code)]
1616 buffer_name: BarItem,
17 #[used]
17 #[allow(dead_code)]
1818 buffer_plugin: BarItem,
1919}
2020
src/completions.rs +1 −1
@@ -11,7 +11,7 @@ use weechat::{
1111use crate::Servers;
1212
1313pub struct Completions {
14 #[used]
14 #[allow(dead_code)]
1515 servers: CompletionHook,
1616}
1717
src/lib.rs +4 −5
@@ -150,15 +150,14 @@ impl SignalCallback for Servers {
150150
151151struct Matrix {
152152 servers: Servers,
153 #[used]
153 #[allow(dead_code)]
154154 commands: Commands,
155 #[used]
156155 config: ConfigHandle,
157 #[used]
156 #[allow(dead_code)]
158157 bar_items: BarItems,
159 #[used]
158 #[allow(dead_code)]
160159 typing_notice_signal: SignalHook,
161 #[used]
160 #[allow(dead_code)]
162161 completions: Completions,
163162 debug_buffer: RefCell<Option<BufferHandle>>,
164163}