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

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

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

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Dec 23, 2017

CAD97 added a commit to nafi-lang/rust-nafi that referenced this issue Dec 24, 2017

Work around nightly lint bug
rust-lang/rust#46959

#[deny(bad_style)]
-> impl Trait

`impl Trait` should be camel case `Impl Trait`

bors added a commit that referenced this issue Jan 4, 2018

Auto merge of #47132 - cramertj:impl-trait-camel-case, r=nikomatsakis
Limit style lint to non-synthetic generic params

Fix #46959

r? @nikomatsakis

@bors bors closed this in #47132 Jan 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment