-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap dyn type with parentheses in suggestion
- Loading branch information
1 parent
453ceaf
commit f0114a1
Showing
10 changed files
with
277 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#![feature(dyn_star)] //~ WARNING the feature `dyn_star` is incomplete | ||
|
||
use std::future::Future; | ||
|
||
pub fn dyn_func<T>( | ||
executor: impl FnOnce(T) -> dyn Future<Output = ()>, | ||
) -> Box<dyn FnOnce(T) -> dyn Future<Output = ()>> { | ||
Box::new(executor) //~ ERROR may not live long enough | ||
} | ||
|
||
pub fn dyn_star_func<T>( | ||
executor: impl FnOnce(T) -> dyn* Future<Output = ()>, | ||
) -> Box<dyn FnOnce(T) -> dyn* Future<Output = ()>> { | ||
Box::new(executor) //~ ERROR may not live long enough | ||
} | ||
|
||
pub fn in_ty_param<F: FnOnce() -> &'static dyn std::fmt::Debug>(f: F) { | ||
f(); | ||
f(); //~ ERROR use of moved value | ||
} | ||
|
||
fn with_sized<T: Fn() -> &'static (dyn std::fmt::Debug) + ?Sized>() { | ||
without_sized::<T>(); | ||
//~^ ERROR the size for values of type `T` cannot be known at compilation time | ||
} | ||
|
||
fn without_sized<T: Fn() -> &'static dyn std::fmt::Debug>() {} | ||
|
||
fn main() {} |
Oops, something went wrong.