From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/dyn-keyword/dyn-angle-brackets.fixed | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/ui/dyn-keyword/dyn-angle-brackets.fixed (limited to 'tests/ui/dyn-keyword/dyn-angle-brackets.fixed') diff --git a/tests/ui/dyn-keyword/dyn-angle-brackets.fixed b/tests/ui/dyn-keyword/dyn-angle-brackets.fixed new file mode 100644 index 000000000..00069a3e7 --- /dev/null +++ b/tests/ui/dyn-keyword/dyn-angle-brackets.fixed @@ -0,0 +1,21 @@ +// See https://github.com/rust-lang/rust/issues/88508 +// run-rustfix +// edition:2018 +#![deny(bare_trait_objects)] +#![allow(dead_code)] +#![allow(unused_imports)] + +use std::fmt; + +#[derive(Debug)] +pub struct Foo; + +impl fmt::Display for Foo { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + ::fmt(self, f) + //~^ ERROR trait objects without an explicit `dyn` are deprecated + //~| WARNING this is accepted in the current edition + } +} + +fn main() {} -- cgit v1.2.3