From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- .../anonymize-unnamed-bound-vars-in-binders.rs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs (limited to 'tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs') diff --git a/tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs b/tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs new file mode 100644 index 000000000..05e3763e9 --- /dev/null +++ b/tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs @@ -0,0 +1,27 @@ +// build-pass +// issue: #115807 + +trait Chip: for<'a> TraitWithLifetime<'a> + SomeMarker { + fn compute(&self); +} + +trait SomeMarker {} + +trait TraitWithLifetime<'a>: SomeMarker {} + +trait Machine { + fn run(); +} + +struct BasicMachine; + +impl Machine for BasicMachine { + fn run() { + let chips: [&dyn Chip; 0] = []; + let _ = chips.map(|chip| chip.compute()); + } +} + +fn main() { + BasicMachine::run(); +} -- cgit v1.2.3