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

test(rustfix): switch to a simpler case for dedup-suggestions #14765

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
test(rustfix): switch to a simpler case for dedup-suggestions
This case also emits an insert-only suggestions (span start == end),
and doesn't rely on any lint behavior.

See also

* #13728
* #13027
  • Loading branch information
weihanglo committed Nov 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8aec0a40f579141c898eddb4b6575728d75550fc
16 changes: 5 additions & 11 deletions crates/rustfix/tests/everything/dedup-suggestions.fixed.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
// This fixes rust-lang/rust#123304.
// If that lint stops emitting duplicate suggestions,
// we might need to find a substitution.
#![warn(unsafe_op_in_unsafe_fn)]

// See <https://github.com/rust-lang/cargo/issues/13027>
macro_rules! foo {
($x:ident) => {
pub unsafe fn $x() { unsafe {
let _ = String::new().as_mut_vec();
}}
() => {
let _ = &1;
};
}

fn main() {
foo!(a);
foo!(b);
foo!();
foo!();
}
Loading