We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
as-precedence.rs
1 parent 4652b14 commit 56efa0aCopy full SHA for 56efa0a
tests/ui/as-precedence.rs
tests/ui/parser/as-precedence.rs
@@ -0,0 +1,18 @@
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
+}
0 commit comments