Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Universal impl trait shows camel case name warning #46959

Closed
vi opened this issue Dec 23, 2017 · 2 comments
Closed

Universal impl trait shows camel case name warning #46959

vi opened this issue Dec 23, 2017 · 2 comments
Labels
A-impl-trait Area: impl Trait. Universally / existentially quantified anonymous types with static dispatch. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug.

Comments

@vi
Copy link
Contributor

vi commented Dec 23, 2017

#![feature(universal_impl_trait)]
#![feature(conservative_impl_trait)]
 
fn qqq(lol: impl Iterator<Item=u32>) -> impl Iterator<Item=u64> {
    lol.map(|x|x as u64)
}
warning: type parameter `impl Iterator<Item = u32>` should have a camel case name such as `Impl iterator<item = u32>`
@cramertj
Copy link
Member

cramertj commented Dec 23, 2017

impl Trait in argument position now desugars to explicit type parameters at the HIR level. There are two possible fixes for this: specifically ignore impl xxx params, or move the NonCamelCaseTypes lint to run on the AST (an EarlyLintPass instead of a LateLintPass).

I'm working on this.

cc @nikomatsakis

@kennytm kennytm added A-impl-trait Area: impl Trait. Universally / existentially quantified anonymous types with static dispatch. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. labels Dec 23, 2017
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Dec 23, 2017 via email

bors added a commit that referenced this issue Jan 4, 2018
Limit style lint to non-synthetic generic params

Fix #46959

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: impl Trait. Universally / existentially quantified anonymous types with static dispatch. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants