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

Generic parameters VS less then comparison parsing ambiguity #33078

Closed
matklad opened this issue Apr 18, 2016 · 2 comments
Closed

Generic parameters VS less then comparison parsing ambiguity #33078

matklad opened this issue Apr 18, 2016 · 2 comments

Comments

@matklad
Copy link
Member

matklad commented Apr 18, 2016

The following

fn main() {
    let _ = 1 as i32 < 1;
}

produces a parse error, because the parser expects type parameters after i32, like in 1 as i32<T>. Is this intentional? Looks like there are no tests for this behavior:

user@UNIT-326 [07:47:36 PM] [~/projects/rust/src/test] [master *]
-> % grep "as \\w* <" -R .              
./run-pass/type-macros-hlist.rs:                  < Expr ! ( HList ! [ $ ( $ LHS ) * ] ) as Add < Expr ! (
./run-pass/type-macros-hlist.rs:                  < Expr ! ( $ LHS ) as Add < Expr ! ( $ ( $ RHS ) + ) >> ::

1 as i32 <= 1 and 1 as i32 > 1 are parsed successfully. 1 as i32 << 1 also fails.
`

matklad added a commit to intellij-rust/intellij-rust that referenced this issue Apr 18, 2016
@pmarcelll
Copy link
Contributor

It's a known issue: #22644

@nagisa
Copy link
Member

nagisa commented Apr 18, 2016

What @pmarcelll said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants