forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#104508 - compiler-errors:dyn-return, r=oli-obk
Check `dyn*` return type correctly In `check_fn`, if the declared return type is `dyn Trait`, then we check the return type separately to produce better diagnostics, because this is never valid -- however, when `dyn*` was introduced, this check was never adjusted to only account for *unsized* `dyn Trait` and not *sized* `dyn* Trait`. Fixes rust-lang#104501
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// check-pass | ||
|
||
#![feature(dyn_star)] | ||
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes | ||
|
||
fn _foo() -> dyn* Unpin { | ||
4usize | ||
} | ||
|
||
fn main() {} |
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,11 @@ | ||
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/return.rs:3:12 | ||
| | ||
LL | #![feature(dyn_star)] | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|