-
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.
- Loading branch information
1 parent
ec94480
commit 0ad160a
Showing
8 changed files
with
71 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -929,6 +929,7 @@ symbols! { | |
lib, | ||
libc, | ||
lifetime, | ||
lifetime_capture_rules_2024, | ||
lifetimes, | ||
likely, | ||
line, | ||
|
6 changes: 6 additions & 0 deletions
6
tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.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,6 @@ | ||
fn foo(x: &Vec<i32>) -> impl Sized { | ||
x | ||
//~^ ERROR hidden type for `impl Sized` captures lifetime that does not appear in bounds | ||
} | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.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,18 @@ | ||
error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds | ||
--> $DIR/feature-gate-lifetime-capture-rules-2024.rs:2:5 | ||
| | ||
LL | fn foo(x: &Vec<i32>) -> impl Sized { | ||
| --------- ---------- opaque type defined here | ||
| | | ||
| hidden type `&Vec<i32>` captures the anonymous lifetime defined here | ||
LL | x | ||
| ^ | ||
| | ||
help: to declare that `impl Sized` captures `'_`, you can add an explicit `'_` lifetime bound | ||
| | ||
LL | fn foo(x: &Vec<i32>) -> impl Sized + '_ { | ||
| ++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0700`. |
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,26 @@ | ||
error: [*, o] | ||
--> $DIR/variance.rs:12:36 | ||
| | ||
LL | fn not_captured_early<'a: 'a>() -> impl Sized {} | ||
| ^^^^^^^^^^ | ||
|
||
error: [*, o] | ||
--> $DIR/variance.rs:16:32 | ||
| | ||
LL | fn captured_early<'a: 'a>() -> impl Sized + Captures<'a> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: [o] | ||
--> $DIR/variance.rs:18:40 | ||
| | ||
LL | fn not_captured_late<'a>(_: &'a ()) -> impl Sized {} | ||
| ^^^^^^^^^^ | ||
|
||
error: [o] | ||
--> $DIR/variance.rs:22:36 | ||
| | ||
LL | fn captured_late<'a>(_: &'a ()) -> impl Sized + Captures<'a> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
8 changes: 4 additions & 4 deletions
8
tests/ui/impl-trait/variance.stderr → tests/ui/impl-trait/variance.old.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
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