Skip to content

Commit 0456e4d

Browse files
committed
In edition 2024, gen is a reserved keyword
1 parent a731668 commit 0456e4d

8 files changed

+14
-14
lines changed

tests/ui/crashes/ice-11422.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt::Debug;
44
use std::ops::*;
55

6-
fn gen() -> impl PartialOrd + Debug {}
6+
fn r#gen() -> impl PartialOrd + Debug {}
77

88
struct Bar {}
99
trait Foo<T = Self> {}

tests/ui/crashes/ice-11422.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt::Debug;
44
use std::ops::*;
55

6-
fn gen() -> impl PartialOrd + PartialEq + Debug {}
6+
fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
77

88
struct Bar {}
99
trait Foo<T = Self> {}

tests/ui/crashes/ice-11422.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: this bound is already specified as the supertrait of `PartialOrd`
2-
--> tests/ui/crashes/ice-11422.rs:6:31
2+
--> tests/ui/crashes/ice-11422.rs:6:33
33
|
4-
LL | fn gen() -> impl PartialOrd + PartialEq + Debug {}
5-
| ^^^^^^^^^
4+
LL | fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
5+
| ^^^^^^^^^
66
|
77
= note: `-D clippy::implied-bounds-in-impls` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::implied_bounds_in_impls)]`
99
help: try removing this bound
1010
|
11-
LL - fn gen() -> impl PartialOrd + PartialEq + Debug {}
12-
LL + fn gen() -> impl PartialOrd + Debug {}
11+
LL - fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
12+
LL + fn r#gen() -> impl PartialOrd + Debug {}
1313
|
1414

1515
error: aborting due to 1 previous error

tests/ui/implicit_hasher.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn map<S: ::std::hash::BuildHasher>(map: &mut HashMap<i32, i32, S>) {}
7070
pub fn set<S: ::std::hash::BuildHasher>(set: &mut HashSet<i32, S>) {}
7171

7272
#[inline_macros]
73-
pub mod gen {
73+
pub mod gen_ {
7474
use super::*;
7575
inline! {
7676
impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {

tests/ui/implicit_hasher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn map(map: &mut HashMap<i32, i32>) {}
7070
pub fn set(set: &mut HashSet<i32>) {}
7171

7272
#[inline_macros]
73-
pub mod gen {
73+
pub mod gen_ {
7474
use super::*;
7575
inline! {
7676
impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {

tests/ui/implicit_hasher.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ error: impl for `HashMap` should be generalized over different hashers
9898
LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
9999
| ^^^^^^^^^^^^^
100100
|
101-
= note: this error originates in the macro `__inline_mac_mod_gen` (in Nightly builds, run with -Z macro-backtrace for more info)
101+
= note: this error originates in the macro `__inline_mac_mod_gen_` (in Nightly builds, run with -Z macro-backtrace for more info)
102102
help: add a type parameter for `BuildHasher`
103103
|
104104
LL ~ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {

tests/ui/map_with_unused_argument_over_ranges.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn do_something_interesting(x: usize, y: usize) -> usize {
1414
todo!()
1515
}
1616

17-
macro_rules! gen {
17+
macro_rules! r#gen {
1818
() => {
1919
(0..10).map(|_| do_something());
2020
};
@@ -45,7 +45,7 @@ fn main() {
4545
std::iter::repeat_with(|| do_something()).take(1);
4646
std::iter::repeat_with(|| do_something()).take((1 << 4) - 0);
4747
// These should not be raised
48-
gen!();
48+
r#gen!();
4949
let lower = 2;
5050
let lower_fn = || 2;
5151
(lower..upper_fn()).map(|_| do_something()); // Ranges not starting at zero not yet handled

tests/ui/map_with_unused_argument_over_ranges.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn do_something_interesting(x: usize, y: usize) -> usize {
1414
todo!()
1515
}
1616

17-
macro_rules! gen {
17+
macro_rules! r#gen {
1818
() => {
1919
(0..10).map(|_| do_something());
2020
};
@@ -45,7 +45,7 @@ fn main() {
4545
(9..=9).map(|_| do_something());
4646
(1..=1 << 4).map(|_| do_something());
4747
// These should not be raised
48-
gen!();
48+
r#gen!();
4949
let lower = 2;
5050
let lower_fn = || 2;
5151
(lower..upper_fn()).map(|_| do_something()); // Ranges not starting at zero not yet handled

0 commit comments

Comments
 (0)