Skip to content

Commit 56efa0a

Browse files
committed
Adjust as-precedence.rs
- Document `as-precedence.rs` - Move `as-precedence.rs` under `tests/ui/parser/`
1 parent 4652b14 commit 56efa0a

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

Diff for: tests/ui/as-precedence.rs

-10
This file was deleted.

Diff for: tests/ui/parser/as-precedence.rs

+18
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)