| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
982: Implement BindingMode for pattern matching. r=flodiebold a=mjkillough
Implement `BindingMode` for pattern matching, so that types can be
correctly inferred using match ergonomics. The binding mode defaults to
`Move` (referred to as 'BindingMode::BindByValue` in rustc), and is
updated by automatic dereferencing of the value being matched.
Fixes #888.
- [Binding modes in The Reference](https://doc.rust-lang.org/reference/patterns.html#binding-modes)
- [`rustc` implementation](https://github.com/rust-lang/rust/blob/e17c48e2f21eefd59748e364234efc7037a3ec96/src/librustc_typeck/check/_match.rs#L77) (and [definition of `BindingMode`](https://github.com/rust-lang/rust/blob/e957ed9d10ec589bdd523b88b4b44c41b1ecf763/src/librustc/ty/binding.rs))
- [Match Ergonomics RFC](https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#binding-mode-rules)
Co-authored-by: Michael Killough <[email protected]>
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This decouples callers from knowing what the default binding mode of
pattern matching is.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Implement `BindingMode` for pattern matching, so that types can be
correctly inferred using match ergonomics. The binding mode defaults to
`Move` (referred to as 'BindingMode::BindByValue` in rustc), and is
updated by automatic dereferencing of the value being matched.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
983: support remainder assignment operator r=matklad a=JeanMertz
`%=` was returning errors for me, turns out it wasn't added as a valid assignment operation.
I'm not sure what the best location would be to add a test for this. Please let me know and I'll add one.
Co-authored-by: Jean Mertz <[email protected]>
|
| | | | | |
|
|\ \ \ \ \
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
986: Fix parse tree of attribute on match arm r=matklad a=pcpthm
```rust
match () {
#[attr]
() => (),
}
```
Incorrect parse tree: `MatchArmList(Attr(..), MatchArm(..))`.
Fixed: `MatchArmList(MatchArm(Attr(..), ...))`.
Co-authored-by: pcpthm <[email protected]>
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
985: simplify parsing blocks a bit r=pcpthm a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
984: Allow attribute on struct literal field r=matklad a=pcpthm
Cherrypicked from #980
Co-authored-by: pcpthm <[email protected]>
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
968: Macro aware name resoltion r=matklad a=matklad
The first commit lays the ground work for new name resolution, including
* extracting position-indendent items from parse trees
* walking the tree of modules
* old-style macro_rules resolve
cc @pnkfelix: this looks like an API name resolution should interact with.
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
unlike the old impl, this also handles macro imports across crates
|
|/ / / / |
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
947: Add missing impl members r=matklad a=Xanewok
Closes #878.
This took longer than expected as I wrapped my head around the API and the project - hopefully I didn't miss any edge case here.
r? @matklad
Co-authored-by: Igor Matuszewski <[email protected]>
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Asymptotically computing a set difference is faster but in the average
case we won't have more than ~10 functions. Also prefer not using hash
sets as these may yield nondeterministic results.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
981: Remove FnSig from FnDef type r=matklad a=flodiebold
It doesn't need to be in there since it's just information from the def. Another
step towards aligning Ty with Chalk's representation.
Co-authored-by: Florian Diebold <[email protected]>
|
| | | |
| | | |
| | | |
| | | |
| | | | |
It doesn't need to be in there since it's just information from the def. Another
step towards aligning Ty with Chalk's representation.
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
976: Replace Display by a pretty printing trait for Ty r=matklad a=flodiebold
This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)
I may have gone a bit overboard with the definition of the PrettyPrint trait...
Co-authored-by: Florian Diebold <[email protected]>
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)
|
|\ \ \ \
| |_|_|/
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
978: Update some dependencies r=matklad a=kjeremy
Co-authored-by: kjeremy <[email protected]>
|
|/ / / |
|