Commit Graph

13 Commits

Author SHA1 Message Date
Zack M. Davis
8d1cbb018e private no-mangle lints: help hint note if visibility modifier is pub
If the item is `pub`, one imagines users being confused as to why it's
not reachable/exported; a code suggestion is beyond our local knowledge
here, but we can at least offer a prose hint. (Thanks to Vadim
Petrochenkov for shooting down the present author's original bad idea
for the note text.)

While we're here, use proper HELP expectations instead of ad hoc
comments to communicate (and now, enforce) the expected suggestions in
test/ui/lint/suggestions.rs.
2018-06-30 22:48:05 -07:00
Zack M. Davis
53307473fd private no-mangle lints: issue suggestion for restricted visibility
This is probably quite a lot less likely to come up in practice than the
"inherited" (no visibility keyword) case, but now that we have
visibility spans in the HIR, we can do this, and it presumably doesn't
hurt to be exhaustive. (Who can say but that the attention to detail
just might knock someone's socks off, someday, somewhere?)

This is inspired by #47383.
2018-06-30 22:47:47 -07:00
Vadim Petrochenkov
fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Esteban Küber
d0bd090efb Consider all whitespace when preparing span 2018-01-26 14:24:17 -08:00
Esteban Küber
a8f77e12fc Include space in suggestion mut in bindings 2018-01-26 14:24:17 -08:00
Zack M. Davis
661e03383c in which the private no-mangle lints receive a valued lesson in humility
The incompetent fool who added these suggestions in 38e5a964f2 apparently
thought it was safe to assume that, because the offending function or
static was unreachable, it would therefore have not have any existing
visibility modifiers, making it safe for us to unconditionally suggest
inserting `pub`. This isn't true.

This resolves #47383.
2018-01-16 00:31:43 -08:00
Esteban Küber
e9f4fc8d40 Point at while true span instead of entire block 2017-12-19 15:48:46 -08:00
Esteban Küber
95a0458358 Resolve type on return type suggestion 2017-12-09 15:19:39 -08:00
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Vadim Petrochenkov
bf0cdb52f2 Add several lints into unused lint group
Remove a couple of obsolete lints
2017-10-29 22:14:23 +03:00
Zack M. Davis
8e6ed1203b bolster UI test converage for lint suggestions 2017-10-16 12:14:15 -07:00
Alex Crichton
4df1278c69 rustc: Remove used_mut_nodes from TyCtxt
This updates the borrowck query to return a result, and this result is then used
to incrementally check for unused mutable nodes given sets of all the used
mutable nodes.

Closes #42384
2017-10-14 09:29:02 -07:00
Zack M. Davis
e3b498971d code suggestions for unused-mut, while-true lints; UI test 2017-09-30 11:31:12 -07:00