From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/rustfmt/tests/target/impl.rs | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/tools/rustfmt/tests/target/impl.rs (limited to 'src/tools/rustfmt/tests/target/impl.rs') diff --git a/src/tools/rustfmt/tests/target/impl.rs b/src/tools/rustfmt/tests/target/impl.rs new file mode 100644 index 000000000..f37fbcf1f --- /dev/null +++ b/src/tools/rustfmt/tests/target/impl.rs @@ -0,0 +1,43 @@ +// Test impls + +impl JSTraceable for SmallVec<[T; 1]> {} + +impl>> Handle { + // Keep this. +} + +impl Test +where + V: Clone, // This comment is NOT removed by formatting! +{ + pub fn new(value: V) -> Self { + Test { + cloned_value: value.clone(), + value, + } + } +} + +impl X /* comment */ {} +impl Y // comment +{ +} + +impl Foo for T +// comment1 +where + // comment2 + // blah + T: Clone, +{ +} + +// #1823 +default impl Trait for X {} +default unsafe impl Trait for Y {} +pub default unsafe impl Trait for Z {} + +// #2212 +impl ConstWithDefault { + default const CAN_RECONSTRUCT_QUERY_KEY: bool = false; +} -- cgit v1.2.3