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

Fix new clippy lints introduced in Rust 1.58 #1170

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arrow/src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ impl std::ops::Deref for Buffer {
}

unsafe impl Sync for Buffer {}
#[allow(clippy::non_send_fields_in_send_ty)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unsafe marker for Buffer worries me (perhaps related to the FFI deallocator?) -- I will file a ticket to look into it in more detail

In the interim, this code is no more sound/unsound than it was prior to clippy noticing this problem, so I think it would be ok to merge this PR in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found some discussion about this false positive, related to NonNull (which we use in Bytes), at rust-lang/rust-clippy#8045. For now disabling the warning here sounds good.

unsafe impl Send for Buffer {}

impl From<MutableBuffer> for Buffer {
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/util/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn get_data_dir(udf_env: &str, submodule_data: &str) -> Result<PathBuf, Box<dyn
"env `{}` is undefined or has empty value, and the pre-defined data dir `{}` not found\n\
HINT: try running `git submodule update --init`",
udf_env,
pb.display().to_string(),
pb.display(),
).into())
}
}
Expand Down
4 changes: 2 additions & 2 deletions parquet/src/schema/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fn print_logical_and_converted(
None => {
// Also print converted type if it is available
match converted_type {
ConvertedType::NONE => format!(""),
ConvertedType::NONE => String::new(),
decimal @ ConvertedType::DECIMAL => {
// For decimal type we should print precision and scale if they
// are > 0, e.g. DECIMAL(9,2) -
Expand All @@ -256,7 +256,7 @@ fn print_logical_and_converted(
format!("({},{})", p, s)
}
(p, 0) if p > 0 => format!("({})", p),
_ => format!(""),
_ => String::new(),
};
format!("{}{}", decimal, precision_scale)
}
Expand Down