-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve self type alias in impl for RTN
- Loading branch information
1 parent
c8b06e1
commit b24a7a9
Showing
4 changed files
with
71 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
24 changes: 24 additions & 0 deletions
24
tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.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,24 @@ | ||
//@ check-pass | ||
|
||
#![feature(return_type_notation)] | ||
//~^ WARN the feature `return_type_notation` is incomplete | ||
|
||
trait Trait { | ||
fn method() -> impl Sized; | ||
} | ||
|
||
fn is_send(_: impl Send) {} | ||
|
||
struct W<T>(T); | ||
|
||
impl<T> W<T> { | ||
fn test() | ||
where | ||
T: Trait, | ||
T::method(..): Send, | ||
{ | ||
is_send(T::method()); | ||
} | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.stderr
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 `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/path-constrained-in-method.rs:3:12 | ||
| | ||
LL | #![feature(return_type_notation)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
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