Skip to content

Commit 72d965f

Browse files
committed
Reword label as per review comment
1 parent f9e10f1 commit 72d965f

21 files changed

+26
-26
lines changed

src/librustc/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
488488
fn note_error_origin(&self, err: &mut DiagnosticBuilder<'tcx>, cause: &ObligationCause<'tcx>) {
489489
match cause.code {
490490
ObligationCauseCode::MatchExpressionArmPattern { span, ty } => {
491-
err.span_label(span, format!("this match expression evaluates to `{}`", ty));
491+
err.span_label(span, format!("this match expression has type `{}`", ty));
492492
}
493493
ObligationCauseCode::MatchExpressionArm { arm_span, source } => match source {
494494
hir::MatchSource::IfLetDesugar { .. } => {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
1313
--> $DIR/issue-13624.rs:22:9
1414
|
1515
LL | match enum_struct_variant {
16-
| ------------------- this match expression evaluates to `()`
16+
| ------------------- this match expression has type `()`
1717
LL | a::Enum::EnumStructVariant { x, y, z } => {
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
1919
|

src/test/ui/error-codes/E0308-4.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/E0308-4.rs:4:9
33
|
44
LL | match x {
5-
| - this match expression evaluates to `u8`
5+
| - this match expression has type `u8`
66
LL | 0u8..=3i8 => (), //~ ERROR E0308
77
| ^^^^^^^^^ expected u8, found i8
88

src/test/ui/issues/issue-11844.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-11844.rs:6:9
33
|
44
LL | match a {
5-
| - this match expression evaluates to `std::option::Option<std::boxed::Box<{integer}>>`
5+
| - this match expression has type `std::option::Option<std::boxed::Box<{integer}>>`
66
LL | Ok(a) => //~ ERROR: mismatched types
77
| ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
88
|

src/test/ui/issues/issue-12552.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-12552.rs:6:5
33
|
44
LL | match t {
5-
| - this match expression evaluates to `std::result::Result<_, {integer}>`
5+
| - this match expression has type `std::result::Result<_, {integer}>`
66
LL | Some(k) => match k { //~ ERROR mismatched types
77
| ^^^^^^^ expected enum `std::result::Result`, found enum `std::option::Option`
88
|

src/test/ui/issues/issue-13466.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-13466.rs:8:9
33
|
44
LL | let _x: usize = match Some(1) {
5-
| ------- this match expression evaluates to `std::option::Option<{integer}>`
5+
| ------- this match expression has type `std::option::Option<{integer}>`
66
LL | Ok(u) => u,
77
| ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
88
|
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
1313
--> $DIR/issue-13466.rs:14:9
1414
|
1515
LL | let _x: usize = match Some(1) {
16-
| ------- this match expression evaluates to `std::option::Option<{integer}>`
16+
| ------- this match expression has type `std::option::Option<{integer}>`
1717
...
1818
LL | Err(e) => panic!(e)
1919
| ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`

src/test/ui/issues/issue-15896.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-15896.rs:11:11
33
|
44
LL | let u = match e {
5-
| - this match expression evaluates to `main::R`
5+
| - this match expression has type `main::R`
66
LL | E::B(
77
LL | Tau{t: x},
88
| ^^^^^^^^^ expected enum `main::R`, found struct `main::Tau`

src/test/ui/issues/issue-16401.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-16401.rs:8:9
33
|
44
LL | match () {
5-
| -- this match expression evaluates to `()`
5+
| -- this match expression has type `()`
66
LL | Slice { data: data, len: len } => (),
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice`
88
|

src/test/ui/issues/issue-3680.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-3680.rs:3:9
33
|
44
LL | match None {
5-
| ---- this match expression evaluates to `std::option::Option<_>`
5+
| ---- this match expression has type `std::option::Option<_>`
66
LL | Err(_) => ()
77
| ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
88
|

src/test/ui/issues/issue-5100.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
2929
--> $DIR/issue-5100.rs:33:9
3030
|
3131
LL | match (true, false) {
32-
| ------------- this match expression evaluates to `(bool, bool)`
32+
| ------------- this match expression has type `(bool, bool)`
3333
LL | box (true, false) => ()
3434
| ^^^^^^^^^^^^^^^^^ expected tuple, found struct `std::boxed::Box`
3535
|

src/test/ui/issues/issue-5358-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-5358-1.rs:6:9
33
|
44
LL | match S(Either::Left(5)) {
5-
| ------------------ this match expression evaluates to `S`
5+
| ------------------ this match expression has type `S`
66
LL | Either::Right(_) => {}
77
| ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either`
88
|

src/test/ui/issues/issue-7092.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/issue-7092.rs:6:9
33
|
44
LL | match x {
5-
| - this match expression evaluates to `Whatever`
5+
| - this match expression has type `Whatever`
66
LL | Some(field) =>
77
| ^^^^^^^^^^^ expected enum `Whatever`, found enum `std::option::Option`
88
|

src/test/ui/match/match-range-fail.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
2020
--> $DIR/match-range-fail.rs:17:9
2121
|
2222
LL | match 5 {
23-
| - this match expression evaluates to `{integer}`
23+
| - this match expression has type `{integer}`
2424
LL | 'c' ..= 100 => { }
2525
| ^^^^^^^^^^^ expected integer, found char
2626
|

src/test/ui/match/match-struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/match-struct.rs:6:9
33
|
44
LL | match (S { a: 1 }) {
5-
| ------------ this match expression evaluates to `S`
5+
| ------------ this match expression has type `S`
66
LL | E::C(_) => (),
77
| ^^^^^^^ expected struct `S`, found enum `E`
88
|

src/test/ui/match/match-tag-unary.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } } //~ ERROR mismatched types
55
| - ^^^^^^^ expected enum `A`, found enum `B`
66
| |
7-
| this match expression evaluates to `A`
7+
| this match expression has type `A`
88
|
99
= note: expected type `A`
1010
found type `B`

src/test/ui/mismatched_types/E0409.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
1010
--> $DIR/E0409.rs:5:23
1111
|
1212
LL | match x {
13-
| - this match expression evaluates to `_`
13+
| - this match expression has type `_`
1414
LL | (0, ref y) | (y, 0) => {} //~ ERROR E0409
1515
| ^ expected &{integer}, found integer
1616
|

src/test/ui/or-pattern-mismatch.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn main() { match Blah::A(1, 1, 2) { Blah::A(_, x, y) | Blah::B(x, y) => { } } }
55
| ---------------- ^ expected usize, found isize
66
| |
7-
| this match expression evaluates to `_`
7+
| this match expression has type `_`
88
|
99
= note: expected type `usize`
1010
found type `isize`

src/test/ui/pattern/pattern-error-continue.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
2222
--> $DIR/pattern-error-continue.rs:22:9
2323
|
2424
LL | match 'c' {
25-
| --- this match expression evaluates to `char`
25+
| --- this match expression has type `char`
2626
LL | S { .. } => (),
2727
| ^^^^^^^^ expected char, found struct `S`
2828
|

src/test/ui/pattern/pattern-tyvar.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
22
--> $DIR/pattern-tyvar.rs:5:18
33
|
44
LL | match t {
5-
| - this match expression evaluates to `std::option::Option<std::vec::Vec<isize>>`
5+
| - this match expression has type `std::option::Option<std::vec::Vec<isize>>`
66
LL | Bar::T1(_, Some::<isize>(x)) => { //~ ERROR mismatched types
77
| ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found isize
88
|

src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
2424
--> $DIR/resolve-inconsistent-binding-mode.rs:7:32
2525
|
2626
LL | match x {
27-
| - this match expression evaluates to `_`
27+
| - this match expression has type `_`
2828
LL | Opts::A(ref i) | Opts::B(i) => {}
2929
| ^ expected &isize, found isize
3030
|
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
3535
--> $DIR/resolve-inconsistent-binding-mode.rs:16:32
3636
|
3737
LL | match x {
38-
| - this match expression evaluates to `_`
38+
| - this match expression has type `_`
3939
LL | Opts::A(ref i) | Opts::B(i) => {}
4040
| ^ expected &isize, found isize
4141
|
@@ -46,7 +46,7 @@ error[E0308]: mismatched types
4646
--> $DIR/resolve-inconsistent-binding-mode.rs:25:36
4747
|
4848
LL | match x {
49-
| - this match expression evaluates to `_`
49+
| - this match expression has type `_`
5050
LL | Opts::A(ref mut i) | Opts::B(ref i) => {}
5151
| ^^^^^ types differ in mutability
5252
|

src/test/ui/structs/structure-constructor-type-mismatch.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ error[E0308]: mismatched types
110110
--> $DIR/structure-constructor-type-mismatch.rs:54:9
111111
|
112112
LL | match (Point { x: 1, y: 2 }) {
113-
| ---------------------- this match expression evaluates to `Point<{integer}>`
113+
| ---------------------- this match expression has type `Point<{integer}>`
114114
LL | PointF::<u32> { .. } => {} //~ ERROR wrong number of type arguments
115115
| ^^^^^^^^^^^^^^^^^^^^ expected integer, found f32
116116
|
@@ -121,7 +121,7 @@ error[E0308]: mismatched types
121121
--> $DIR/structure-constructor-type-mismatch.rs:59:9
122122
|
123123
LL | match (Point { x: 1, y: 2 }) {
124-
| ---------------------- this match expression evaluates to `Point<{integer}>`
124+
| ---------------------- this match expression has type `Point<{integer}>`
125125
LL | PointF { .. } => {} //~ ERROR mismatched types
126126
| ^^^^^^^^^^^^^ expected integer, found f32
127127
|
@@ -132,7 +132,7 @@ error[E0308]: mismatched types
132132
--> $DIR/structure-constructor-type-mismatch.rs:67:9
133133
|
134134
LL | match (Pair { x: 1, y: 2 }) {
135-
| --------------------- this match expression evaluates to `Pair<{integer}, {integer}>`
135+
| --------------------- this match expression has type `Pair<{integer}, {integer}>`
136136
LL | PairF::<u32> { .. } => {} //~ ERROR mismatched types
137137
| ^^^^^^^^^^^^^^^^^^^ expected integer, found f32
138138
|

0 commit comments

Comments
 (0)