Rename future_prelude_collisions to rust_2021_prelude_collisions

This commit is contained in:
Ryan Levick 2021-07-01 13:35:33 +02:00
parent 81c11a212e
commit 941eb2adbd
17 changed files with 27 additions and 27 deletions

View File

@ -2972,7 +2972,7 @@ declare_lint_pass! {
PROC_MACRO_BACK_COMPAT,
RUST_2021_INCOMPATIBLE_OR_PATTERNS,
LARGE_ASSIGNMENTS,
FUTURE_PRELUDE_COLLISIONS,
RUST_2021_PRELUDE_COLLISIONS,
RUST_2021_TOKEN_PREFIXES,
UNSUPPORTED_CALLING_CONVENTIONS,
]
@ -3221,13 +3221,13 @@ declare_lint! {
}
declare_lint! {
/// The `future_prelude_collisions` lint detects the usage of trait methods which are ambiguous
/// The `rust_2021_prelude_collisions` lint detects the usage of trait methods which are ambiguous
/// with traits added to the prelude in future editions.
///
/// ### Example
///
/// ```rust,compile_fail
/// #![deny(future_prelude_collisions)]
/// #![deny(rust_2021_prelude_collisions)]
///
/// trait Foo {
/// fn try_into(self) -> Result<String, !>;
@ -3259,7 +3259,7 @@ declare_lint! {
/// is called directly on a type.
///
/// [prelude changes]: https://blog.rust-lang.org/inside-rust/2021/03/04/planning-rust-2021.html#prelude-changes
pub FUTURE_PRELUDE_COLLISIONS,
pub RUST_2021_PRELUDE_COLLISIONS,
Allow,
"detects the usage of trait methods which are ambiguous with traits added to the \
prelude in future editions",

View File

@ -5,7 +5,7 @@ use rustc_ast::Mutability;
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_middle::ty::{Ref, Ty};
use rustc_session::lint::builtin::FUTURE_PRELUDE_COLLISIONS;
use rustc_session::lint::builtin::RUST_2021_PRELUDE_COLLISIONS;
use rustc_span::symbol::kw::Underscore;
use rustc_span::symbol::{sym, Ident};
use rustc_span::Span;
@ -67,7 +67,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Inherent impls only require not relying on autoref and autoderef in order to
// ensure that the trait implementation won't be used
self.tcx.struct_span_lint_hir(
FUTURE_PRELUDE_COLLISIONS,
RUST_2021_PRELUDE_COLLISIONS,
self_expr.hir_id,
self_expr.span,
|lint| {
@ -128,7 +128,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// trait implementations require full disambiguation to not clash with the new prelude
// additions (i.e. convert from dot-call to fully-qualified call)
self.tcx.struct_span_lint_hir(
FUTURE_PRELUDE_COLLISIONS,
RUST_2021_PRELUDE_COLLISIONS,
call_expr.hir_id,
call_expr.span,
|lint| {
@ -212,7 +212,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
return;
}
self.tcx.struct_span_lint_hir(FUTURE_PRELUDE_COLLISIONS, expr_id, span, |lint| {
self.tcx.struct_span_lint_hir(RUST_2021_PRELUDE_COLLISIONS, expr_id, span, |lint| {
// "type" refers to either a type or, more likely, a trait from which
// the associated function or method is from.
let trait_path = self.trait_path_or_bare_name(span, expr_id, pick.item.container.id());

View File

@ -1,7 +1,7 @@
// run-rustfix
// edition:2018
// check-pass
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
#![allow(dead_code)]
#![allow(unused_imports)]

View File

@ -1,7 +1,7 @@
// run-rustfix
// edition:2018
// check-pass
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
#![allow(dead_code)]
#![allow(unused_imports)]

View File

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

View File

@ -1,5 +1,5 @@
// edition:2018
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
#![allow(dead_code)]
#![allow(unused_imports)]

View File

@ -1,7 +1,7 @@
// edition:2018
// check-pass
#![allow(unused)]
#![deny(future_prelude_collisions)]
#![deny(rust_2021_prelude_collisions)]
struct S;

View File

@ -1,7 +1,7 @@
// run-rustfix
// edition:2018
// check-pass
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
trait TryIntoU32 {
fn try_into(self) -> Result<u32, ()>;

View File

@ -1,7 +1,7 @@
// run-rustfix
// edition:2018
// check-pass
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
trait TryIntoU32 {
fn try_into(self) -> Result<u32, ()>;

View File

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

View File

@ -1,7 +1,7 @@
// check-pass
// run-rustfix
// edition 2018
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
trait MyTrait<A> {
fn from_iter(x: Option<A>);

View File

@ -1,7 +1,7 @@
// check-pass
// run-rustfix
// edition 2018
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
trait MyTrait<A> {
fn from_iter(x: Option<A>);

View File

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

View File

@ -5,7 +5,7 @@
// run-rustfix
// edition:2018
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
trait TryIntoU32 {
fn try_into(&self) -> Result<u32, ()>;

View File

@ -5,7 +5,7 @@
// run-rustfix
// edition:2018
#![warn(future_prelude_collisions)]
#![warn(rust_2021_prelude_collisions)]
trait TryIntoU32 {
fn try_into(&self) -> Result<u32, ()>;

View File

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

View File

@ -2,7 +2,7 @@
//
// check-pass
#![deny(future_prelude_collisions)]
#![deny(rust_2021_prelude_collisions)]
pub struct MySeq {}