Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy unhappy with compiling 3.1.0 on Windows #166

Closed
FluffyGhoster opened this issue Mar 24, 2024 · 4 comments
Closed

Clippy unhappy with compiling 3.1.0 on Windows #166

FluffyGhoster opened this issue Mar 24, 2024 · 4 comments

Comments

@FluffyGhoster
Copy link
Contributor

I am trying to update our (Aurorastation) rust_g version from 2.1.0 (+ some customized additions) to 3.10 (keeping the customized additions we have)

It seems on windows, the compile for the windows platform fails with:

error: initializer for `thread_local` value can be made `const`
  --> src\pathfinder.rs:11:48
   |
11 | static NODES: RefCell<Vec<Option<Rc<Node>>>> = RefCell::new(Vec::new());
   |                                                ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(Vec::new()) }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
   = note: `-D clippy::thread-local-initializer-can-be-made-const` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::thread_local_initializer_can_be_made_const)]`
error: initializer for `thread_local` value can be made `const`
  --> src\redis_pubsub.rs:10:76
   |
10 |     static REQUEST_SENDER: RefCell<Option<flume::Sender<PubSubRequest>>> = RefCell::new(None);
   |                                                                            ^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(None) }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
error: initializer for `thread_local` value can be made `const`
  --> src\redis_pubsub.rs:11:82
   |
11 |     static RESPONSE_RECEIVER: RefCell<Option<flume::Receiver<PubSubResponse>>> = RefCell::new(None);
   |                                                                                  ^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(None) }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
error: initializer for `thread_local` value can be made `const`
 --> src\redis_reliablequeue.rs:7:52
  |
7 |     static REDIS_CLIENT: RefCell<Option<Client>> = RefCell::new(None);
  |                                                    ^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(None) }`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
error: file opened with `create`, but `truncate` behavior not defined
  --> src\unzip.rs:50:14
   |
50 |             .create(true)
   |              ^^^^^^^^^^^^- help: add: `.truncate(true)`
   |
   = help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
   = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
   = help: alternatively, use `.append(true)` to append to the file instead of overwriting it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
   = note: `-D clippy::suspicious-open-options` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::suspicious_open_options)]`

I have also ported over the change made in #165 but without luck; I do not know much if anything about rust, but seeing the same error also happening in #160 it seems Clippy doesn't like some core rust_g code, hence opening this bug report

If I am wrong on the above assumption, please, do feel free to close this and let me know that I did something wrong on my side

@optimumtact
Copy link
Member

what version of rust are you compiling with

@FluffyGhoster
Copy link
Contributor Author

what version of rust are you compiling with

The CI says "info: latest update on 2024-03-21, rust version 1.77.0 (aedd173a2 2024-03-17)"

@ZeWaka
Copy link
Contributor

ZeWaka commented Apr 15, 2024

i have fixed this in current master

@FluffyGhoster
Copy link
Contributor Author

Seems to be working now, thank you so much!

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

No branches or pull requests

3 participants