From cf2dff2b1e3fa55fa5415d524200070d0d7aacfe Mon Sep 17 00:00:00 2001 From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:13:28 +0100 Subject: Move /src/test to /tests --- tests/ui/attributes/class-attributes-2.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/ui/attributes/class-attributes-2.rs (limited to 'tests/ui/attributes/class-attributes-2.rs') diff --git a/tests/ui/attributes/class-attributes-2.rs b/tests/ui/attributes/class-attributes-2.rs new file mode 100644 index 00000000000..6aba6b89427 --- /dev/null +++ b/tests/ui/attributes/class-attributes-2.rs @@ -0,0 +1,31 @@ +// build-pass (FIXME(62277): could be check-pass?) + +#![feature(rustc_attrs)] + +struct Cat { + name: String, +} + +impl Drop for Cat { + #[rustc_dummy] + /** + Actually, cats don't always land on their feet when you drop them. + */ + fn drop(&mut self) { + println!("{} landed on hir feet", self.name); + } +} + +#[rustc_dummy] +/** +Maybe it should technically be a kitten_maker. +*/ +fn cat(name: String) -> Cat { + Cat { + name: name + } +} + +fn main() { + let _kitty = cat("Spotty".to_string()); +} -- cgit 1.4.1-3-g733a5