diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-28 01:28:32 +0000 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-03-04 17:45:18 +0000 | 
| commit | 3d62b279ddc2095b94aa5921540b27f3003365ff (patch) | |
| tree | 5444523a2fbfeceb8165ab86e2b5d64e7a76338c /tests/ui/specialization/defaultimpl/validation.rs | |
| parent | fd17deacce374a4185c882795be162e17b557050 (diff) | |
| download | rust-3d62b279ddc2095b94aa5921540b27f3003365ff.tar.gz rust-3d62b279ddc2095b94aa5921540b27f3003365ff.zip  | |
Ensure that negative auto impls are always applicable
Diffstat (limited to 'tests/ui/specialization/defaultimpl/validation.rs')
| -rw-r--r-- | tests/ui/specialization/defaultimpl/validation.rs | 15 | 
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/ui/specialization/defaultimpl/validation.rs b/tests/ui/specialization/defaultimpl/validation.rs index 4049c4ea14c..14771be8982 100644 --- a/tests/ui/specialization/defaultimpl/validation.rs +++ b/tests/ui/specialization/defaultimpl/validation.rs @@ -6,12 +6,17 @@ struct Z; default impl S {} //~ ERROR inherent impls cannot be `default` -default unsafe impl Send for S {} //~ ERROR impls of auto traits cannot be default -//~^ ERROR `S` cannot be sent between threads safely -default impl !Send for Z {} //~ ERROR impls of auto traits cannot be default - //~^ ERROR negative impls cannot be default impls +default unsafe impl Send for S {} +//~^ ERROR impls of auto traits cannot be default + +default impl !Send for Z {} +//~^ ERROR impls of auto traits cannot be default +//~| ERROR negative impls cannot be default impls +//~| ERROR `!Send` impl requires `Z: Send` but the struct it is implemented for does not trait Tr {} -default impl !Tr for S {} //~ ERROR negative impls cannot be default impls + +default impl !Tr for S {} +//~^ ERROR negative impls cannot be default impls fn main() {}  | 
