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

usize() is parsed as the type usize #32995

Closed
bluss opened this issue Apr 15, 2016 · 3 comments
Closed

usize() is parsed as the type usize #32995

bluss opened this issue Apr 15, 2016 · 3 comments
Assignees
Labels
A-parser Area: The parsing of Rust source code to an AST.

Comments

@bluss
Copy link
Member

bluss commented Apr 15, 2016

This compiles, but it seems it should not:

let x: usize() = 1;
@bluss
Copy link
Member Author

bluss commented Apr 15, 2016

@ubsan pointed out that the origin is the Trait() syntax (for the no type parameters case).

@petrochenkov
Copy link
Contributor

This is syntactically correct (think about let a: Fn()), but the sanity check "parenthesized parameters may only be used with a trait" is missing for primitive types.

@strega-nil
Copy link
Contributor

This is equivalent to let x: usize<> = 1.

@steveklabnik steveklabnik added the A-parser Area: The parsing of Rust source code to an AST. label Jun 6, 2016
@petrochenkov petrochenkov self-assigned this Feb 19, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue May 15, 2017
…s-in-more-types, r=arielb1

Prohibit parenthesized params in more types.

Prohibit parenthesized parameters in primitive types, type parameters, `Self`, etc.

Fixes rust-lang#32995.
bors added a commit that referenced this issue May 16, 2017
…ypes, r=arielb1

Prohibit parenthesized params in more types.

Prohibit parenthesized parameters in primitive types, type parameters, `Self`, etc.

Fixes #32995.
bors added a commit that referenced this issue May 29, 2017
…ypes, r=arielb1

Prohibit parenthesized params in more types.

Prohibit parenthesized parameters in primitive types, type parameters, `Self`, etc.

Fixes #32995.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST.
Projects
None yet
Development

No branches or pull requests

4 participants