]> git.lizzy.rs Git - rust.git/commit
in which the elided-lifetimes-in-paths lint undergoes a revolution
authorZack M. Davis <code@zackmdavis.net>
Tue, 17 Jul 2018 07:30:53 +0000 (00:30 -0700)
committerZack M. Davis <code@zackmdavis.net>
Sun, 22 Jul 2018 15:27:10 +0000 (08:27 -0700)
commit41d5c0ce1fb4618c98b3ed07d657bdedfc98c959
tree7908ae6288a14e2e98f812e0514435cc2e047721
parentd3b3bc57670ab91a53b2100cf3dfe78947bfe077
in which the elided-lifetimes-in-paths lint undergoes a revolution

The existing elided-lifetimes-in-paths lint (introduced in Nov. 2017's
accd997b5 / #46254) lacked stuctured suggestions and—much more
alarmingly—produced false positives on associated functions (like
`Ref::clone`) and on anonymous '_ lifetimes (!!—yes, the very
anonymous lifetimes that we meant to suggest "instead"). That this
went apparently unnoticed for so long maybe tells you something about
how many people actually bother to flip on allow-by-default lints.

After many hours of good old-fashioned American elbow grease—and a
little help from expert reviewers—it turns out that getting the right
answer is a lot easier if we fire the lint while lowering the Higher
Intermediate Representation.

The lint is promoted to the idioms-2018 group.

Also, in the matter of test filenames, "elided" only has one 'l' (see,
e.g., https://en.wiktionary.org/wiki/elide).

Resolves #52041.
src/librustc/hir/lowering.rs
src/librustc/lint/builtin.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc_lint/lib.rs
src/test/ui/in-band-lifetimes/elided-lifetimes.fixed [new file with mode: 0644]
src/test/ui/in-band-lifetimes/elided-lifetimes.rs [new file with mode: 0644]
src/test/ui/in-band-lifetimes/elided-lifetimes.stderr [new file with mode: 0644]
src/test/ui/in-band-lifetimes/ellided-lifetimes.rs [deleted file]
src/test/ui/in-band-lifetimes/ellided-lifetimes.stderr [deleted file]