diff options
| author | Zack M. Davis <code@zackmdavis.net> | 2019-06-08 21:35:02 -0700 |
|---|---|---|
| committer | Zack M. Davis <code@zackmdavis.net> | 2019-06-14 00:01:59 -0700 |
| commit | 7a3184a04c4023d9ab93fe793c0d0ffb5e91240b (patch) | |
| tree | 797ab400ebf021bb4a71cc9a5e96875b94fc130f /src/test/ui/thinlto | |
| parent | cdd743755adef8eb27410a9f4e480d3cf74abeaf (diff) | |
| download | rust-7a3184a04c4023d9ab93fe793c0d0ffb5e91240b.tar.gz rust-7a3184a04c4023d9ab93fe793c0d0ffb5e91240b.zip | |
in which we decline to suggest the anonymous lifetime in declarations
The elided-lifetimes-in-path lint (part of our suite of Rust 2018 idiom lints which we are hoping to promote to Warn status) was firing with an illegal suggestion to write an anonymous lifetime in a struct/item declaration (where we don't allow it). The linting code was already deciding whether to act on the basis of a `ParamMode` enum, indicating whether the present path-segment was part of an expression, or anywhere else. The present case seemed to be part of the "anywhere else", and yet meriting different rules as far as the lint was concerned, so it seemed expedient to introduce a new enum member. We yank out a `TyKind::Path` arm into its own method so that we can call it with our new `ParamMode` specifically when lowering struct fields. (The alternative strategy of changing the signature of `lower_ty` to take a `ParamMode` would be inelegant given that most of the `TyKind` match arm bodies therein don't concern themselves with `ParamMode`.) Resolves #61124.
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions
