summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/unused/issue-88519-unused-paren.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/lint/unused/issue-88519-unused-paren.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/lint/unused/issue-88519-unused-paren.rs')
-rw-r--r--src/test/ui/lint/unused/issue-88519-unused-paren.rs85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/test/ui/lint/unused/issue-88519-unused-paren.rs b/src/test/ui/lint/unused/issue-88519-unused-paren.rs
deleted file mode 100644
index ce3d15ac1..000000000
--- a/src/test/ui/lint/unused/issue-88519-unused-paren.rs
+++ /dev/null
@@ -1,85 +0,0 @@
-// check-pass
-// Make sure unused parens lint doesn't emit a false positive.
-// See https://github.com/rust-lang/rust/issues/88519
-#![deny(unused_parens)]
-#![feature(type_ascription)]
-
-// binary ops are tested in issue-71290-unused-paren-binop.rs
-
-mod call {
- fn noop() -> u8 { 0 }
- fn outside() -> u8 {
- ({ noop })()
- }
- fn inside() -> u8 {
- ({ noop }())
- }
- fn outside_match() -> u8 {
- (match noop { x => x })()
- }
- fn inside_match() -> u8 {
- (match noop { x => x }())
- }
- fn outside_if() -> u8 {
- (if false { noop } else { noop })()
- }
- fn inside_if() -> u8 {
- (if false { noop } else { noop }())
- }
-}
-
-mod casts {
- fn outside() -> u8 {
- ({ 0 }) as u8
- }
- fn inside() -> u8 {
- ({ 0 } as u8)
- }
- fn outside_match() -> u8 {
- (match 0 { x => x }) as u8
- }
- fn inside_match() -> u8 {
- (match 0 { x => x } as u8)
- }
- fn outside_if() -> u8 {
- (if false { 0 } else { 0 }) as u8
- }
- fn inside_if() -> u8 {
- (if false { 0 } else { 0 } as u8)
- }
-}
-
-mod typeascription {
- fn outside() -> u8 {
- type_ascribe!(({ 0 }), u8)
- }
- fn outside_match() -> u8 {
- type_ascribe!((match 0 { x => x }), u8)
- }
- fn outside_if() -> u8 {
- type_ascribe!((if false { 0 } else { 0 }), u8)
- }
-}
-
-mod index {
- fn outside(x: &[u8]) -> u8 {
- ({ x })[0]
- }
- fn inside(x: &[u8]) -> u8 {
- ({ x }[0])
- }
- fn outside_match(x: &[u8]) -> u8 {
- (match x { x => x })[0]
- }
- fn inside_match(x: &[u8]) -> u8 {
- (match x { x => x }[0])
- }
- fn outside_if(x: &[u8]) -> u8 {
- (if false { x } else { x })[0]
- }
- fn inside_if(x: &[u8]) -> u8 {
- (if false { x } else { x }[0])
- }
-}
-
-fn main() {}