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

Bump to Rust 1.73.0 #18870

Closed
jszwedko opened this issue Oct 17, 2023 · 3 comments
Closed

Bump to Rust 1.73.0 #18870

jszwedko opened this issue Oct 17, 2023 · 3 comments
Labels
domain: deps Anything related to Vector's dependencies

Comments

@jszwedko
Copy link
Member

https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html

@jszwedko jszwedko added the domain: deps Anything related to Vector's dependencies label Oct 17, 2023
@aanderse
Copy link
Contributor

aanderse commented Nov 7, 2023

i built vector with rust version 1.73.0 and ran into this failure:

error: call to `.clone()` on a reference in this situation does nothing
   --> src/convert_config.rs:160:93
    |
160 |                       .unwrap_or_else(|| panic!("Failed to get file_name for {entry_path:?}"))
    |  _____________________________________________________________________________________________^
161 | |                     .clone();
    | |____________________________^ help: remove this redundant call
    |
    = note: the type `std::ffi::OsStr` does not implement `Clone`, so calling `clone` on `&std::ffi::OsStr` copies the reference, which does not do anything and can be removed
note: the lint level is defined here
   --> src/lib.rs:7:9
    |
7   | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(noop_method_call)]` implied by `#[deny(warnings)]`

error: could not compile `vector` (lib) due to previous error

i'm not a rust guy so i defer to the experts... could this issue be caused by a change in rust from 1.72 to 1.73?

any and all help is greatly appreciated 🙇‍♂️

@StephenWakely
Copy link
Contributor

any and all help is greatly appreciated 🙇‍♂️

That is technically just a warning telling us that the call to clone the entry_path is unnecessary. It looks like the rust compiler got a little smarter and can now detect this.

This can be fixed by just removing the .clone() call.

                let last_component = entry_path
                    .file_name()
                    .unwrap_or_else(|| panic!("Failed to get file_name for {entry_path:?}"));
-                   .clone();

@dsmith3197
Copy link
Contributor

#19518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: deps Anything related to Vector's dependencies
Projects
None yet
Development

No branches or pull requests

4 participants