mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
1d52972dd8
Use parenthetical notation for `Fn` traits Always use the `Fn(T) -> R` format when printing closure traits instead of `Fn<(T,), Output = R>`. Address #67100: ``` error[E0277]: expected a `Fn()` closure, found `F` --> file.rs:6:13 | 6 | call_fn(f) | ------- ^ expected an `Fn()` closure, found `F` | | | required by a bound introduced by this call | = note: wrap the `F` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `call_fn` --> file.rs:1:15 | 1 | fn call_fn<F: Fn() -> ()>(f: &F) { | ^^^^^^^^^^ required by this bound in `call_fn` help: consider further restricting this bound | 5 | fn call_any<F: std::any::Any + Fn()>(f: &F) { | ++++++ ``` |
||
---|---|---|
.. | ||
auxiliary | ||
always-extern.rs | ||
always-extern.stderr | ||
always-gets-overridden.rs | ||
bad-intrinsic-monomorphization.rs | ||
bad-intrinsic-monomorphization.stderr | ||
const-eval-select-backtrace-std.rs | ||
const-eval-select-backtrace-std.run.stderr | ||
const-eval-select-backtrace.rs | ||
const-eval-select-backtrace.run.stderr | ||
const-eval-select-bad.rs | ||
const-eval-select-bad.stderr | ||
const-eval-select-stability.rs | ||
const-eval-select-stability.stderr | ||
const-eval-select-x86_64.rs | ||
const-eval-select.rs | ||
feature-gate-safe-intrinsic.rs | ||
feature-gate-safe-intrinsic.stderr | ||
incorrect-read_via_copy-defn.rs | ||
incorrect-read_via_copy-defn.stderr | ||
incorrect-transmute.rs | ||
incorrect-transmute.stderr | ||
intrinsic-alignment.rs | ||
intrinsic-assume.rs | ||
intrinsic-atomics-cc.rs | ||
intrinsic-atomics.rs | ||
intrinsic-nearby.rs | ||
intrinsic-raw_eq-const-bad.rs | ||
intrinsic-raw_eq-const-bad.stderr | ||
intrinsic-raw_eq-const.rs | ||
intrinsic-unreachable.rs | ||
intrinsic-volatile.rs | ||
intrinsics-integer.rs | ||
intrinsics-math.rs | ||
issue-28575.rs | ||
issue-28575.stderr | ||
issue-84297-reifying-copy.rs | ||
non-integer-atomic.rs | ||
non-integer-atomic.stderr | ||
not-overridden.rs | ||
not-overridden.stderr | ||
panic-uninitialized-zeroed.rs | ||
reify-intrinsic.rs | ||
reify-intrinsic.stderr | ||
safe-intrinsic-mismatch.rs | ||
safe-intrinsic-mismatch.stderr | ||
unchecked_math_unsafe.rs | ||
unchecked_math_unsafe.stderr | ||
unchecked_math_unstable.rs | ||
unchecked_math_unstable.stderr |