diff options
Diffstat (limited to 'tests/ui/suggestions/issue-114797-bad-parentheses-dyn-trait.rs')
-rw-r--r-- | tests/ui/suggestions/issue-114797-bad-parentheses-dyn-trait.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/suggestions/issue-114797-bad-parentheses-dyn-trait.rs b/tests/ui/suggestions/issue-114797-bad-parentheses-dyn-trait.rs new file mode 100644 index 000000000..8a1939bcf --- /dev/null +++ b/tests/ui/suggestions/issue-114797-bad-parentheses-dyn-trait.rs @@ -0,0 +1,17 @@ +//run-rustfix +#![allow(dead_code)] + +trait Trait {} + +fn assert_send(ptr: *mut dyn Trait) -> *mut dyn (Trait + Send) { + //~^ ERROR incorrect parentheses around trait bounds + ptr as _ +} + +fn foo2(_: &dyn (Trait + Send)) {} +//~^ ERROR incorrect parentheses around trait bounds + +fn foo3(_: &dyn(Trait + Send)) {} +//~^ ERROR incorrect parentheses around trait bounds + +fn main() {} |