Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing backticks in diagnostics note #74680

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libcore/ops/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#[rustc_on_unimplemented(
on(
Args = "()",
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
),
message = "expected a `{Fn}<{Args}>` closure, found `{Self}`",
label = "expected an `Fn<{Args}>` closure, found `{Self}`"
Expand Down Expand Up @@ -141,7 +141,7 @@ pub trait Fn<Args>: FnMut<Args> {
#[rustc_on_unimplemented(
on(
Args = "()",
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
),
message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`",
label = "expected an `FnMut<{Args}>` closure, found `{Self}`"
Expand Down Expand Up @@ -215,7 +215,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
#[rustc_on_unimplemented(
on(
Args = "()",
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
),
message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`",
label = "expected an `FnOnce<{Args}>` closure, found `{Self}`"
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/closure-expected.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | let y = x.or_else(4);
| ^ expected an `FnOnce<()>` closure, found `{integer}`
|
= help: the trait `std::ops::FnOnce<()>` is not implemented for `{integer}`
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/extern/extern-wrong-value-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | is_fn(f);
| ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `extern "C" fn() {f}`
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }`

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-22034.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | &mut *(ptr as *mut dyn Fn())
| ^^^ expected an `Fn<()>` closure, found `()`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `()`
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `()` in a closure with no arguments: `|| { /* code */ }`
= note: required for the cast to the object type `dyn std::ops::Fn()`

error: aborting due to previous error
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | call(foo);
| ^^^ expected an `Fn<()>` closure, found `fn() {foo}`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits

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

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

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

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

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

error: aborting due to 6 previous errors
Expand Down