Comments (5)
We already suggest let
/else
if there is a binding at play. For example when you write let Some(x) = foo;
we'll suggest let Some(x) = foo else { todo!() };
already. I don't think we should suggest let
/else
when there are no bindings because it would be more naturally written in the opposite way, like if foo.is_none() { todo!() }
instead.
from rust.
I think it would be helpful to have a suggestion for those who expect an exact value or else the code should diverge.
from rust.
If thats not a good idea, just close with a comment.
from rust.
We can maybe add a help
note, but wouldn't want to provide a structured suggestion.
from rust.
Yeah that would be nice.
from rust.
Related Issues (20)
- Cannot write tests that need the csky backend HOT 5
- Inconsistent recursive fn call elimination HOT 15
- run-make-support: add `#[must_use]` to helpers where suitable HOT 1
- Tracking Issue for `--print=check-cfg`
- Tracking Issue for compiletest documentation HOT 1
- ICE on nightly-2024-05-28 during link stage HOT 1
- Lint `type_alias_bounds` fires unnecessarily for trait bounds that define short-hand projections on the RHS HOT 4
- Add an mpmc concurrent queue
- Confusing diagnostic when doing a recursive call in a const block in a const fn: "cycle detected when elaborating drops"
- compilation failure with "cargo check --tests" for espidf HOT 1
- const blocks don't have a recursion limit or timeout, causing the compiler to freeze in an infinite loop HOT 5
- run-make-support: rename `tmp_dir()` and clarify its semantics HOT 1
- run-make-support: investigate if it's possible to make rust-analyzer work with rmake.rs files
- run-make-support: add helpers for fs operations HOT 1
- Tracking Issue for RFC 3467: UnsafePinned
- Unhelpful error on mismatched types for anonymous futures HOT 3
- More instructions generated for `Ord::clamp` than manual `max(X).min(Y)` for saturating truncating cast from `i32` to `u8` HOT 1
- run-make-support: use a `CommandWrapper` trait instead of `impl_helper_methods` macro HOT 5
- Tracking Issue for `duration_new_checked`
- ICE: `called Option::unwrap() on a None value` in `compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.