-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account for removal of multiline span in suggestion
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix #134485.
- Loading branch information
Showing
3 changed files
with
608 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Make sure suggestion for removal of a span that covers multiple lines is properly highlighted. | ||
//@ compile-flags: --error-format=human --color=always | ||
//@ edition:2018 | ||
//@ ignore-tidy-tab | ||
use std::collections::{HashMap, HashSet}; | ||
fn foo() -> Vec<(bool, HashSet<u8>)> { | ||
let mut hm = HashMap::<bool, Vec<HashSet<u8>>>::new(); | ||
hm.into_iter() | ||
.map(|(is_true, ts)| { | ||
ts.into_iter() | ||
.map(|t| { | ||
( | ||
is_true, | ||
t, | ||
) | ||
}).flatten() | ||
}) | ||
.flatten() | ||
.collect() | ||
} | ||
fn bar() -> Vec<(bool, HashSet<u8>)> { | ||
let mut hm = HashMap::<bool, Vec<HashSet<u8>>>::new(); | ||
hm.into_iter() | ||
.map(|(is_true, ts)| { | ||
ts.into_iter() | ||
.map(|t| (is_true, t)) | ||
.flatten() | ||
}) | ||
.flatten() | ||
.collect() | ||
} | ||
fn baz() -> Vec<(bool, HashSet<u8>)> { | ||
let mut hm = HashMap::<bool, Vec<HashSet<u8>>>::new(); | ||
hm.into_iter() | ||
.map(|(is_true, ts)| { | ||
ts.into_iter().map(|t| { | ||
(is_true, t) | ||
}).flatten() | ||
}) | ||
.flatten() | ||
.collect() | ||
} | ||
fn bay() -> Vec<(bool, HashSet<u8>)> { | ||
let mut hm = HashMap::<bool, Vec<HashSet<u8>>>::new(); | ||
hm.into_iter() | ||
.map(|(is_true, ts)| { | ||
ts.into_iter() | ||
.map(|t| (is_true, t)).flatten() | ||
}) | ||
.flatten() | ||
.collect() | ||
} | ||
fn main() {} |
Oops, something went wrong.