File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //! Parser precedence test to help with [RFC 87 "Trait Bounds with Plus"][rfc-87], to check the
2
+ //! precedence of the `as` operator in relation to some arithmetic bin-ops and parentheses.
3
+ //!
4
+ //! Editor's note: this test seems quite incomplete compared to what's possible nowadays. Maybe
5
+ //! there's another set of tests whose coverage overshadows this test?
6
+ //!
7
+ //! [rfc-87]: https://rust-lang.github.io/rfcs/0087-trait-bounds-with-plus.html
8
+
9
+ //@ run-pass
10
+
11
+ #[ allow( unused_parens) ]
12
+ fn main ( ) {
13
+ assert_eq ! ( 3 as usize * 3 , 9 ) ;
14
+ assert_eq ! ( 3 as ( usize ) * 3 , 9 ) ;
15
+ assert_eq ! ( 3 as ( usize ) / 3 , 1 ) ;
16
+ assert_eq ! ( 3 as usize + 3 , 6 ) ;
17
+ assert_eq ! ( 3 as ( usize ) + 3 , 6 ) ;
18
+ }
You can’t perform that action at this time.
0 commit comments