Skip to content

Commit d679ec5

Browse files
authored
Rollup merge of rust-lang#102591 - JarvisCraft:fix-double-a-article, r=compiler-errors
Fix duplicate usage of `a` article. This fixes a typo first appearing in rust-lang#94624 in which test-macro diagnostic uses "a" article twice. Since I searched the sources for " a a " sequences, I also fixed the same issue in a few files where I found it.
2 parents c305330 + afae957 commit d679ec5

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

compiler/rustc_builtin_macros/src/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn expand_test_or_bench(
115115
// reworked in the future to not need it, it'd be nice.
116116
_ => diag.struct_span_err(attr_sp, msg).forget_guarantee(),
117117
};
118-
err.span_label(attr_sp, "the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions")
118+
err.span_label(attr_sp, "the `#[test]` macro causes a function to be run on a test and has no effect on non-functions")
119119
.span_label(item.span, format!("expected a non-associated function, found {} {}", item.kind.article(), item.kind.descr()))
120120
.span_suggestion(attr_sp, "replace with conditional compilation to make the item only exist when tests are being run", "#[cfg(test)]", Applicability::MaybeIncorrect)
121121
.emit();

src/test/ui/test-attrs/test-on-not-fn.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
22
--> $DIR/test-on-not-fn.rs:3:1
33
|
44
LL | #[test]
5-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
5+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
66
LL | mod test {}
77
| ----------- expected a non-associated function, found a module
88
|
@@ -15,7 +15,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
1515
--> $DIR/test-on-not-fn.rs:6:1
1616
|
1717
LL | #[test]
18-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
18+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
1919
LL | / mod loooooooooooooong_teeeeeeeeeest {
2020
LL | | /*
2121
LL | | this is a comment
@@ -34,7 +34,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
3434
--> $DIR/test-on-not-fn.rs:20:1
3535
|
3636
LL | #[test]
37-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
37+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
3838
LL | extern "C" {}
3939
| ------------- expected a non-associated function, found an extern block
4040
|
@@ -47,7 +47,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
4747
--> $DIR/test-on-not-fn.rs:23:1
4848
|
4949
LL | #[test]
50-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
50+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
5151
LL | trait Foo {}
5252
| ------------ expected a non-associated function, found a trait
5353
|
@@ -60,7 +60,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
6060
--> $DIR/test-on-not-fn.rs:26:1
6161
|
6262
LL | #[test]
63-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
63+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
6464
LL | impl Foo for i32 {}
6565
| ------------------- expected a non-associated function, found an implementation
6666
|
@@ -73,7 +73,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
7373
--> $DIR/test-on-not-fn.rs:29:1
7474
|
7575
LL | #[test]
76-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
76+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
7777
LL | const FOO: i32 = -1_i32;
7878
| ------------------------ expected a non-associated function, found a constant item
7979
|
@@ -86,7 +86,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
8686
--> $DIR/test-on-not-fn.rs:32:1
8787
|
8888
LL | #[test]
89-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
89+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
9090
LL | static BAR: u64 = 10_000_u64;
9191
| ----------------------------- expected a non-associated function, found a static item
9292
|
@@ -99,7 +99,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
9999
--> $DIR/test-on-not-fn.rs:35:1
100100
|
101101
LL | #[test]
102-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
102+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
103103
LL | / enum MyUnit {
104104
LL | | Unit,
105105
LL | | }
@@ -114,7 +114,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
114114
--> $DIR/test-on-not-fn.rs:40:1
115115
|
116116
LL | #[test]
117-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
117+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
118118
LL | struct NewI32(i32);
119119
| ------------------- expected a non-associated function, found a struct
120120
|
@@ -127,7 +127,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
127127
--> $DIR/test-on-not-fn.rs:43:1
128128
|
129129
LL | #[test]
130-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
130+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
131131
LL | / union Spooky {
132132
LL | | x: i32,
133133
LL | | y: u32,
@@ -143,7 +143,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
143143
--> $DIR/test-on-not-fn.rs:50:1
144144
|
145145
LL | #[test]
146-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
146+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
147147
LL | #[derive(Copy, Clone, Debug)]
148148
LL | / struct MoreAttrs {
149149
LL | | a: i32,
@@ -160,7 +160,7 @@ warning: the `#[test]` attribute may only be used on a non-associated function
160160
--> $DIR/test-on-not-fn.rs:61:1
161161
|
162162
LL | #[test]
163-
| ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
163+
| ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
164164
LL | foo!();
165165
| ------- expected a non-associated function, found an item macro invocation
166166
|

src/tools/rust-analyzer/crates/ide-db/src/imports/merge_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ fn path_cmp_short(a: &ast::Path, b: &ast::Path) -> Ordering {
225225
}
226226

227227
/// Compares two paths, if one ends earlier than the other the has_tl parameters decide which is
228-
/// greater as a a path that has a tree list should be greater, while one that just ends without
228+
/// greater as a path that has a tree list should be greater, while one that just ends without
229229
/// a tree list should be considered less.
230230
pub(super) fn use_tree_path_cmp(
231231
a: &ast::Path,

src/tools/rust-analyzer/crates/rust-analyzer/src/bin/logger.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ where
132132

133133
let ext = span.extensions();
134134

135-
// `FormattedFields` is a a formatted representation of the span's
135+
// `FormattedFields` is a formatted representation of the span's
136136
// fields, which is stored in its extensions by the `fmt` layer's
137137
// `new_span` method. The fields will have been formatted
138138
// by the same field formatter that's provided to the event

0 commit comments

Comments
 (0)