Closed
Description
Compiling sfackler/rust-postgres@1fa5941 comes up with this on the current nightly, but not yesterday's:
<std macros>:4:35: 4:50 error: type `&mut [_]` does not implement any method in scope named `write_fmt`
<std macros>:4 format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
^~~~~~~~~~~~~~~
<std macros>:4:35: 4:50 error: type `&mut [u8]` does not implement any method in scope named `write_fmt`
<std macros>:4 format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
^~~~~~~~~~~~~~~
<std macros>:4:35: 4:50 error: type `&mut [_]` does not implement any method in scope named `write_fmt`
<std macros>:4 format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
^~~~~~~~~~~~~~~
<std macros>:4:35: 4:50 error: type `&mut [u8]` does not implement any method in scope named `write_fmt`
<std macros>:4 format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
^~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
It's also a bit weird/concerning that there are no expansion traces.
Activity
sfackler commentedon Nov 20, 2014
After building the
--pretty expanded
version, thewrite!
calls in this function are the ones generating the errors: https://github.com/sfackler/rust-postgres/blob/1fa5941562739104d4a5fc39826f6ab7d27eb210/src/lib.rs#L518-L543japaric commentedon Nov 20, 2014
Just a hunch but this may be related to #19153 and #19142. Namely that
write!(f)
ICEs, and must be change towrite!(&mut f)
, probably in your casef
has type&mut [_]
alexcrichton commentedon Nov 20, 2014
What may be happening here is that you're calling
write!(vec, ...)
when it should bewrite!(&mut vec, ..)
which could mean that the compiler is deref'ing vec to a slice and not finding thewrite_fmt
method.sfackler commentedon Nov 20, 2014
Yep, that appears to have fixed it. Is the lack of expansion traces a known issue as well?
sfackler commentedon Nov 20, 2014
@alexcrichton This line in
write!
appears to be the culprit. Why does it exist?alexcrichton commentedon Nov 20, 2014
The purpose of the
write!
macro was to take a&mut Writer
object at the front as opposed just any plain oldWriter
. It emphasizes that the macro is not consuming the sink and explains why it must be declared mutable locally.write!
macro hangs rustc for 1 minute and then SIGILLs (OOM) #19163Merge pull request rust-lang#19155 from ShoyuVanilla/migrate-missing-…