From 91c53c97a990e9d1ab87b2d932362a53236fba49 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 2 Jul 2025 00:32:54 +0000 Subject: Consider polarity in sizedness fast path --- tests/ui/traits/negative-bounds/negative-sized.rs | 8 ++++++++ tests/ui/traits/negative-bounds/negative-sized.stderr | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/ui/traits/negative-bounds/negative-sized.rs create mode 100644 tests/ui/traits/negative-bounds/negative-sized.stderr (limited to 'tests') diff --git a/tests/ui/traits/negative-bounds/negative-sized.rs b/tests/ui/traits/negative-bounds/negative-sized.rs new file mode 100644 index 00000000000..18369c78427 --- /dev/null +++ b/tests/ui/traits/negative-bounds/negative-sized.rs @@ -0,0 +1,8 @@ +#![feature(negative_bounds)] + +fn foo() {} + +fn main() { + foo::<()>(); + //~^ ERROR the trait bound `(): !Sized` is not satisfied +} diff --git a/tests/ui/traits/negative-bounds/negative-sized.stderr b/tests/ui/traits/negative-bounds/negative-sized.stderr new file mode 100644 index 00000000000..143933803b8 --- /dev/null +++ b/tests/ui/traits/negative-bounds/negative-sized.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `(): !Sized` is not satisfied + --> $DIR/negative-sized.rs:6:11 + | +LL | foo::<()>(); + | ^^ the trait bound `(): !Sized` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sized.rs:3:11 + | +LL | fn foo() {} + | ^^^^^^ required by this bound in `foo` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. -- cgit 1.4.1-3-g733a5