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

Label non_exhaustive attribute on privacy errors from non-local items #110013

Merged

Conversation

compiler-errors
Copy link
Member

Label when an ADT is non_exhaustive and we get a privacy error, help with confusion in a case like this:

#[non_exhaustive]
pub struct Foo;

// other crate
let x = Foo;
//~^ ERROR unit struct `Foo` is private

@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2023

r? @WaffleLapkin

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 6, 2023
@Mark-Simulacrum
Copy link
Member

@bors try @rust-timer queue

I wonder if the extra get_attr here is going to be expensive - hopefully not, but if so maybe we can only do it if all fields are mentioned (or there are no fields), which this code is already mostly doing I suspect?

@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Apr 6, 2023

⌛ Trying commit 8ed2dc0 with merge d53a6dffb83447b7ffd6880976ccb09d6112fc33...

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 6, 2023
@compiler-errors
Copy link
Member Author

Just noting that this only happens in an error reporting function, so I would be very surprised if this affects perf.

Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

r=me ig (is there a reason to wait for the perf run?...)

compiler/rustc_resolve/src/diagnostics.rs Show resolved Hide resolved
@estebank
Copy link
Contributor

estebank commented Apr 6, 2023

@bors r=WaffleLapkin

Yeah, perf is not gonna show anything given this only happens in the error case.

@bors
Copy link
Contributor

bors commented Apr 6, 2023

📌 Commit 8ed2dc0 has been approved by WaffleLapkin

It is now in the queue for this repository.

@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 Apr 6, 2023
@compiler-errors

This comment was marked as duplicate.

@compiler-errors
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 6, 2023
@compiler-errors
Copy link
Member Author

Please don't r+ a pr that is currently <try>ing. That'll make bors auto-merge the PR without any tests or making dist artifacts.

@bors
Copy link
Contributor

bors commented Apr 6, 2023

☀️ Try build successful - checks-actions
Build commit: d53a6dffb83447b7ffd6880976ccb09d6112fc33 (d53a6dffb83447b7ffd6880976ccb09d6112fc33)

1 similar comment
@bors
Copy link
Contributor

bors commented Apr 6, 2023

☀️ Try build successful - checks-actions
Build commit: d53a6dffb83447b7ffd6880976ccb09d6112fc33 (d53a6dffb83447b7ffd6880976ccb09d6112fc33)

@rust-timer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

now we can r+ this

@bors r=WaffleLapkin

@bors
Copy link
Contributor

bors commented Apr 6, 2023

📌 Commit 8ed2dc0 has been approved by WaffleLapkin

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 6, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d53a6dffb83447b7ffd6880976ccb09d6112fc33): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.4% [3.4%, 3.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 0.4% [-2.6%, 3.4%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 6, 2023
@compiler-errors
Copy link
Member Author

@bors rollup

@estebank
Copy link
Contributor

estebank commented Apr 7, 2023

Please don't r+ a pr that is currently ing. That'll make bors auto-merge the PR without any tests or making dist artifacts.

Ah yeah, I'd forgotten about that :-/

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#109806 (Workaround rust-lang#109797 on windows-gnu)
 - rust-lang#109957 (diagnostics: account for self type when looking for source of unsolved type variable)
 - rust-lang#109960 (Fix buffer overrun in bootstrap and (test-only) symlink_junction)
 - rust-lang#110013 (Label `non_exhaustive` attribute on privacy errors from non-local items)
 - rust-lang#110016 (Run collapsed GUI test in mobile mode as well)
 - rust-lang#110022 (fix: fix regression in rust-lang#109203)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e708189 into rust-lang:master Apr 7, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 7, 2023
@compiler-errors compiler-errors deleted the non-exhaustive-privacy-reason branch August 11, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

7 participants