From f7e00a55bba51de1d58f829b562f9aff05d543f3 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 2 Jul 2019 14:23:38 -0400 Subject: fix ICE with delay-span-bug --- .../multiple-lifetimes/ret-impl-trait-one.nll.stderr | 15 +++++++++++++++ .../ordinary-bounds-unrelated.nll.stderr | 9 +++++++++ .../ordinary-bounds-unsuited.nll.stderr | 9 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr create mode 100644 src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.nll.stderr create mode 100644 src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.nll.stderr (limited to 'src/test') diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr new file mode 100644 index 00000000000..b4d5d3ec051 --- /dev/null +++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr @@ -0,0 +1,15 @@ +error: lifetime may not live long enough + --> $DIR/ret-impl-trait-one.rs:12:80 + | +LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> { + | ________________________________--__--__________________________________________^ + | | | | + | | | lifetime `'b` defined here + | | lifetime `'a` defined here +LL | | +LL | | (a, b) +LL | | } + | |_^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + +error: aborting due to previous error + diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.nll.stderr b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.nll.stderr new file mode 100644 index 00000000000..a255c48ec6e --- /dev/null +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.nll.stderr @@ -0,0 +1,9 @@ +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ordinary-bounds-unrelated.rs:18:74 + | +LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e> + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0700`. diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.nll.stderr b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.nll.stderr new file mode 100644 index 00000000000..af42ed1c5c1 --- /dev/null +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.nll.stderr @@ -0,0 +1,9 @@ +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ordinary-bounds-unsuited.rs:20:62 + | +LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b> + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0700`. -- cgit 1.4.1-3-g733a5