Skip to content

Commit edafbaf

Browse files
committed
Adjust UI tests for unit_bindings
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
1 parent 37998ab commit edafbaf

File tree

61 files changed

+117
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+117
-117
lines changed

tests/ui/assign-assign.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn test_assign() {
66
let y: () = x = 10;
77
assert_eq!(x, 10);
88
assert_eq!(y, ());
9-
let mut z = x = 11;
9+
let mut z: () = x = 11;
1010
assert_eq!(x, 11);
1111
assert_eq!(z, ());
1212
z = x = 12;
@@ -19,7 +19,7 @@ fn test_assign_op() {
1919
let y: () = x += 10;
2020
assert_eq!(x, 10);
2121
assert_eq!(y, ());
22-
let mut z = x += 11;
22+
let mut z: () = x += 11;
2323
assert_eq!(x, 21);
2424
assert_eq!(z, ());
2525
z = x += 12;

tests/ui/associated-type-bounds/dyn-impl-trait-type.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ fn def_et4() -> Et4 {
5959
pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
6060

6161
fn main() {
62-
let _ = use_et1();
63-
let _ = use_et2();
64-
let _ = use_et3();
65-
let _ = use_et4();
62+
use_et1();
63+
use_et2();
64+
use_et3();
65+
use_et4();
6666
}

tests/ui/associated-type-bounds/dyn-rpit-and-let.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ fn def_et4() -> Box<dyn Tr1<As1: for<'a> Tr2<'a>>> {
6666
pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
6767

6868
fn main() {
69-
let _ = use_et1();
70-
let _ = use_et2();
71-
let _ = use_et3();
72-
let _ = use_et4();
69+
use_et1();
70+
use_et2();
71+
use_et3();
72+
use_et4();
7373
}

tests/ui/associated-type-bounds/rpit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ fn def_et4() -> impl Tr1<As1: for<'a> Tr2<'a>> {
5757
pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
5858

5959
fn main() {
60-
let _ = use_et1();
61-
let _ = use_et2();
62-
let _ = use_et3();
63-
let _ = use_et4();
60+
use_et1();
61+
use_et2();
62+
use_et3();
63+
use_et4();
6464
}

tests/ui/associated-type-bounds/trait-alias-impl-trait.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ pub fn use_et4() {
8989
}
9090

9191
fn main() {
92-
let _ = use_et1();
93-
let _ = use_et2();
94-
let _ = use_et3();
95-
let _ = use_et4();
92+
use_et1();
93+
use_et2();
94+
use_et3();
95+
use_et4();
9696
}

tests/ui/associated-types/normalization-debruijn-3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
use std::future::{Future, Ready};
88
async fn read() {
9-
let _ = connect(&()).await;
9+
connect(&()).await;
1010
}
1111
async fn connect<A: ToSocketAddr>(addr: A) {
12-
let _ = addr.to_socket_addr().await;
12+
addr.to_socket_addr().await;
1313
}
1414
pub trait ToSocketAddr {
1515
type Future: Future<Output = ()>;

tests/ui/async-await/drop-track-field-assign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Agent {
2121
let mut info = self.info_result.clone();
2222
info.node = Some("bar".into());
2323
let element = parse_info(info);
24-
let _ = send_element(element).await;
24+
send_element(element).await;
2525
}
2626
}
2727

tests/ui/async-await/field-assign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Agent {
2121
let mut info = self.info_result.clone();
2222
info.node = Some("bar".into());
2323
let element = parse_info(info);
24-
let _ = send_element(element).await;
24+
send_element(element).await;
2525
}
2626
}
2727

tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ LL | pub fn foo() -> impl Future + Send {
66
|
77
= help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
88
note: future is not `Send` as this value is used across an await
9-
--> $DIR/issue-64130-4-async-move.rs:27:32
9+
--> $DIR/issue-64130-4-async-move.rs:27:23
1010
|
1111
LL | match client.status() {
1212
| ------ has type `&Client` which is not `Send`
1313
LL | 200 => {
14-
LL | let _x = get().await;
15-
| ^^^^^ await occurs here, with `client` maybe used later
14+
LL | get().await;
15+
| ^^^^^ await occurs here, with `client` maybe used later
1616
...
1717
LL | }
1818
| - `client` is later dropped here

tests/ui/async-await/issue-64130-4-async-move.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn foo() -> impl Future + Send {
2424
async move {
2525
match client.status() {
2626
200 => {
27-
let _x = get().await;
27+
get().await;
2828
}
2929
_ => (),
3030
}

0 commit comments

Comments
 (0)