diff options
| author | kennytm <kennytm@gmail.com> | 2018-10-30 18:55:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-30 18:55:32 +0800 |
| commit | 3176239d344d501895220ef62b63da5dfc66d445 (patch) | |
| tree | 8da53153ee90af08c207b9bb61a5f025dad31abb /src/test | |
| parent | 0cf957db390da410094135288e24b3d39f9408d2 (diff) | |
| parent | 3e9d7e8aa8b73ea3d73940a573523fd498181b6e (diff) | |
| download | rust-3176239d344d501895220ef62b63da5dfc66d445.tar.gz rust-3176239d344d501895220ef62b63da5dfc66d445.zip | |
Rollup merge of #55474 - oli-obk:const_eval_promoted, r=RalfJung
Fix validation false positive Fixes #55454 r? @RalfJung
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/const-validation-fail-55455.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/consts/promoted-validation-55454.rs | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-validation-fail-55455.rs b/src/test/ui/consts/const-validation-fail-55455.rs new file mode 100644 index 00000000000..def4062339f --- /dev/null +++ b/src/test/ui/consts/const-validation-fail-55455.rs @@ -0,0 +1,9 @@ +// https://github.com/rust-lang/rust/issues/55454 +// compile-pass + +struct This<T>(T); + +const C: This<Option<&i32>> = This(Some(&1)); + +fn main() { +} diff --git a/src/test/ui/consts/promoted-validation-55454.rs b/src/test/ui/consts/promoted-validation-55454.rs new file mode 100644 index 00000000000..5e193b1b7de --- /dev/null +++ b/src/test/ui/consts/promoted-validation-55454.rs @@ -0,0 +1,9 @@ +// https://github.com/rust-lang/rust/issues/55454 +// compile-pass + +#[derive(PartialEq)] +struct This<T>(T); + +fn main() { + This(Some(&1)) == This(Some(&1)); +} |
