Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit df77ea7

Browse files
Unrolled build for rust-lang#135441
Rollup merge of rust-lang#135441 - compiler-errors:redundant-captures-lint, r=lqd Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024 I never got sign-off on rust-lang#127672 for this lint being warn by default in edition 2024, so let's turn downgrade this lint to allow for now. Should be backported so it ships with the edition. ```@rustbot``` label: +beta-nominated
2 parents 1ab85fb + 1b068a0 commit df77ea7

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

‎compiler/rustc_lint/src/impl_trait_overcaptures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ declare_lint! {
9999
/// To fix this, remove the `use<'a>`, since the lifetime is already captured
100100
/// since it is in scope.
101101
pub IMPL_TRAIT_REDUNDANT_CAPTURES,
102-
Warn,
102+
Allow,
103103
"redundant precise-capturing `use<...>` syntax on an `impl Trait`",
104104
}
105105

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
//@ edition: 2024
2-
//@ check-pass
32

43
#![feature(precise_capturing_in_traits)]
4+
#![deny(impl_trait_redundant_captures)]
55

66
fn hello<'a>() -> impl Sized + use<'a> {}
7-
//~^ WARN all possible in-scope parameters are already captured
7+
//~^ ERROR all possible in-scope parameters are already captured
88

99
struct Inherent;
1010
impl Inherent {
1111
fn inherent(&self) -> impl Sized + use<'_> {}
12-
//~^ WARN all possible in-scope parameters are already captured
12+
//~^ ERROR all possible in-scope parameters are already captured
1313
}
1414

1515
trait Test<'a> {
1616
fn in_trait() -> impl Sized + use<'a, Self>;
17-
//~^ WARN all possible in-scope parameters are already captured
17+
//~^ ERROR all possible in-scope parameters are already captured
1818
}
1919
impl<'a> Test<'a> for () {
2020
fn in_trait() -> impl Sized + use<'a> {}
21-
//~^ WARN all possible in-scope parameters are already captured
21+
//~^ ERROR all possible in-scope parameters are already captured
2222
}
2323

2424
fn main() {}
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
1-
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
1+
error: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
22
--> $DIR/redundant.rs:6:19
33
|
44
LL | fn hello<'a>() -> impl Sized + use<'a> {}
55
| ^^^^^^^^^^^^^-------
66
| |
77
| help: remove the `use<...>` syntax
88
|
9-
= note: `#[warn(impl_trait_redundant_captures)]` on by default
9+
note: the lint level is defined here
10+
--> $DIR/redundant.rs:4:9
11+
|
12+
LL | #![deny(impl_trait_redundant_captures)]
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1014

11-
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
15+
error: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
1216
--> $DIR/redundant.rs:11:27
1317
|
1418
LL | fn inherent(&self) -> impl Sized + use<'_> {}
1519
| ^^^^^^^^^^^^^-------
1620
| |
1721
| help: remove the `use<...>` syntax
1822

19-
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
23+
error: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
2024
--> $DIR/redundant.rs:16:22
2125
|
2226
LL | fn in_trait() -> impl Sized + use<'a, Self>;
2327
| ^^^^^^^^^^^^^-------------
2428
| |
2529
| help: remove the `use<...>` syntax
2630

27-
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
31+
error: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
2832
--> $DIR/redundant.rs:20:22
2933
|
3034
LL | fn in_trait() -> impl Sized + use<'a> {}
3135
| ^^^^^^^^^^^^^-------
3236
| |
3337
| help: remove the `use<...>` syntax
3438

35-
warning: 4 warnings emitted
39+
error: aborting due to 4 previous errors
3640

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /