]> git.lizzy.rs Git - rust.git/commit
in which the trivial-casts word to the wise is tucked into a help note
authorZack M. Davis <code@zackmdavis.net>
Sat, 23 Jun 2018 23:57:23 +0000 (16:57 -0700)
committerZack M. Davis <code@zackmdavis.net>
Sun, 24 Jun 2018 05:57:37 +0000 (22:57 -0700)
commit0b39a82cf49bc376e568560e4f97360f477255d4
treec0c236f114ac1bcbf55b099a33eec403feb39d56
parenta417518173bae739d1aef50c6cf1a1e3bd4c4319
in which the trivial-casts word to the wise is tucked into a help note

The top level message shouldn't be too long; the
replaced-by-coercion/temporary-variable advice can live in a note. Also,
don't mention type ascription when it's not actually available as a real
thing. (The current state of discussion on the type ascription tracking
issue #23416 makes one rather suspect it will never be a stable thing in
its current form, but that's not for us to adjudicate in this commit.)

While we're here, yank out the differentiating parts of the
numeric/other conditional and only have one codepath emitting the
diagnostic.
src/librustc_typeck/check/cast.rs
src/test/ui/lint/trivial-casts-featuring-type-ascription.rs [new file with mode: 0644]
src/test/ui/lint/trivial-casts-featuring-type-ascription.stderr [new file with mode: 0644]
src/test/ui/lint/trivial-casts.rs [new file with mode: 0644]
src/test/ui/lint/trivial-casts.stderr [new file with mode: 0644]