-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make obligation cause code suggestions verbose #142045
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
Make obligation cause code suggestions verbose #142045
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
6b4364a
to
3ca4732
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls convert the semicolon removal suggestion to hidden, then r=me
| | ||
= help: the trait `std::fmt::Display` is not implemented for `()` | ||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead | ||
help: remove this semicolon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be hidden. I don't think showing the user how to remove a semicolon is particularly useful 😅
``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ```
3ca4732
to
ac980ca
Compare
@bors r=compiler-errors |
@bors rollup |
…gestion, r=compiler-errors Make obligation cause code suggestions verbose ``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ``` Part of rust-lang#141973
Rollup of 8 pull requests Successful merges: - #137992 (Stabilise `os_string_pathbuf_leak`) - #141558 (Limit the size of cgu names when using the `-Zhuman-readable-cgu-name…) - #141797 (compiler: set Apple frame pointers by architecture) - #141857 (coretests: move float tests from num to floats module and use a more flexible macro to generate them) - #142045 (Make obligation cause code suggestions verbose) - #142076 (Check documentation of bootstrap in PR CI) - #142110 (Add solaris targets to build-manifest) - #142131 (Make cast suggestions verbose) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142045 - estebank:obligation-cause-code-suggestion, r=compiler-errors Make obligation cause code suggestions verbose ``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ``` Part of #141973
Part of #141973