// mapping to Result on Result
let _: Result<_, &str> = (Ok(Ok(1))).and_then(|x| x);
+
+ issue8734();
+ issue8878();
+}
+
+fn issue8734() {
+ // let _ = [0u8, 1, 2, 3]
+ // .into_iter()
+ // .map(|n| match n {
+ // 1 => [n
+ // .saturating_add(1)
+ // .saturating_add(1)
+ // .saturating_add(1)
+ // .saturating_add(1)
+ // .saturating_add(1)
+ // .saturating_add(1)
+ // .saturating_add(1)
+ // .saturating_add(1)],
+ // n => [n],
+ // })
+ // .flatten();
+}
+
+#[allow(clippy::bind_instead_of_map)] // map + flatten will be suggested to `and_then`, but afterwards `map` is suggested again
+#[rustfmt::skip] // whitespace is important for this one
+fn issue8878() {
+ std::collections::HashMap::<u32, u32>::new()
+ .get(&0)
+ .and_then(|_| {
+// we need some newlines
+// so that the span is big enough
+// we need some newlines
+// so that the span is big enough
+// for a splitted output of the diagnostic
+ Some("")
+ // whitespace beforehand is important as well
+ });
}