mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-30 00:03:49 +00:00

The `println!();` statement's span doesn't include the `;`, and the modified suggestions where trying to get the `;` by getting the differenece between the statement's and the expression's spans, which was an empty suggestion. Fix #133833, fix #133834.
27 lines
747 B
Rust
27 lines
747 B
Rust
//! Regression test for suggestions that were fired on empty spans
|
|
//! involving macro-call statements. For some reason the semicolon
|
|
//! is not included in the overall span of the macro-call statement.
|
|
//!
|
|
//! Issue 1: <https://github.com/rust-lang/rust/issues/133833>.
|
|
//! Issue 2: <https://github.com/rust-lang/rust/issues/133834>.
|
|
//! See also: <https://github.com/rust-lang/rust/issues/133845>.
|
|
|
|
fn foo() -> String {
|
|
let mut list = {
|
|
println!();
|
|
};
|
|
list //~ ERROR mismatched types
|
|
}
|
|
|
|
fn bar() {
|
|
String::new()
|
|
.chars()
|
|
.filter(|x| !x.is_whitespace())
|
|
.map(|x| {
|
|
println!("Child spawned with the size: {}", x);
|
|
})
|
|
.collect::<String>(); //~ ERROR E0277
|
|
}
|
|
|
|
fn main() {}
|