Skip to content

Commit b2e6aef

Browse files
committed
review comments: tweak prefix strings
1 parent 83ffda5 commit b2e6aef

File tree

130 files changed

+407
-407
lines changed

Some content is hidden

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

130 files changed

+407
-407
lines changed

src/librustc/ty/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl<'tcx> ty::TyS<'tcx> {
252252
match self.kind {
253253
ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) |
254254
ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(),
255-
ty::Tuple(ref tys) if tys.is_empty() => "type".into(),
255+
ty::Tuple(ref tys) if tys.is_empty() => "unit type".into(),
256256
ty::Adt(def, _) => def.descr().into(),
257257
ty::Foreign(_) => "extern type".into(),
258258
ty::Array(..) => "array".into(),
@@ -264,13 +264,13 @@ impl<'tcx> ty::TyS<'tcx> {
264264
}.into(),
265265
ty::FnDef(..) => "fn item".into(),
266266
ty::FnPtr(_) => "fn pointer".into(),
267-
ty::Dynamic(..) => "trait".into(),
267+
ty::Dynamic(..) => "trait object".into(),
268268
ty::Closure(..) => "closure".into(),
269269
ty::Generator(..) => "generator".into(),
270270
ty::GeneratorWitness(..) => "generator witness".into(),
271271
ty::Tuple(..) => "tuple".into(),
272-
ty::Placeholder(..) => "placeholder type".into(),
273-
ty::Bound(..) => "bound type".into(),
272+
ty::Placeholder(..) => "higher-ranked type".into(),
273+
ty::Bound(..) => "bound type variable".into(),
274274
ty::Projection(_) => "associated type".into(),
275275
ty::UnnormalizedProjection(_) => "associated type".into(),
276276
ty::Param(_) => "type parameter".into(),

src/test/ui/arg-type-mismatch.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
44
LL | fn main() { let i: (); i = f(()); }
55
| ^^ expected isize, found ()
66
|
7-
= note: expected type `isize`
8-
found type `()`
7+
= note: expected type `isize`
8+
found unit type `()`
99

1010
error: aborting due to previous error
1111

src/test/ui/array-break-length.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ error[E0308]: mismatched types
1616
LL | |_: [_; break]| {}
1717
| ^^^^^^^^^^^^^^^^^^ expected (), found closure
1818
|
19-
= note: expected type `()`
20-
found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]`
19+
= note: expected unit type `()`
20+
found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]`
2121

2222
error[E0308]: mismatched types
2323
--> $DIR/array-break-length.rs:8:9
2424
|
2525
LL | |_: [_; continue]| {}
2626
| ^^^^^^^^^^^^^^^^^^^^^ expected (), found closure
2727
|
28-
= note: expected type `()`
29-
found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]`
28+
= note: expected unit type `()`
29+
found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]`
3030

3131
error: aborting due to 4 previous errors
3232

src/test/ui/associated-types/issue-44153.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | fn visit() {}
77
LL | <() as Visit>::visit();
88
| ^^^^^^^^^^^^^^^^^^^^ expected (), found &()
99
|
10-
= note: expected type `()`
11-
found reference `&()`
10+
= note: expected unit type `()`
11+
found reference `&()`
1212
= note: required because of the requirements on the impl of `Visit` for `()`
1313

1414
error: aborting due to previous error

src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | impl Bar for Foo {
99
LL | type Ok = ();
1010
| ^^^^^^^^^^^^^ expected u32, found ()
1111
|
12-
= note: expected type `u32`
13-
found type `()`
12+
= note: expected type `u32`
13+
found unit type `()`
1414

1515
error: aborting due to previous error
1616

src/test/ui/async-await/async-block-control-flow-static-semantics.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ LL | fn return_targets_async_block_not_fn() -> u8 {
2626
| |
2727
| implicitly returns `()` as its body has no tail or `return` expression
2828
|
29-
= note: expected type `u8`
30-
found type `()`
29+
= note: expected type `u8`
30+
found unit type `()`
3131

3232
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
3333
--> $DIR/async-block-control-flow-static-semantics.rs:18:39
3434
|
3535
LL | let _: &dyn Future<Output = ()> = &block;
3636
| ^^^^^^ expected (), found u8
3737
|
38-
= note: expected type `()`
39-
found type `u8`
38+
= note: expected unit type `()`
39+
found type `u8`
4040
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
4141

4242
error[E0308]: mismatched types
@@ -52,17 +52,17 @@ LL | |
5252
LL | | }
5353
| |_^ expected u8, found ()
5454
|
55-
= note: expected type `u8`
56-
found type `()`
55+
= note: expected type `u8`
56+
found unit type `()`
5757

5858
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
5959
--> $DIR/async-block-control-flow-static-semantics.rs:27:39
6060
|
6161
LL | let _: &dyn Future<Output = ()> = &block;
6262
| ^^^^^^ expected (), found u8
6363
|
64-
= note: expected type `()`
65-
found type `u8`
64+
= note: expected unit type `()`
65+
found type `u8`
6666
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
6767

6868
error[E0308]: mismatched types
@@ -73,8 +73,8 @@ LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
7373
| |
7474
| implicitly returns `()` as its body has no tail or `return` expression
7575
|
76-
= note: expected enum `std::result::Result<u8, MyErr>`
77-
found type `()`
76+
= note: expected enum `std::result::Result<u8, MyErr>`
77+
found unit type `()`
7878

7979
error[E0308]: mismatched types
8080
--> $DIR/async-block-control-flow-static-semantics.rs:57:50
@@ -84,8 +84,8 @@ LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
8484
| |
8585
| implicitly returns `()` as its body has no tail or `return` expression
8686
|
87-
= note: expected enum `std::result::Result<u8, MyErr>`
88-
found type `()`
87+
= note: expected enum `std::result::Result<u8, MyErr>`
88+
found unit type `()`
8989

9090
error: aborting due to 8 previous errors
9191

src/test/ui/block-expression-remove-semicolon.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | | foo();
99
LL | | };
1010
| |_____^ expected i32, found ()
1111
|
12-
= note: expected type `i32`
13-
found type `()`
12+
= note: expected type `i32`
13+
found unit type `()`
1414

1515
error: aborting due to previous error
1616

src/test/ui/block-result/block-must-not-have-result-do.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
44
LL | true
55
| ^^^^ expected (), found bool
66
|
7-
= note: expected type `()`
8-
found type `bool`
7+
= note: expected unit type `()`
8+
found type `bool`
99

1010
error: aborting due to previous error
1111

src/test/ui/block-result/block-must-not-have-result-res.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ LL | fn drop(&mut self) {
66
LL | true
77
| ^^^^ expected (), found bool
88
|
9-
= note: expected type `()`
10-
found type `bool`
9+
= note: expected unit type `()`
10+
found type `bool`
1111

1212
error: aborting due to previous error
1313

src/test/ui/block-result/block-must-not-have-result-while.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fn main() {
22
while true { //~ WARN denote infinite loops with
33
true //~ ERROR mismatched types
4-
//~| expected type `()`
4+
//~| expected unit type `()`
55
//~| found type `bool`
66
//~| expected (), found bool
77
}

src/test/ui/block-result/block-must-not-have-result-while.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ error[E0308]: mismatched types
1212
LL | true
1313
| ^^^^ expected (), found bool
1414
|
15-
= note: expected type `()`
16-
found type `bool`
15+
= note: expected unit type `()`
16+
found type `bool`
1717

1818
error: aborting due to previous error
1919

src/test/ui/block-result/consider-removing-last-semi.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | "bla".to_string();
1010
| - help: consider removing this semicolon
1111
|
1212
= note: expected struct `std::string::String`
13-
found type `()`
13+
found unit type `()`
1414

1515
error[E0308]: mismatched types
1616
--> $DIR/consider-removing-last-semi.rs:6:11
@@ -24,7 +24,7 @@ LL | "removeme".to_string();
2424
| - help: consider removing this semicolon
2525
|
2626
= note: expected struct `std::string::String`
27-
found type `()`
27+
found unit type `()`
2828

2929
error: aborting due to 2 previous errors
3030

src/test/ui/block-result/issue-11714.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | fn blah() -> i32 {
99
LL | ;
1010
| - help: consider removing this semicolon
1111
|
12-
= note: expected type `i32`
13-
found type `()`
12+
= note: expected type `i32`
13+
found unit type `()`
1414

1515
error: aborting due to previous error
1616

src/test/ui/block-result/issue-13428.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | ;
1010
| - help: consider removing this semicolon
1111
|
1212
= note: expected struct `std::string::String`
13-
found type `()`
13+
found unit type `()`
1414

1515
error[E0308]: mismatched types
1616
--> $DIR/issue-13428.rs:11:13
@@ -24,7 +24,7 @@ LL | ;
2424
| - help: consider removing this semicolon
2525
|
2626
= note: expected struct `std::string::String`
27-
found type `()`
27+
found unit type `()`
2828

2929
error: aborting due to 2 previous errors
3030

src/test/ui/block-result/issue-13624.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod a {
77
Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
88
//~^ ERROR mismatched types
99
//~| expected (), found enum `a::Enum`
10-
//~| expected type `()`
10+
//~| expected unit type `()`
1111
//~| found enum `a::Enum`
1212
}
1313
}
@@ -22,7 +22,7 @@ mod b {
2222
a::Enum::EnumStructVariant { x, y, z } => {
2323
//~^ ERROR mismatched types
2424
//~| expected (), found enum `a::Enum`
25-
//~| expected type `()`
25+
//~| expected unit type `()`
2626
//~| found enum `a::Enum`
2727
}
2828
}

src/test/ui/block-result/issue-13624.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ LL | pub fn get_enum_struct_variant() -> () {
66
LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
88
|
9-
= note: expected type `()`
10-
found enum `a::Enum`
9+
= note: expected unit type `()`
10+
found enum `a::Enum`
1111

1212
error[E0308]: mismatched types
1313
--> $DIR/issue-13624.rs:22:9
@@ -17,8 +17,8 @@ LL | match enum_struct_variant {
1717
LL | a::Enum::EnumStructVariant { x, y, z } => {
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
1919
|
20-
= note: expected type `()`
21-
found enum `a::Enum`
20+
= note: expected unit type `()`
21+
found enum `a::Enum`
2222

2323
error: aborting due to 2 previous errors
2424

src/test/ui/block-result/issue-20862.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ LL | fn foo(x: i32) {
66
LL | |y| x + y
77
| ^^^^^^^^^ expected (), found closure
88
|
9-
= note: expected type `()`
10-
found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
9+
= note: expected unit type `()`
10+
found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
1111

1212
error[E0618]: expected function, found `()`
1313
--> $DIR/issue-20862.rs:7:13

src/test/ui/block-result/issue-22645.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ LL | let b = Bob + 3.5;
1717
LL | b + 3
1818
| ^^^^^ expected (), found struct `Bob`
1919
|
20-
= note: expected type `()`
21-
found struct `Bob`
20+
= note: expected unit type `()`
21+
found struct `Bob`
2222

2323
error: aborting due to 2 previous errors
2424

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fn main() {
22
&panic!()
33
//~^ ERROR mismatched types
4-
//~| expected type `()`
4+
//~| expected unit type `()`
55
//~| found reference `&_`
66
//~| expected (), found reference
77
}

src/test/ui/block-result/issue-5500.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | &panic!()
99
| expected (), found reference
1010
| help: consider removing the borrow: `panic!()`
1111
|
12-
= note: expected type `()`
13-
found reference `&_`
12+
= note: expected unit type `()`
13+
found reference `&_`
1414

1515
error: aborting due to previous error
1616

src/test/ui/block-result/unexpected-return-on-unit.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
44
LL | foo()
55
| ^^^^^ expected (), found usize
66
|
7-
= note: expected type `()`
8-
found type `usize`
7+
= note: expected unit type `()`
8+
found type `usize`
99
help: try adding a semicolon
1010
|
1111
LL | foo();

src/test/ui/break-while-condition.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | | 'a: while break 'a {};
77
LL | | };
88
| |_________^ expected !, found ()
99
|
10-
= note: expected type `!`
11-
found type `()`
10+
= note: expected type `!`
11+
found unit type `()`
1212

1313
error[E0308]: mismatched types
1414
--> $DIR/break-while-condition.rs:16:13
@@ -18,8 +18,8 @@ LL | | break
1818
LL | | }
1919
| |_____________^ expected !, found ()
2020
|
21-
= note: expected type `!`
22-
found type `()`
21+
= note: expected type `!`
22+
found unit type `()`
2323

2424
error[E0308]: mismatched types
2525
--> $DIR/break-while-condition.rs:24:13
@@ -29,8 +29,8 @@ LL | | return
2929
LL | | }
3030
| |_____________^ expected !, found ()
3131
|
32-
= note: expected type `!`
33-
found type `()`
32+
= note: expected type `!`
33+
found unit type `()`
3434

3535
error: aborting due to 3 previous errors
3636

src/test/ui/codemap_tests/tab.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ LL | fn foo() {
1212
LL | "bar boo"
1313
| ^^^^^^^^^^^^^^^^^^^^ expected (), found reference
1414
|
15-
= note: expected type `()`
16-
found reference `&'static str`
15+
= note: expected unit type `()`
16+
found reference `&'static str`
1717

1818
error: aborting due to 2 previous errors
1919

0 commit comments

Comments
 (0)