Skip to content

Commit 9a58168

Browse files
committed
Bless ui tests.
1 parent 048f122 commit 9a58168

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

tests/ui/consts/const-eval/issue-50814.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ struct Sum<A, B>(A, B);
1414
impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A, B> {
1515
const MAX: u8 = A::MAX + B::MAX;
1616
//~^ ERROR evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
17+
//~| ERROR evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
1718
}
1819

1920
fn foo<T>(_: T) -> &'static u8 {
2021
&Sum::<U8, U8>::MAX
2122
//~^ constant
23+
//~| constant
2224
}
2325

2426
fn main() {

tests/ui/consts/const-eval/issue-50814.stderr

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,35 @@ LL | const MAX: u8 = A::MAX + B::MAX;
55
| ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
66

77
note: erroneous constant used
8-
--> $DIR/issue-50814.rs:20:6
8+
--> $DIR/issue-50814.rs:21:6
9+
|
10+
LL | &Sum::<U8, U8>::MAX
11+
| ^^^^^^^^^^^^^^^^^^
12+
13+
note: erroneous constant used
14+
--> $DIR/issue-50814.rs:21:5
15+
|
16+
LL | &Sum::<U8, U8>::MAX
17+
| ^^^^^^^^^^^^^^^^^^^
18+
19+
error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
20+
--> $DIR/issue-50814.rs:15:21
21+
|
22+
LL | const MAX: u8 = A::MAX + B::MAX;
23+
| ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
24+
25+
note: erroneous constant used
26+
--> $DIR/issue-50814.rs:21:6
927
|
1028
LL | &Sum::<U8, U8>::MAX
1129
| ^^^^^^^^^^^^^^^^^^
1230

1331
note: the above error was encountered while instantiating `fn foo::<i32>`
14-
--> $DIR/issue-50814.rs:25:5
32+
--> $DIR/issue-50814.rs:27:5
1533
|
1634
LL | foo(0);
1735
| ^^^^^^
1836

19-
error: aborting due to previous error
37+
error: aborting due to 2 previous errors
2038

2139
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)