Skip to content

Commit 693bb99

Browse files
committed
Fix some tests that failed after we started linting on promoteds
1 parent a9f6784 commit 693bb99

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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 {

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

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

77
note: erroneous constant encountered
8-
--> $DIR/issue-50814.rs:20:6
8+
--> $DIR/issue-50814.rs:21:6
99
|
1010
LL | &Sum::<U8, U8>::MAX
1111
| ^^^^^^^^^^^^^^^^^^
@@ -19,15 +19,15 @@ LL | const MAX: u8 = A::MAX + B::MAX;
1919
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2020

2121
note: erroneous constant encountered
22-
--> $DIR/issue-50814.rs:20:6
22+
--> $DIR/issue-50814.rs:21:6
2323
|
2424
LL | &Sum::<U8, U8>::MAX
2525
| ^^^^^^^^^^^^^^^^^^
2626
|
2727
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2828

2929
note: the above error was encountered while instantiating `fn foo::<i32>`
30-
--> $DIR/issue-50814.rs:25:5
30+
--> $DIR/issue-50814.rs:26:5
3131
|
3232
LL | foo(0);
3333
| ^^^^^^

tests/ui/consts/promotion.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ fn main() {
2525
assert_static(&["d", "e", "f"]);
2626
assert_eq!(C, 42);
2727

28-
// make sure that these do not cause trouble despite overflowing
28+
// make sure that this does not cause trouble despite overflowing
2929
assert_static(&(0-1));
30-
assert_static(&-i32::MIN);
3130

3231
// div-by-non-0 is okay
3332
assert_static(&(1/1));

tests/ui/numbers-arithmetic/promoted_overflow_opt.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)