diff options
| author | Wesley Wiser <wwiser@gmail.com> | 2019-09-03 21:56:15 -0400 |
|---|---|---|
| committer | Wesley Wiser <wwiser@gmail.com> | 2019-09-27 20:11:12 -0400 |
| commit | bc17936c8a466e56d472b811e0aca0cf8ffdf9a1 (patch) | |
| tree | f274545ce17f8befddaf37d9b6921453a3163eaa /src/test/ui/consts | |
| parent | 59367b074f1523353dddefa678ffe3cac9fd4e50 (diff) | |
| download | rust-bc17936c8a466e56d472b811e0aca0cf8ffdf9a1.tar.gz rust-bc17936c8a466e56d472b811e0aca0cf8ffdf9a1.zip | |
[const-prop] Replace `eval_place()` with use of `InterpCx`
Diffstat (limited to 'src/test/ui/consts')
| -rw-r--r-- | src/test/ui/consts/const-eval/issue-50814.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/consts/const-eval/issue-50814.stderr | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/test/ui/consts/const-eval/issue-50814.rs b/src/test/ui/consts/const-eval/issue-50814.rs index b85cecda16e..274967ef60d 100644 --- a/src/test/ui/consts/const-eval/issue-50814.rs +++ b/src/test/ui/consts/const-eval/issue-50814.rs @@ -11,6 +11,7 @@ struct Sum<A,B>(A,B); impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A,B> { const MAX: u8 = A::MAX + B::MAX; //~ ERROR any use of this value will cause an error + //~| ERROR any use of this value will cause an error } fn foo<T>(_: T) -> &'static u8 { diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr index 707dfee7cd5..de3459c72dd 100644 --- a/src/test/ui/consts/const-eval/issue-50814.stderr +++ b/src/test/ui/consts/const-eval/issue-50814.stderr @@ -9,13 +9,21 @@ LL | const MAX: u8 = A::MAX + B::MAX; = note: `#[deny(const_err)]` on by default error[E0080]: evaluation of constant expression failed - --> $DIR/issue-50814.rs:17:5 + --> $DIR/issue-50814.rs:18:5 | LL | &Sum::<U8,U8>::MAX | ^----------------- | | | referenced constant has errors -error: aborting due to 2 previous errors +error: any use of this value will cause an error + --> $DIR/issue-50814.rs:13:21 + | +LL | const MAX: u8 = A::MAX + B::MAX; + | ----------------^^^^^^^^^^^^^^^- + | | + | attempt to add with overflow + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0080`. |
