Skip to content

Commit 8bed0b5

Browse files
committed
Update issue-50814.rs test result
1 parent 890fae9 commit 8bed0b5

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

src/test/ui/consts/const-eval/issue-50814.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ impl Unsigned for U8 {
99
const MAX: u8 = 0xff;
1010
}
1111

12-
struct Sum<A,B>(A,B);
12+
struct Sum<A, B>(A, B);
1313

14-
impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A,B> {
14+
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 {
20-
&Sum::<U8,U8>::MAX
21-
//~^ ERROR E0080
21+
&Sum::<U8, U8>::MAX
22+
//~^ ERROR evaluation of `foo::<i32>` failed [E0080]
23+
//~| ERROR evaluation of `foo::<T>` failed [E0080]
2224
}
2325

2426
fn main() {

src/test/ui/consts/const-eval/issue-50814.stderr

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,30 @@ error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
44
LL | const MAX: u8 = A::MAX + B::MAX;
55
| ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
66

7+
error[E0080]: evaluation of `foo::<T>` failed
8+
--> $DIR/issue-50814.rs:21:6
9+
|
10+
LL | &Sum::<U8, U8>::MAX
11+
| ^^^^^^^^^^^^^^^^^^ referenced constant has errors
12+
13+
error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
14+
--> $DIR/issue-50814.rs:15:21
15+
|
16+
LL | const MAX: u8 = A::MAX + B::MAX;
17+
| ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
18+
719
error[E0080]: evaluation of `foo::<i32>` failed
8-
--> $DIR/issue-50814.rs:20:6
20+
--> $DIR/issue-50814.rs:21:6
921
|
10-
LL | &Sum::<U8,U8>::MAX
11-
| ^^^^^^^^^^^^^^^^^ referenced constant has errors
22+
LL | &Sum::<U8, U8>::MAX
23+
| ^^^^^^^^^^^^^^^^^^ referenced constant has errors
1224

1325
note: the above error was encountered while instantiating `fn foo::<i32>`
14-
--> $DIR/issue-50814.rs:25:5
26+
--> $DIR/issue-50814.rs:27:5
1527
|
1628
LL | foo(0);
1729
| ^^^^^^
1830

19-
error: aborting due to 2 previous errors
31+
error: aborting due to 4 previous errors
2032

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

0 commit comments

Comments
 (0)