Skip to content
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

Rustup #6971

Merged
merged 22 commits into from
Mar 25, 2021
Merged

Rustup #6971

merged 22 commits into from
Mar 25, 2021

Conversation

flip1995
Copy link
Member

r? @ghost

changelog: none

bstrie and others added 21 commits March 9, 2021 19:09
This will be removed in the next sync, once beta is at 1.52. Until then
this hack avoids to put `cfg(bootstrap)` into Clippy.
StructField -> FieldDef ("field definition")
Field -> ExprField ("expression field", not "field expression")
FieldPat -> PatField ("pattern field", not "field pattern")

Also rename visiting and other methods working on them.
…akis

2229: Handle patterns within closures correctly when `capture_disjoint_fields` is enabled

This PR fixes several issues related to handling patterns within closures when `capture_disjoint_fields` is enabled.
1. Matching is always considered a use of the place, even with `_` patterns
2. Compiler ICE when capturing fields in closures through `let` assignments

To do so, we

- Introduced new Fake Reads
- Delayed use of `Place` in favor of `PlaceBuilder`
- Ensured that `PlaceBuilder` can be resolved before attempting to extract `Place` in any of the pattern matching code

Closes rust-lang/project-rfc-2229/issues/27
Closes rust-lang/project-rfc-2229/issues/24
r? `@nikomatsakis`
More precise spans for HIR paths

`Ty::assoc_item` is lowered to `<Ty>::assoc_item` in HIR, but `Ty` got span from the whole path.
This PR fixes that, and adjusts some diagnostic code that relied on `Ty` having the whole path span.

This is a pre-requisite for rust-lang/rust#82868 (we cannot report suggestions like `Tr::assoc` -> `<dyn Tr>::assoc` with the current imprecise spans).
r? ````@estebank````
ast/hir: Rename field-related structures

I always forget what `ast::Field` and `ast::StructField` mean despite working with AST for long time, so this PR changes the naming to less confusing and more consistent.

- `StructField` -> `FieldDef` ("field definition")
- `Field` -> `ExprField` ("expression field", not "field expression")
- `FieldPat` -> `PatField` ("pattern field", not "field pattern")

Various visiting and other methods working with the fields are renamed correspondingly too.

The second commit reduces the size of `ExprKind` by boxing fields of `ExprKind::Struct` in preparation for rust-lang/rust#80080.
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated

Fixes #82080.

I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations).

As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
Stabilize or_patterns (RFC 2535, 2530, 2175)

closes #54883

This PR stabilizes the or_patterns feature in Rust 1.53.

This is blocked on the following (in order):
- [x] The crater run in rust-lang/rust#78935 (comment)
- [x] The resolution of the unresolved questions and a second crater run (rust-lang/rust#78935 (comment))
    - It looks like we will need to pursue some sort of edition-based transition for `:pat`.
- [x] Nomination and discussion by T-lang
- [x] Implement new behavior for `:pat` based on consensus (rust-lang/rust#80100).
- [ ] An FCP on stabilization

EDIT: Stabilization report is in rust-lang/rust#79278 (comment)
This currently creates a field which is always false on GenericParamDefKind for future use when
consts are permitted to have defaults

Update const_generics:default locations

Previously just ignored them, now actually do something about them.

Fix using type check instead of value

Add parsing

This adds all the necessary changes to lower const-generics defaults from parsing.

Change P<Expr> to AnonConst

This matches the arguments passed to instantiations of const generics, and makes it specific to
just anonymous constants.

Attempt to fix lowering bugs
Ok(From::from(value))
}
}
// FIXME: Suggested fix results in infinite recursion.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine. This test only exists to show, that our suggestion is bad, so keeping it commented out also makes the same point.

@flip1995
Copy link
Member Author

@bors r+

This was painful. Almost all files had a conflict, because of the clippy utils refactor...

@bors
Copy link
Contributor

bors commented Mar 25, 2021

📌 Commit 06940fd has been approved by flip1995

@bors
Copy link
Contributor

bors commented Mar 25, 2021

⌛ Testing commit 06940fd with merge a9158ad...

@flip1995
Copy link
Member Author

@bors p=10

bors added a commit that referenced this pull request Mar 25, 2021
Rustup

r? `@ghost`

changelog: none
@flip1995
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Mar 25, 2021

📌 Commit 40e68e5 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Mar 25, 2021

⌛ Testing commit 40e68e5 with merge 0e87918...

@bors
Copy link
Contributor

bors commented Mar 25, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 0e87918 to master...

@bors bors merged commit 0e87918 into rust-lang:master Mar 25, 2021
@flip1995 flip1995 deleted the rustup branch March 25, 2021 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants