From 0d25ff8842ca35b7eabd2d8a22669c5b2216ad82 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Fri, 25 Jan 2019 20:37:10 +0100 Subject: [PATCH] Test aller things --- .../generic_duplicate_param_use5.rs | 15 +++++++++++++++ .../generic_duplicate_param_use5.stderr | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/test/ui/existential_types/generic_duplicate_param_use5.rs create mode 100644 src/test/ui/existential_types/generic_duplicate_param_use5.stderr diff --git a/src/test/ui/existential_types/generic_duplicate_param_use5.rs b/src/test/ui/existential_types/generic_duplicate_param_use5.rs new file mode 100644 index 00000000000..f9d336d759b --- /dev/null +++ b/src/test/ui/existential_types/generic_duplicate_param_use5.rs @@ -0,0 +1,15 @@ +#![feature(existential_type)] + +fn main() {} + +// test that unused generic parameters are ok +existential type Two: 'static; + +fn one(t: T) -> Two { + t +} + +fn two(t: T, _: U) -> Two { +//~^ ERROR defining existential type use differs from previous + t +} diff --git a/src/test/ui/existential_types/generic_duplicate_param_use5.stderr b/src/test/ui/existential_types/generic_duplicate_param_use5.stderr new file mode 100644 index 00000000000..e2bf4a9e0df --- /dev/null +++ b/src/test/ui/existential_types/generic_duplicate_param_use5.stderr @@ -0,0 +1,19 @@ +error: defining existential type use differs from previous + --> $DIR/generic_duplicate_param_use5.rs:12:1 + | +LL | / fn two(t: T, _: U) -> Two { +LL | | //~^ ERROR defining existential type use differs from previous +LL | | t +LL | | } + | |_^ + | +note: previous use here + --> $DIR/generic_duplicate_param_use5.rs:8:1 + | +LL | / fn one(t: T) -> Two { +LL | | t +LL | | } + | |_^ + +error: aborting due to previous error +