Skip to content

Rustup #9257

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

Merged
merged 16 commits into from
Jul 28, 2022
Merged

Rustup #9257

merged 16 commits into from
Jul 28, 2022

Conversation

flip1995
Copy link
Member

r? @ghost

changelog: none

oli-obk and others added 16 commits July 15, 2022 15:49
…r=compiler-errors

Avoid some `Symbol` to `String` conversions

This patch removes some Symbol to String conversions.
…=estebank"

This reverts commit 6f8fb91, reversing
changes made to 7210e46.
Resolve function lifetime elision on the AST

~Based on rust-lang/rust#97720

Lifetime elision for functions is purely syntactic in nature, so can be resolved on the AST.
This PR replicates the elision logic and diagnostics on the AST, and replaces HIR-based resolution by a `delay_span_bug`.

This refactor allows for more consistent diagnostics, which don't have to guess the original code from HIR.

r? `@petrochenkov`
Some command-line options accessible through `sess.opts` are best
accessed through wrapper functions on `Session`, `TyCtxt` or otherwise,
rather than through field access on the option struct in the `Session`.

Adds a new lint which triggers on those options that should be accessed
through a wrapper function so that this is prohibited. Options are
annotated with a new attribute `rustc_lint_opt_deny_field_access` which
can specify the error message (i.e. "use this other function instead")
to be emitted.

A simpler alternative would be to simply rename the options in the
option type so that it is clear they should not be used, however this
doesn't prevent uses, just discourages them. Another alternative would
be to make the option fields private, and adding accessor functions on
the option types, however the wrapper functions sometimes rely on
additional state from `Session` or `TyCtxt` which wouldn't be available
in an function on the option type, so the accessor would simply make the
field available and its use would be discouraged too.

Signed-off-by: David Wood <[email protected]>
…enkov

Clean up HIR-based lifetime resolution

Based on rust-lang/rust#97313.

Fixes #98932.

r? `@petrochenkov`
@flip1995
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Jul 28, 2022

📌 Commit 510effc has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 28, 2022

⌛ Testing commit 510effc with merge 3c7e7db...

@bors
Copy link
Contributor

bors commented Jul 28, 2022

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

@bors bors merged commit 3c7e7db into rust-lang:master Jul 28, 2022
@flip1995 flip1995 deleted the rustup branch July 28, 2022 17:11
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.

10 participants