Skip to content

Commit 941eb2a

Browse files
committed
Rename future_prelude_collisions to rust_2021_prelude_collisions
1 parent 81c11a2 commit 941eb2a

17 files changed

+27
-27
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2972,7 +2972,7 @@ declare_lint_pass! {
29722972
PROC_MACRO_BACK_COMPAT,
29732973
RUST_2021_INCOMPATIBLE_OR_PATTERNS,
29742974
LARGE_ASSIGNMENTS,
2975-
FUTURE_PRELUDE_COLLISIONS,
2975+
RUST_2021_PRELUDE_COLLISIONS,
29762976
RUST_2021_TOKEN_PREFIXES,
29772977
UNSUPPORTED_CALLING_CONVENTIONS,
29782978
]
@@ -3221,13 +3221,13 @@ declare_lint! {
32213221
}
32223222

32233223
declare_lint! {
3224-
/// The `future_prelude_collisions` lint detects the usage of trait methods which are ambiguous
3224+
/// The `rust_2021_prelude_collisions` lint detects the usage of trait methods which are ambiguous
32253225
/// with traits added to the prelude in future editions.
32263226
///
32273227
/// ### Example
32283228
///
32293229
/// ```rust,compile_fail
3230-
/// #![deny(future_prelude_collisions)]
3230+
/// #![deny(rust_2021_prelude_collisions)]
32313231
///
32323232
/// trait Foo {
32333233
/// fn try_into(self) -> Result<String, !>;
@@ -3259,7 +3259,7 @@ declare_lint! {
32593259
/// is called directly on a type.
32603260
///
32613261
/// [prelude changes]: https://blog.rust-lang.org/inside-rust/2021/03/04/planning-rust-2021.html#prelude-changes
3262-
pub FUTURE_PRELUDE_COLLISIONS,
3262+
pub RUST_2021_PRELUDE_COLLISIONS,
32633263
Allow,
32643264
"detects the usage of trait methods which are ambiguous with traits added to the \
32653265
prelude in future editions",

compiler/rustc_typeck/src/check/method/prelude2021.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_ast::Mutability;
55
use rustc_errors::Applicability;
66
use rustc_hir as hir;
77
use rustc_middle::ty::{Ref, Ty};
8-
use rustc_session::lint::builtin::FUTURE_PRELUDE_COLLISIONS;
8+
use rustc_session::lint::builtin::RUST_2021_PRELUDE_COLLISIONS;
99
use rustc_span::symbol::kw::Underscore;
1010
use rustc_span::symbol::{sym, Ident};
1111
use rustc_span::Span;
@@ -67,7 +67,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
6767
// Inherent impls only require not relying on autoref and autoderef in order to
6868
// ensure that the trait implementation won't be used
6969
self.tcx.struct_span_lint_hir(
70-
FUTURE_PRELUDE_COLLISIONS,
70+
RUST_2021_PRELUDE_COLLISIONS,
7171
self_expr.hir_id,
7272
self_expr.span,
7373
|lint| {
@@ -128,7 +128,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
128128
// trait implementations require full disambiguation to not clash with the new prelude
129129
// additions (i.e. convert from dot-call to fully-qualified call)
130130
self.tcx.struct_span_lint_hir(
131-
FUTURE_PRELUDE_COLLISIONS,
131+
RUST_2021_PRELUDE_COLLISIONS,
132132
call_expr.hir_id,
133133
call_expr.span,
134134
|lint| {
@@ -212,7 +212,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
212212
return;
213213
}
214214

215-
self.tcx.struct_span_lint_hir(FUTURE_PRELUDE_COLLISIONS, expr_id, span, |lint| {
215+
self.tcx.struct_span_lint_hir(RUST_2021_PRELUDE_COLLISIONS, expr_id, span, |lint| {
216216
// "type" refers to either a type or, more likely, a trait from which
217217
// the associated function or method is from.
218218
let trait_path = self.trait_path_or_bare_name(span, expr_id, pick.item.container.id());

src/test/ui/rust-2021/future-prelude-collision-imported.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22
// edition:2018
33
// check-pass
4-
#![warn(future_prelude_collisions)]
4+
#![warn(rust_2021_prelude_collisions)]
55
#![allow(dead_code)]
66
#![allow(unused_imports)]
77

src/test/ui/rust-2021/future-prelude-collision-imported.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22
// edition:2018
33
// check-pass
4-
#![warn(future_prelude_collisions)]
4+
#![warn(rust_2021_prelude_collisions)]
55
#![allow(dead_code)]
66
#![allow(unused_imports)]
77

src/test/ui/rust-2021/future-prelude-collision-imported.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | let _: u32 = 3u8.try_into().unwrap();
77
note: the lint level is defined here
88
--> $DIR/future-prelude-collision-imported.rs:4:9
99
|
10-
LL | #![warn(future_prelude_collisions)]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![warn(rust_2021_prelude_collisions)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
1313
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
1414

src/test/ui/rust-2021/future-prelude-collision-shadow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// edition:2018
2-
#![warn(future_prelude_collisions)]
2+
#![warn(rust_2021_prelude_collisions)]
33
#![allow(dead_code)]
44
#![allow(unused_imports)]
55

src/test/ui/rust-2021/future-prelude-collision-unneeded.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// edition:2018
22
// check-pass
33
#![allow(unused)]
4-
#![deny(future_prelude_collisions)]
4+
#![deny(rust_2021_prelude_collisions)]
55

66
struct S;
77

src/test/ui/rust-2021/future-prelude-collision.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22
// edition:2018
33
// check-pass
4-
#![warn(future_prelude_collisions)]
4+
#![warn(rust_2021_prelude_collisions)]
55

66
trait TryIntoU32 {
77
fn try_into(self) -> Result<u32, ()>;

src/test/ui/rust-2021/future-prelude-collision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22
// edition:2018
33
// check-pass
4-
#![warn(future_prelude_collisions)]
4+
#![warn(rust_2021_prelude_collisions)]
55

66
trait TryIntoU32 {
77
fn try_into(self) -> Result<u32, ()>;

src/test/ui/rust-2021/future-prelude-collision.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | let _: u32 = 3u8.try_into().unwrap();
77
note: the lint level is defined here
88
--> $DIR/future-prelude-collision.rs:4:9
99
|
10-
LL | #![warn(future_prelude_collisions)]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![warn(rust_2021_prelude_collisions)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
1313
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
1414

src/test/ui/rust-2021/generic-type-collision.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// check-pass
22
// run-rustfix
33
// edition 2018
4-
#![warn(future_prelude_collisions)]
4+
#![warn(rust_2021_prelude_collisions)]
55

66
trait MyTrait<A> {
77
fn from_iter(x: Option<A>);

src/test/ui/rust-2021/generic-type-collision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// check-pass
22
// run-rustfix
33
// edition 2018
4-
#![warn(future_prelude_collisions)]
4+
#![warn(rust_2021_prelude_collisions)]
55

66
trait MyTrait<A> {
77
fn from_iter(x: Option<A>);

src/test/ui/rust-2021/generic-type-collision.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | <Vec<i32>>::from_iter(None);
77
note: the lint level is defined here
88
--> $DIR/generic-type-collision.rs:4:9
99
|
10-
LL | #![warn(future_prelude_collisions)]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![warn(rust_2021_prelude_collisions)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
1313
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
1414

src/test/ui/rust-2021/inherent-dyn-collision.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// run-rustfix
66
// edition:2018
77

8-
#![warn(future_prelude_collisions)]
8+
#![warn(rust_2021_prelude_collisions)]
99

1010
trait TryIntoU32 {
1111
fn try_into(&self) -> Result<u32, ()>;

src/test/ui/rust-2021/inherent-dyn-collision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// run-rustfix
66
// edition:2018
77

8-
#![warn(future_prelude_collisions)]
8+
#![warn(rust_2021_prelude_collisions)]
99

1010
trait TryIntoU32 {
1111
fn try_into(&self) -> Result<u32, ()>;

src/test/ui/rust-2021/inherent-dyn-collision.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ LL | get_dyn_trait().try_into().unwrap()
77
note: the lint level is defined here
88
--> $DIR/inherent-dyn-collision.rs:8:9
99
|
10-
LL | #![warn(future_prelude_collisions)]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | #![warn(rust_2021_prelude_collisions)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
1313
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
1414

src/test/ui/rust-2021/inherent-method-collision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// check-pass
44

5-
#![deny(future_prelude_collisions)]
5+
#![deny(rust_2021_prelude_collisions)]
66

77
pub struct MySeq {}
88

0 commit comments

Comments
 (0)