mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
In edition 2024, gen is a reserved keyword
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use std::fmt::Debug;
|
||||
use std::ops::*;
|
||||
|
||||
fn gen() -> impl PartialOrd + Debug {}
|
||||
fn r#gen() -> impl PartialOrd + Debug {}
|
||||
|
||||
struct Bar {}
|
||||
trait Foo<T = Self> {}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use std::fmt::Debug;
|
||||
use std::ops::*;
|
||||
|
||||
fn gen() -> impl PartialOrd + PartialEq + Debug {}
|
||||
fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
|
||||
|
||||
struct Bar {}
|
||||
trait Foo<T = Self> {}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
error: this bound is already specified as the supertrait of `PartialOrd`
|
||||
--> tests/ui/crashes/ice-11422.rs:6:31
|
||||
--> tests/ui/crashes/ice-11422.rs:6:33
|
||||
|
|
||||
LL | fn gen() -> impl PartialOrd + PartialEq + Debug {}
|
||||
| ^^^^^^^^^
|
||||
LL | fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::implied-bounds-in-impls` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(clippy::implied_bounds_in_impls)]`
|
||||
help: try removing this bound
|
||||
|
|
||||
LL - fn gen() -> impl PartialOrd + PartialEq + Debug {}
|
||||
LL + fn gen() -> impl PartialOrd + Debug {}
|
||||
LL - fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
|
||||
LL + fn r#gen() -> impl PartialOrd + Debug {}
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -70,7 +70,7 @@ pub fn map<S: ::std::hash::BuildHasher>(map: &mut HashMap<i32, i32, S>) {}
|
||||
pub fn set<S: ::std::hash::BuildHasher>(set: &mut HashSet<i32, S>) {}
|
||||
|
||||
#[inline_macros]
|
||||
pub mod gen {
|
||||
pub mod gen_ {
|
||||
use super::*;
|
||||
inline! {
|
||||
impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
|
||||
|
||||
@@ -70,7 +70,7 @@ pub fn map(map: &mut HashMap<i32, i32>) {}
|
||||
pub fn set(set: &mut HashSet<i32>) {}
|
||||
|
||||
#[inline_macros]
|
||||
pub mod gen {
|
||||
pub mod gen_ {
|
||||
use super::*;
|
||||
inline! {
|
||||
impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
|
||||
|
||||
@@ -98,7 +98,7 @@ error: impl for `HashMap` should be generalized over different hashers
|
||||
LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the macro `__inline_mac_mod_gen` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `__inline_mac_mod_gen_` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: add a type parameter for `BuildHasher`
|
||||
|
|
||||
LL ~ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
|
||||
|
||||
@@ -14,7 +14,7 @@ fn do_something_interesting(x: usize, y: usize) -> usize {
|
||||
todo!()
|
||||
}
|
||||
|
||||
macro_rules! gen {
|
||||
macro_rules! r#gen {
|
||||
() => {
|
||||
(0..10).map(|_| do_something());
|
||||
};
|
||||
@@ -45,7 +45,7 @@ fn main() {
|
||||
std::iter::repeat_with(|| do_something()).take(1);
|
||||
std::iter::repeat_with(|| do_something()).take((1 << 4) - 0);
|
||||
// These should not be raised
|
||||
gen!();
|
||||
r#gen!();
|
||||
let lower = 2;
|
||||
let lower_fn = || 2;
|
||||
(lower..upper_fn()).map(|_| do_something()); // Ranges not starting at zero not yet handled
|
||||
|
||||
@@ -14,7 +14,7 @@ fn do_something_interesting(x: usize, y: usize) -> usize {
|
||||
todo!()
|
||||
}
|
||||
|
||||
macro_rules! gen {
|
||||
macro_rules! r#gen {
|
||||
() => {
|
||||
(0..10).map(|_| do_something());
|
||||
};
|
||||
@@ -45,7 +45,7 @@ fn main() {
|
||||
(9..=9).map(|_| do_something());
|
||||
(1..=1 << 4).map(|_| do_something());
|
||||
// These should not be raised
|
||||
gen!();
|
||||
r#gen!();
|
||||
let lower = 2;
|
||||
let lower_fn = || 2;
|
||||
(lower..upper_fn()).map(|_| do_something()); // Ranges not starting at zero not yet handled
|
||||
|
||||
Reference in New Issue
Block a user