-
Notifications
You must be signed in to change notification settings - Fork 13k
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
E0277 explanation when using optional chaining can be improved #49694
Comments
The traits rust/src/libcore/ops/function.rs Line 70 in fefe816
rust/src/libcore/ops/function.rs Line 216 in fefe816
and rust/src/libcore/ops/function.rs Line 143 in fefe816
need to have a |
i'm a noob, but I would like to take this on if nobody else is working on that. |
Hello @estebank , I am sorry that I have not worked before, because this time is working overtime.Now I built the compiler and tried adding the #[rustc_on_unimplemented] property, but I have some questions. |
[ rust/src/librustc/traits/error_reporting.rs Lines 394 to 396 in 0aa8d03
crate_local rule was in rustc_on_unimplemented , then the following message/label/note will be shown. This is done so we can suggest code changes that are only valid if you have access to the source and we don't suggest, for example, changing code in Diesel, Serde or another dependency. These flags, IIRC, only work with on , as in #[rustc_on_unimlpemented(on(crate_local, note="the note"))] .
Try first annotating with Regardless, you can filter on any of the type arguments (including The documentation for the feature is at https://doc.rust-lang.org/unstable-book/language-features/on-unimplemented.html, but it is a bit out of date. |
Extended the documentation a bit in #53279. |
hi @estebank . i try first annotating with #[rustc_on_unimplemented(note="test")] , but it not work. and |
@LuGuoHuas I took a look to see what was needed and arrived at this #53296 |
When closure with no arguments was expected, suggest wrapping Fix rust-lang#49694.
For this error:
The compiler can suggest adding a closure here. I'm honestly not sure what the issue is myself and I find optional and result chaining very difficult to use in Rust as compared to a language like Swift. However, changing it to a closure by adding "|| " fixed the error for me.
The text was updated successfully, but these errors were encountered: