diff --git a/src/chains.rs b/src/chains.rs index 45d9d488c76..dd826734db4 100644 --- a/src/chains.rs +++ b/src/chains.rs @@ -458,9 +458,7 @@ impl Chain { } while let Some(chain_item) = iter.next() { let comment_snippet = context.snippet(chain_item.span); - // FIXME: Figure out the way to get a correct span when converting `try!` to `?`. - let handle_comment = - !(context.config.use_try_shorthand() || is_tries(comment_snippet.trim())); + let handle_comment = !is_tries(comment_snippet.trim()); // Pre-comment if handle_comment { diff --git a/tests/source/chains.rs b/tests/source/chains.rs index c77f5bac4cb..a16712e5be1 100644 --- a/tests/source/chains.rs +++ b/tests/source/chains.rs @@ -264,3 +264,9 @@ fn issue_3034() { disallowed_headers.iter().any(|header| *header == name) || disallowed_header_prefixes.iter().any(|prefix| name.starts_with(prefix)) } + +fn issue_6121() { + let _ = foo // some comment + .bar // some other comment + .buz; +} diff --git a/tests/target/chains.rs b/tests/target/chains.rs index 292da298195..4fc23745126 100644 --- a/tests/target/chains.rs +++ b/tests/target/chains.rs @@ -304,3 +304,9 @@ fn issue_3034() { disallowed_headers.iter().any(|header| *header == name) || disallowed_header_prefixes.iter().any(|prefix| name.starts_with(prefix)) } + +fn issue_6121() { + let _ = foo // some comment + .bar // some other comment + .buz; +}