Skip to content

Commit 90f2816

Browse files
authoredJul 24, 2020
Rollup merge of #74680 - JohnTitor:missing-backticks, r=lcnr
Add missing backticks in diagnostics note
2 parents fab9b1d + 3f4f313 commit 90f2816

9 files changed

+16
-16
lines changed
 

‎src/libcore/ops/function.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#[rustc_on_unimplemented(
6060
on(
6161
Args = "()",
62-
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
62+
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
6363
),
6464
message = "expected a `{Fn}<{Args}>` closure, found `{Self}`",
6565
label = "expected an `Fn<{Args}>` closure, found `{Self}`"
@@ -141,7 +141,7 @@ pub trait Fn<Args>: FnMut<Args> {
141141
#[rustc_on_unimplemented(
142142
on(
143143
Args = "()",
144-
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
144+
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
145145
),
146146
message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`",
147147
label = "expected an `FnMut<{Args}>` closure, found `{Self}`"
@@ -215,7 +215,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
215215
#[rustc_on_unimplemented(
216216
on(
217217
Args = "()",
218-
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
218+
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
219219
),
220220
message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`",
221221
label = "expected an `FnOnce<{Args}>` closure, found `{Self}`"

‎src/test/ui/closure-expected.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let y = x.or_else(4);
55
| ^ expected an `FnOnce<()>` closure, found `{integer}`
66
|
77
= help: the trait `std::ops::FnOnce<()>` is not implemented for `{integer}`
8-
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }
8+
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
99

1010
error: aborting due to previous error
1111

‎src/test/ui/extern/extern-wrong-value-type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | is_fn(f);
88
| ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`
99
|
1010
= help: the trait `std::ops::Fn<()>` is not implemented for `extern "C" fn() {f}`
11-
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }
11+
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }`
1212

1313
error: aborting due to previous error
1414

‎src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
1616
LL | type F<'a> = Self;
1717
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
1818
|
19-
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
19+
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
2020
help: consider restricting type parameter `T`
2121
|
2222
LL | impl<T: std::ops::Fn<()>> Fun for T {

‎src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
1616
LL | type F<'a> = Self;
1717
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
1818
|
19-
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
19+
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
2020
help: consider restricting type parameter `T`
2121
|
2222
LL | impl<T: std::ops::Fn<()>> Fun for T {

‎src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
1616
LL | type F<'a> = Self;
1717
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
1818
|
19-
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
19+
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
2020
help: consider restricting type parameter `T`
2121
|
2222
LL | impl<T: std::ops::Fn<()>> Fun for T {

‎src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
1616
LL | type F<'a> = Self;
1717
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
1818
|
19-
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
19+
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
2020
help: consider restricting type parameter `T`
2121
|
2222
LL | impl<T: std::ops::Fn<()>> Fun for T {

‎src/test/ui/issues/issue-22034.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | &mut *(ptr as *mut dyn Fn())
55
| ^^^ expected an `Fn<()>` closure, found `()`
66
|
77
= help: the trait `std::ops::Fn<()>` is not implemented for `()`
8-
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }
8+
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
99
= note: required for the cast to the object type `dyn std::ops::Fn()`
1010

1111
error: aborting due to previous error

‎src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | call(foo);
88
| ^^^ expected an `Fn<()>` closure, found `fn() {foo}`
99
|
1010
= help: the trait `std::ops::Fn<()>` is not implemented for `fn() {foo}`
11-
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }
11+
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
1212
= note: `#[target_feature]` functions do not implement the `Fn` traits
1313

1414
error[E0277]: expected a `std::ops::FnMut<()>` closure, found `fn() {foo}`
@@ -21,7 +21,7 @@ LL | call_mut(foo);
2121
| ^^^ expected an `FnMut<()>` closure, found `fn() {foo}`
2222
|
2323
= help: the trait `std::ops::FnMut<()>` is not implemented for `fn() {foo}`
24-
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }
24+
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
2525
= note: `#[target_feature]` functions do not implement the `Fn` traits
2626

2727
error[E0277]: expected a `std::ops::FnOnce<()>` closure, found `fn() {foo}`
@@ -34,7 +34,7 @@ LL | call_once(foo);
3434
| ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}`
3535
|
3636
= help: the trait `std::ops::FnOnce<()>` is not implemented for `fn() {foo}`
37-
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }
37+
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
3838
= note: `#[target_feature]` functions do not implement the `Fn` traits
3939

4040
error[E0277]: expected a `std::ops::Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
@@ -47,7 +47,7 @@ LL | call(foo_unsafe);
4747
| ^^^^^^^^^^ expected an `Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
4848
|
4949
= help: the trait `std::ops::Fn<()>` is not implemented for `unsafe fn() {foo_unsafe}`
50-
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }
50+
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
5151
= note: `#[target_feature]` functions do not implement the `Fn` traits
5252

5353
error[E0277]: expected a `std::ops::FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
@@ -60,7 +60,7 @@ LL | call_mut(foo_unsafe);
6060
| ^^^^^^^^^^ expected an `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
6161
|
6262
= help: the trait `std::ops::FnMut<()>` is not implemented for `unsafe fn() {foo_unsafe}`
63-
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }
63+
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
6464
= note: `#[target_feature]` functions do not implement the `Fn` traits
6565

6666
error[E0277]: expected a `std::ops::FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
@@ -73,7 +73,7 @@ LL | call_once(foo_unsafe);
7373
| ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
7474
|
7575
= help: the trait `std::ops::FnOnce<()>` is not implemented for `unsafe fn() {foo_unsafe}`
76-
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }
76+
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
7777
= note: `#[target_feature]` functions do not implement the `Fn` traits
7878

7979
error: aborting due to 6 previous errors

0 commit comments

Comments
 (0)
Please sign in to comment.