diff options
| author | Ryan Levick <me@ryanlevick.com> | 2021-06-29 16:53:44 +0200 |
|---|---|---|
| committer | Ryan Levick <me@ryanlevick.com> | 2021-07-06 20:11:45 +0200 |
| commit | ecca9a8b1aecd6675d995e89ea2f93635b05500a (patch) | |
| tree | 8bf60f47d155fa7f958be4eedc166bb5381d8f36 | |
| parent | 1d49658f5c7adc403311b815c9ec8d23e4551de2 (diff) | |
| download | rust-ecca9a8b1aecd6675d995e89ea2f93635b05500a.tar.gz rust-ecca9a8b1aecd6675d995e89ea2f93635b05500a.zip | |
Add s to FUTURE_PRELUDE_COLLISION
17 files changed, 30 insertions, 28 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index ed39815ff56..a276cb14acb 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -2972,7 +2972,7 @@ declare_lint_pass! { PROC_MACRO_BACK_COMPAT, RUST_2021_INCOMPATIBLE_OR_PATTERNS, LARGE_ASSIGNMENTS, - FUTURE_PRELUDE_COLLISION, + FUTURE_PRELUDE_COLLISIONS, RESERVED_PREFIX, UNSUPPORTED_CALLING_CONVENTIONS, ] @@ -3221,13 +3221,13 @@ declare_lint! { } declare_lint! { - /// The `future_prelude_collision` lint detects the usage of trait methods which are ambiguous + /// The `future_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_collision)] + /// #![deny(future_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_COLLISION, + pub FUTURE_PRELUDE_COLLISIONS, Allow, "detects the usage of trait methods which are ambiguous with traits added to the \ prelude in future editions", diff --git a/compiler/rustc_typeck/src/check/method/prelude2021.rs b/compiler/rustc_typeck/src/check/method/prelude2021.rs index e8748dd062f..cf17ff2eab5 100644 --- a/compiler/rustc_typeck/src/check/method/prelude2021.rs +++ b/compiler/rustc_typeck/src/check/method/prelude2021.rs @@ -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_COLLISION; +use rustc_session::lint::builtin::FUTURE_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_COLLISION, + FUTURE_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_COLLISION, + FUTURE_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_COLLISION, expr_id, span, |lint| { + self.tcx.struct_span_lint_hir(FUTURE_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()); diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.fixed b/src/test/ui/rust-2021/future-prelude-collision-imported.fixed index 725d5aa234e..e37b4cd0960 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-imported.fixed +++ b/src/test/ui/rust-2021/future-prelude-collision-imported.fixed @@ -1,7 +1,7 @@ // run-rustfix // edition:2018 // check-pass -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] #![allow(dead_code)] #![allow(unused_imports)] diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.rs b/src/test/ui/rust-2021/future-prelude-collision-imported.rs index 6ca9a919f3c..a560c4b92e1 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-imported.rs +++ b/src/test/ui/rust-2021/future-prelude-collision-imported.rs @@ -1,7 +1,7 @@ // run-rustfix // edition:2018 // check-pass -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] #![allow(dead_code)] #![allow(unused_imports)] diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr index 8889485c917..da455f2d15a 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr +++ b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr @@ -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_collision)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![warn(future_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> diff --git a/src/test/ui/rust-2021/future-prelude-collision-shadow.rs b/src/test/ui/rust-2021/future-prelude-collision-shadow.rs index c9d2529341f..7e64f9ae7bf 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-shadow.rs +++ b/src/test/ui/rust-2021/future-prelude-collision-shadow.rs @@ -1,5 +1,5 @@ // edition:2018 -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] #![allow(dead_code)] #![allow(unused_imports)] diff --git a/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs b/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs index a4a5b6667df..1c809d0ba09 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs +++ b/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs @@ -1,12 +1,14 @@ // edition:2018 // check-pass #![allow(unused)] -#![deny(future_prelude_collision)] +#![deny(future_prelude_collisions)] struct S; impl S { - fn try_into(self) -> S { S } + fn try_into(self) -> S { + S + } } // See https://github.com/rust-lang/rust/issues/86633 diff --git a/src/test/ui/rust-2021/future-prelude-collision.fixed b/src/test/ui/rust-2021/future-prelude-collision.fixed index 4bcbe6b094a..c8f29c325d9 100644 --- a/src/test/ui/rust-2021/future-prelude-collision.fixed +++ b/src/test/ui/rust-2021/future-prelude-collision.fixed @@ -1,7 +1,7 @@ // run-rustfix // edition:2018 // check-pass -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] trait TryIntoU32 { fn try_into(self) -> Result<u32, ()>; diff --git a/src/test/ui/rust-2021/future-prelude-collision.rs b/src/test/ui/rust-2021/future-prelude-collision.rs index bc23a8a92a6..7059535b877 100644 --- a/src/test/ui/rust-2021/future-prelude-collision.rs +++ b/src/test/ui/rust-2021/future-prelude-collision.rs @@ -1,7 +1,7 @@ // run-rustfix // edition:2018 // check-pass -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] trait TryIntoU32 { fn try_into(self) -> Result<u32, ()>; diff --git a/src/test/ui/rust-2021/future-prelude-collision.stderr b/src/test/ui/rust-2021/future-prelude-collision.stderr index e167468ab19..46e52baf838 100644 --- a/src/test/ui/rust-2021/future-prelude-collision.stderr +++ b/src/test/ui/rust-2021/future-prelude-collision.stderr @@ -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_collision)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![warn(future_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> diff --git a/src/test/ui/rust-2021/generic-type-collision.fixed b/src/test/ui/rust-2021/generic-type-collision.fixed index d1a085f23a0..9851a1d42b6 100644 --- a/src/test/ui/rust-2021/generic-type-collision.fixed +++ b/src/test/ui/rust-2021/generic-type-collision.fixed @@ -1,7 +1,7 @@ // check-pass // run-rustfix // edition 2018 -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] trait MyTrait<A> { fn from_iter(x: Option<A>); diff --git a/src/test/ui/rust-2021/generic-type-collision.rs b/src/test/ui/rust-2021/generic-type-collision.rs index 5069fba396e..18deaa55cfe 100644 --- a/src/test/ui/rust-2021/generic-type-collision.rs +++ b/src/test/ui/rust-2021/generic-type-collision.rs @@ -1,7 +1,7 @@ // check-pass // run-rustfix // edition 2018 -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] trait MyTrait<A> { fn from_iter(x: Option<A>); diff --git a/src/test/ui/rust-2021/generic-type-collision.stderr b/src/test/ui/rust-2021/generic-type-collision.stderr index 05591c3d448..1839c3e7279 100644 --- a/src/test/ui/rust-2021/generic-type-collision.stderr +++ b/src/test/ui/rust-2021/generic-type-collision.stderr @@ -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_collision)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![warn(future_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> diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.fixed b/src/test/ui/rust-2021/inherent-dyn-collision.fixed index cf6287a758f..d6be9e56f96 100644 --- a/src/test/ui/rust-2021/inherent-dyn-collision.fixed +++ b/src/test/ui/rust-2021/inherent-dyn-collision.fixed @@ -5,7 +5,7 @@ // run-rustfix // edition:2018 -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] trait TryIntoU32 { fn try_into(&self) -> Result<u32, ()>; diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.rs b/src/test/ui/rust-2021/inherent-dyn-collision.rs index 0349ad5b641..67be6157d45 100644 --- a/src/test/ui/rust-2021/inherent-dyn-collision.rs +++ b/src/test/ui/rust-2021/inherent-dyn-collision.rs @@ -5,7 +5,7 @@ // run-rustfix // edition:2018 -#![warn(future_prelude_collision)] +#![warn(future_prelude_collisions)] trait TryIntoU32 { fn try_into(&self) -> Result<u32, ()>; diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.stderr b/src/test/ui/rust-2021/inherent-dyn-collision.stderr index 9e95419715e..4d7a04735ac 100644 --- a/src/test/ui/rust-2021/inherent-dyn-collision.stderr +++ b/src/test/ui/rust-2021/inherent-dyn-collision.stderr @@ -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_collision)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![warn(future_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> diff --git a/src/test/ui/rust-2021/inherent-method-collision.rs b/src/test/ui/rust-2021/inherent-method-collision.rs index c638351d5fc..f99d98bd890 100644 --- a/src/test/ui/rust-2021/inherent-method-collision.rs +++ b/src/test/ui/rust-2021/inherent-method-collision.rs @@ -2,7 +2,7 @@ // // check-pass -#![deny(future_prelude_collision)] +#![deny(future_prelude_collisions)] pub struct MySeq {} |
