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

Remove a dead code path. #91493

Merged
merged 1 commit into from
Dec 7, 2021
Merged

Remove a dead code path. #91493

merged 1 commit into from
Dec 7, 2021

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Dec 3, 2021

It is neither documented nor can I see any way it could ever be reached.

Also, no tests fail when turning that arm into an ICE

…n it existed.

Also, no tests fail when turning that arm into an ICE
@oli-obk oli-obk added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Dec 3, 2021
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 3, 2021
@@ -481,7 +477,14 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
}) => {
(may_define_opaque_type(tcx, parent_def_id, opaque_hir_id), origin)
}
_ => (def_scope_default(), hir::OpaqueTyOrigin::TyAlias),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may be a leftover from impl-trait-in-bindings that we overlooked. We only have impl trait in return position and type alias impl trait, there are no other places that generate ty::Opaque, thus I concluded that this arm is unreachable.

@michaelwoerister
Copy link
Member

michaelwoerister commented Dec 6, 2021

I don't know the code involved here -- but since it will ICE immediately if it's not dead code after all, this looks like a low risk change.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 6, 2021

📌 Commit 9e5939a has been approved by michaelwoerister

@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 6, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 6, 2021
Remove a dead code path.

It is neither documented nor can I see any way it could ever be reached.

Also, no tests fail when turning that arm into an ICE
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 6, 2021
Remove a dead code path.

It is neither documented nor can I see any way it could ever be reached.

Also, no tests fail when turning that arm into an ICE
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 7, 2021
Remove a dead code path.

It is neither documented nor can I see any way it could ever be reached.

Also, no tests fail when turning that arm into an ICE
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2021
…askrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#87614 (Recommend fix `count()` -> `len()` on slices)
 - rust-lang#91065 (Add test for evaluate_obligation: Ok(EvaluatedToOkModuloRegions) ICE)
 - rust-lang#91312 (Fix AnonConst ICE)
 - rust-lang#91341 (Add `array::IntoIter::{empty, from_raw_parts}`)
 - rust-lang#91493 (Remove a dead code path.)
 - rust-lang#91503 (Tweak "call this function" suggestion to have smaller span)
 - rust-lang#91547 (Suggest try_reserve in try_reserve_exact)
 - rust-lang#91562 (Pretty print async block without redundant space)
 - rust-lang#91620 (Update books)
 - rust-lang#91622 (:arrow_up: rust-analyzer)

Failed merges:

 - rust-lang#91571 (Remove unneeded access to pretty printer's `s` field in favor of deref)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dd929ae into rust-lang:master Dec 7, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants