-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
I'm seeing a regression in error spans for this use case:
use std::net::TcpListener;
use std::net::TcpStream;
use std::io::{self, Read, Write};
fn handle_client(stream: TcpStream) -> io::Result<()> {
stream.write_fmt(format!("message received"))
}
fn main() {
if let Ok(listener) = TcpListener::bind("127.0.0.1:8080") {
for incoming in listener.incoming() {
if let Ok(stream) = incoming {
handle_client(stream);
}
}
}
}
On 5-19-2016, the error span looks okay:
error: mismatched types [--explain E0308]
--> macro_errors_small.rs:7:22
7 |> stream.write_fmt(format!("message received"))
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String`
macro_errors_small.rs:7:22: 7:49: note: in this expansion of format! (defined in <std macros>)
note: expected type `std::fmt::Arguments<'_>`
note: found type `std::string::String`
On 5-20-2016, the error span became less helpful:
error: mismatched types [--explain E0308]
--> <std macros>:2:1
2 |> $ crate :: fmt :: format ( format_args ! ( $ ( $ arg ) * ) ) )
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String`
macro_errors_small.rs:7:22: 7:49: note: in this expansion of format! (defined in <std macros>)
note: expected type `std::fmt::Arguments<'_>`
note: found type `std::string::String`
It's possible it's related to #33683 (cc @nikomatsakis and @sanxiyn) but I haven't done the full bisect.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
jseyfried commentedon May 28, 2016
This was caused by #33712.
sophiajt commentedon Jun 22, 2016
Noticing the same issue with src/test/compile-fail/bad-format-args.rs
estebank commentedon Apr 20, 2017
Current output is back to what it was before:
nikomatsakis commentedon Apr 20, 2017
@estebank is there a regression test? if so, shall we close this issue?
Add test for issue 33884
Rollup merge of rust-lang#41435 - estebank:issue-33884, r=nikomatsakis
Rollup merge of rust-lang#41435 - estebank:issue-33884, r=nikomatsakis
Rollup merge of rust-lang#41435 - estebank:issue-33884, r=nikomatsakis
Rollup merge of rust-lang#41435 - estebank:issue-33884, r=nikomatsakis