File tree 5 files changed +12
-12
lines changed
compiler/rustc_lint_defs/src
tests/ui/associated-consts
5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -4615,7 +4615,7 @@ declare_lint! {
4615
4615
/// [against]: https://github.com/rust-lang/rust/issues/38831
4616
4616
/// [future-incompatible]: ../index.md#future-incompatible-lints
4617
4617
pub ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT ,
4618
- Warn ,
4618
+ Deny ,
4619
4619
"elided lifetimes cannot be used in associated constants in impls" ,
4620
4620
@future_incompatible = FutureIncompatibleInfo {
4621
4621
reason: FutureIncompatibilityReason :: FutureReleaseErrorDontReportInDeps ,
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ struct S;
2
2
3
3
impl S {
4
4
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
6
8
//~| 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
8
9
//~| 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
10
10
}
11
11
12
12
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- warning : `&` without an explicit lifetime name cannot be used here
1
+ error : `&` without an explicit lifetime name cannot be used here
2
2
--> $DIR/double-elided.rs:4:14
3
3
|
4
4
LL | const C: &&str = &"";
5
5
| ^
6
6
|
7
7
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8
8
= 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
10
10
help: use the `'static` lifetime
11
11
|
12
12
LL | const C: &'static &str = &"";
13
13
| +++++++
14
14
15
- warning : `&` without an explicit lifetime name cannot be used here
15
+ error : `&` without an explicit lifetime name cannot be used here
16
16
--> $DIR/double-elided.rs:4:15
17
17
|
18
18
LL | const C: &&str = &"";
@@ -42,6 +42,6 @@ note: but the referenced data is only valid for the anonymous lifetime as define
42
42
LL | const C: &&str = &"";
43
43
| ^
44
44
45
- error: aborting due to 1 previous error; 2 warnings emitted
45
+ error: aborting due to 3 previous errors
46
46
47
47
For more information about this error, try `rustc --explain E0491`.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ trait Trait {
5
5
impl Trait for ( ) {
6
6
const ASSOC : & dyn Fn ( _) = 1i32 ;
7
7
//~^ 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
9
9
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
10
10
}
11
11
Original file line number Diff line number Diff line change 1
- warning : `&` without an explicit lifetime name cannot be used here
1
+ error : `&` without an explicit lifetime name cannot be used here
2
2
--> $DIR/infer-placeholder-in-non-suggestable-pos.rs:6:18
3
3
|
4
4
LL | const ASSOC: &dyn Fn(_) = 1i32;
5
5
| ^
6
6
|
7
7
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8
8
= 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
10
10
help: use the `'static` lifetime
11
11
|
12
12
LL | const ASSOC: &'static dyn Fn(_) = 1i32;
@@ -18,6 +18,6 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
18
18
LL | const ASSOC: &dyn Fn(_) = 1i32;
19
19
| ^ not allowed in type signatures
20
20
21
- error: aborting due to 1 previous error; 1 warning emitted
21
+ error: aborting due to 2 previous errors
22
22
23
23
For more information about this error, try `rustc --explain E0121`.
You can’t perform that action at this time.
0 commit comments