In edition 2024, gen is a reserved keyword

This commit is contained in:
Samuel Tardieu
2025-01-13 15:54:02 +01:00
parent a73166872d
commit 0456e4d6a1
8 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -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> {}
+1 -1
View File
@@ -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> {}
+5 -5
View File
@@ -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
+1 -1
View File
@@ -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> {
+1 -1
View File
@@ -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> {
+1 -1
View File
@@ -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