diff options
| author | bors <bors@rust-lang.org> | 2024-05-31 12:18:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-31 12:18:57 +0000 |
| commit | 2a2c29aafa50bf6fe53d66b32070eba59f860ac3 (patch) | |
| tree | 278b17527f858913de99475f1d9ecdc41d297f89 /tests/codegen-units/partitioning/vtable-through-const.rs | |
| parent | 99cb42c29641aee2cce6521e07960d4de93205c8 (diff) | |
| parent | 0ea498aa9fc7ddf696d53fe961d30e63e4d38438 (diff) | |
| download | rust-2a2c29aafa50bf6fe53d66b32070eba59f860ac3.tar.gz rust-2a2c29aafa50bf6fe53d66b32070eba59f860ac3.zip | |
Auto merge of #125759 - nnethercote:format-some-tests, r=GuillaumeGomez
Format some tests There are more directories under `tests/` still to do, but this is enough for one PR. r? `@GuillaumeGomez`
Diffstat (limited to 'tests/codegen-units/partitioning/vtable-through-const.rs')
| -rw-r--r-- | tests/codegen-units/partitioning/vtable-through-const.rs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/codegen-units/partitioning/vtable-through-const.rs b/tests/codegen-units/partitioning/vtable-through-const.rs index f91c0c0bfdb..a9186cea9c8 100644 --- a/tests/codegen-units/partitioning/vtable-through-const.rs +++ b/tests/codegen-units/partitioning/vtable-through-const.rs @@ -28,20 +28,24 @@ mod mod1 { } impl<T> Trait1Gen<T> for NeedsDrop { - fn do_something(&self, x: T) -> T { x } - fn do_something_else(&self, x: T) -> T { x } + fn do_something(&self, x: T) -> T { + x + } + fn do_something_else(&self, x: T) -> T { + x + } } //~ MONO_ITEM fn mod1::id::<i64> @@ vtable_through_const-mod1.volatile[Internal] - fn id<T>(x: T) -> T { x } + fn id<T>(x: T) -> T { + x + } // These are referenced, so they produce mono-items (see start()) pub const TRAIT1_REF: &'static Trait1 = &NeedsDrop as &Trait1; pub const TRAIT1_GEN_REF: &'static Trait1Gen<u8> = &NeedsDrop as &Trait1Gen<u8>; pub const ID_CHAR: fn(char) -> char = id::<char>; - - pub trait Trait2 { fn do_something(&self) {} fn do_something_else(&self) {} @@ -57,8 +61,12 @@ mod mod1 { } impl<T> Trait2Gen<T> for NeedsDrop { - fn do_something(&self, x: T) -> T { x } - fn do_something_else(&self, x: T) -> T { x } + fn do_something(&self, x: T) -> T { + x + } + fn do_something_else(&self, x: T) -> T { + x + } } // These are not referenced, so they do not produce mono-items |
