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

Mark ErrorGuaranteed constructor as deprecated so people don't use it #111261

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented May 5, 2023

You should never ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever use this function unless you know what you're doing, so make it harder to accidentally use it!

Alternatives are to change the name to sound scarier, make it unsafe (though it's not really a soundness thing), or work on deeper refactors to make it private.

r? @BoxyUwU

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 5, 2023
@@ -854,9 +854,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let result = self
.resolve_fully_qualified_call(span, item_name, ty.normalized, qself.span, hir_id)
.or_else(|error| {
let guar = self
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure this is not introducing any ICEs, since we later error on bad privacy in type-dependent resolutions.

I think delaying a bug here would actually make sure we catch any subtle cases where private methods aren't being error'd correctly.

@BoxyUwU
Copy link
Member

BoxyUwU commented May 5, 2023

r=me if CI passes lol

@rust-cloud-vms rust-cloud-vms bot force-pushed the error-guaranteed-should-be-scarier-to-construct branch from 0d2fcb7 to 6077fdd Compare May 5, 2023 18:05
@compiler-errors
Copy link
Member Author

@bors r=BoxyUwU

@bors
Copy link
Contributor

bors commented May 5, 2023

📌 Commit 6077fdd has been approved by BoxyUwU

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 May 5, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2023
Rollup of 8 pull requests

Successful merges:

 - rust-lang#109677 (Stabilize raw-dylib, link_ordinal, import_name_type and -Cdlltool)
 - rust-lang#110780 (rustdoc-search: add slices and arrays to index)
 - rust-lang#110830 (Add FreeBSD cpuset support to `std::thread::available_concurrency`)
 - rust-lang#111139 (Fix MXCSR configuration dependent timing)
 - rust-lang#111239 (Remove unnecessary attribute from a diagnostic)
 - rust-lang#111246 (forbid escaping bound vars in combine)
 - rust-lang#111251 (Issue 109502 follow up, remove unnecessary Vec::new() from compile_test())
 - rust-lang#111261 (Mark `ErrorGuaranteed` constructor as deprecated so people don't use it)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 393e285 into rust-lang:master May 6, 2023
11 checks passed
@rustbot rustbot added this to the 1.71.0 milestone May 6, 2023
@compiler-errors compiler-errors deleted the error-guaranteed-should-be-scarier-to-construct branch August 11, 2023 20:00
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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants