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

resolve: Always resolve visibilities on impl items #67236

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

petrochenkov
Copy link
Contributor

Fixes #64705.

Similarly to #67106 this was an issue with visitor discipline.
Impl items were visited as a part of visiting ast::ItemKind::Impl, but they should be visit-able in isolation from their parents as well, because that's how they are visited when they are expanded from macros.

I've checked that all the remaining resolve_visibility calls are used correctly.

r? @matthewjasper

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 11, 2019
@petrochenkov petrochenkov added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 11, 2019
@petrochenkov
Copy link
Contributor Author

I'm going to stable-nominate this as well in case there's going to be a point release for other reasons, because this PR fixes a relatively recent stable-to-stable regression that allows erroneous code to be silently accepted.

@petrochenkov petrochenkov added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Dec 11, 2019
@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 11, 2019
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 11, 2019

📌 Commit 914c9aa has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2019
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Dec 12, 2019
resolve: Always resolve visibilities on impl items

Fixes rust-lang#64705.

Similarly to rust-lang#67106 this was an issue with visitor discipline.
Impl items were visited as a part of visiting `ast::ItemKind::Impl`, but they should be visit-able in isolation  from their parents as well, because that's how they are visited when they are expanded from macros.

I've checked that all the remaining `resolve_visibility` calls are used correctly.

r? @matthewjasper
bors added a commit that referenced this pull request Dec 12, 2019
Rollup of 8 pull requests

Successful merges:

 - #62514 (Clarify `Box<T>` representation and its use in FFI)
 - #66983 (Fix `unused_parens` triggers on macro by example code)
 - #67215 (Fix `-Z print-type-sizes`'s handling of zero-sized fields.)
 - #67230 (Remove irelevant comment on `register_dtor`)
 - #67236 (resolve: Always resolve visibilities on impl items)
 - #67237 (Some small readability improvements)
 - #67238 (Small std::borrow::Cow improvements)
 - #67239 (Make TinyList::remove iterate instead of recurse)

Failed merges:

r? @ghost
@bors bors merged commit 914c9aa into rust-lang:master Dec 12, 2019
@pnkfelix
Copy link
Member

discussed at T-compiler meeting. accepted for beta backport.

@pnkfelix pnkfelix added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Dec 12, 2019
@Mark-Simulacrum Mark-Simulacrum removed beta-nominated Nominated for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Dec 14, 2019
bors added a commit that referenced this pull request Dec 14, 2019
[beta] Beta backports

Backporting the following pull requests:

 * resolve: Always resolve visibilities on impl items #67236
 * resolve: Resolve visibilities on fields with non-builtin attributes #67106
 * E0023: handle expected != tuple pattern type #67044
 * Fix `unused_parens` triggers on macro by example code #66983
 * Fix some issues with attributes on unnamed fields #66669
 * Ensure that we get a hard error on generic ZST constants if their bodies #67134 (via #67297)

Some of these conflicted on merge, I resolved where possible, sometimes by cherry-picking a commit or two more from the relevant PRs. Since those changes are necessary though for backport to proceed (otherwise not even std/core compile), seems fine -- they're fairly minor cleanups anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE when cargo doc on lexical-core: attempted .def_id() on invalid res: Err
7 participants