Skip to content

Commit 24c9e66

Browse files
Bump elided_lifetimes_in_associated_constant
1 parent 54692c3 commit 24c9e66

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Diff for: compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4615,7 +4615,7 @@ declare_lint! {
46154615
/// [against]: https://github.com/rust-lang/rust/issues/38831
46164616
/// [future-incompatible]: ../index.md#future-incompatible-lints
46174617
pub ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT,
4618-
Warn,
4618+
Deny,
46194619
"elided lifetimes cannot be used in associated constants in impls",
46204620
@future_incompatible = FutureIncompatibleInfo {
46214621
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,

Diff for: tests/ui/associated-consts/double-elided.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ struct S;
22

33
impl S {
44
const C: &&str = &"";
5-
//~^ WARN `&` without an explicit lifetime name cannot be used here
5+
//~^ ERROR `&` without an explicit lifetime name cannot be used here
6+
//~| ERROR `&` without an explicit lifetime name cannot be used here
7+
//~| ERROR in type `&&str`, reference has a longer lifetime than the data it references
68
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7-
//~| WARN `&` without an explicit lifetime name cannot be used here
89
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9-
//~| ERROR in type `&&str`, reference has a longer lifetime than the data it references
1010
}
1111

1212
fn main() {}

Diff for: tests/ui/associated-consts/double-elided.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
warning: `&` without an explicit lifetime name cannot be used here
1+
error: `&` without an explicit lifetime name cannot be used here
22
--> $DIR/double-elided.rs:4:14
33
|
44
LL | const C: &&str = &"";
55
| ^
66
|
77
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88
= note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
9-
= note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
9+
= note: `#[deny(elided_lifetimes_in_associated_constant)]` on by default
1010
help: use the `'static` lifetime
1111
|
1212
LL | const C: &'static &str = &"";
1313
| +++++++
1414

15-
warning: `&` without an explicit lifetime name cannot be used here
15+
error: `&` without an explicit lifetime name cannot be used here
1616
--> $DIR/double-elided.rs:4:15
1717
|
1818
LL | const C: &&str = &"";
@@ -42,6 +42,6 @@ note: but the referenced data is only valid for the anonymous lifetime as define
4242
LL | const C: &&str = &"";
4343
| ^
4444

45-
error: aborting due to 1 previous error; 2 warnings emitted
45+
error: aborting due to 3 previous errors
4646

4747
For more information about this error, try `rustc --explain E0491`.

Diff for: tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait Trait {
55
impl Trait for () {
66
const ASSOC: &dyn Fn(_) = 1i32;
77
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated constants
8-
//~| WARN `&` without an explicit lifetime name cannot be used here
8+
//~| ERROR `&` without an explicit lifetime name cannot be used here
99
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1010
}
1111

Diff for: tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
warning: `&` without an explicit lifetime name cannot be used here
1+
error: `&` without an explicit lifetime name cannot be used here
22
--> $DIR/infer-placeholder-in-non-suggestable-pos.rs:6:18
33
|
44
LL | const ASSOC: &dyn Fn(_) = 1i32;
55
| ^
66
|
77
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
88
= note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
9-
= note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
9+
= note: `#[deny(elided_lifetimes_in_associated_constant)]` on by default
1010
help: use the `'static` lifetime
1111
|
1212
LL | const ASSOC: &'static dyn Fn(_) = 1i32;
@@ -18,6 +18,6 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
1818
LL | const ASSOC: &dyn Fn(_) = 1i32;
1919
| ^ not allowed in type signatures
2020

21-
error: aborting due to 1 previous error; 1 warning emitted
21+
error: aborting due to 2 previous errors
2222

2323
For more information about this error, try `rustc --explain E0121`.

0 commit comments

Comments
 (0)