-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow use<> syntax in RPITIT, fix test example
- Loading branch information
1 parent
b56a74f
commit 9b53b64
Showing
19 changed files
with
165 additions
and
128 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
//@ compile-flags: -Zunstable-options --edition=2024 | ||
//@ revisions: normal rpitit | ||
//@[normal] check-pass | ||
//@ check-pass | ||
|
||
#![feature(precise_capturing)] | ||
|
||
fn hello<'a>() -> impl Sized + use<'a> {} | ||
//[normal]~^ WARN all possible in-scope parameters are already captured | ||
//~^ WARN all possible in-scope parameters are already captured | ||
|
||
struct Inherent; | ||
impl Inherent { | ||
fn inherent(&self) -> impl Sized + use<'_> {} | ||
//[normal]~^ WARN all possible in-scope parameters are already captured | ||
//~^ WARN all possible in-scope parameters are already captured | ||
} | ||
|
||
#[cfg(rpitit)] | ||
trait Test<'a> { | ||
fn in_trait() -> impl Sized + use<'a, Self>; | ||
//[rpitit]~^ ERROR `use<...>` precise capturing syntax is currently not allowed in return-position `impl Trait` in traits | ||
//~^ WARN all possible in-scope parameters are already captured | ||
} | ||
#[cfg(rpitit)] | ||
impl<'a> Test<'a> for () { | ||
fn in_trait() -> impl Sized + use<'a> {} | ||
//[rpitit]~^ ERROR `use<...>` precise capturing syntax is currently not allowed in return-position `impl Trait` in traits | ||
//~^ WARN all possible in-scope parameters are already captured | ||
} | ||
|
||
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,36 @@ | ||
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant | ||
--> $DIR/redundant.rs:6:19 | ||
| | ||
LL | fn hello<'a>() -> impl Sized + use<'a> {} | ||
| ^^^^^^^^^^^^^------- | ||
| | | ||
| help: remove the `use<...>` syntax | ||
| | ||
= note: `#[warn(impl_trait_redundant_captures)]` on by default | ||
|
||
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant | ||
--> $DIR/redundant.rs:11:27 | ||
| | ||
LL | fn inherent(&self) -> impl Sized + use<'_> {} | ||
| ^^^^^^^^^^^^^------- | ||
| | | ||
| help: remove the `use<...>` syntax | ||
|
||
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant | ||
--> $DIR/redundant.rs:16:22 | ||
| | ||
LL | fn in_trait() -> impl Sized + use<'a, Self>; | ||
| ^^^^^^^^^^^^^------------- | ||
| | | ||
| help: remove the `use<...>` syntax | ||
|
||
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant | ||
--> $DIR/redundant.rs:20:22 | ||
| | ||
LL | fn in_trait() -> impl Sized + use<'a> {} | ||
| ^^^^^^^^^^^^^------- | ||
| | | ||
| help: remove the `use<...>` syntax | ||
|
||
warning: 4 warnings emitted | ||
|
Oops, something went wrong.