Skip to content

Conversation

lyming2007
Copy link

check explicitly for the type references error
if ty.references_error() is true change the error to be err.delay_as_bug() and prevent the error E0029 and E0277 from emitting out this fix #105946

@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon.

Please see the contribution instructions for more information.

@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 Jan 5, 2023
@estebank
Copy link
Contributor

estebank commented Jan 5, 2023

You'll need to fix this:

tidy error: /checkout/src/test/ui/typeck/issue-105946.rs: too many trailing newlines (2)

Remove one trailing line from that file (some editors will show a single trailing line as no line at all, and some will show them, if you remove all trailing empty lines tidy will also complain).

@estebank
Copy link
Contributor

estebank commented Jan 5, 2023

r? @estebank

@rustbot rustbot assigned estebank and unassigned jackh726 Jan 5, 2023
@estebank
Copy link
Contributor

estebank commented Jan 5, 2023

You need to re--bless 😅

Comment on lines 1389 to 1392
if self.point_at_returns_when_relevant(&mut err, &obligation) {
err.delay_as_bug();
}
Copy link
Contributor

@estebank estebank Jan 5, 2023

Choose a reason for hiding this comment

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

To mirror what compiler-errors said, here you could instead check if obligation.predicate.references_error(), instead of changing point_at_returns_when_relevant.

Copy link
Author

Choose a reason for hiding this comment

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

I tried, but it didn't work, thus obligation.predicate.references_error() behaves differently from ty_references_error().
I've changed point_at_returns_when_relevant() as Michael suggested, which works well.

@lyming2007
Copy link
Author

You'll need to fix this:

tidy error: /checkout/src/test/ui/typeck/issue-105946.rs: too many trailing newlines (2)

Remove one trailing line from that file (some editors will show a single trailing line as no line at all, and some will show them, if you remove all trailing empty lines tidy will also complain).

I think ./x.py fmt would remove those trailing newlines... :(

@estebank
Copy link
Contributor

estebank commented Jan 5, 2023

I think ./x.py fmt would remove those trailing newlines... :(

I'd have to agree :)

check explicitly for the type references error
if ty.references_error() is true change the error to be err.delay_as_bug()
and prevent the error E0029 and E0277 from emitting out
this fix rust-lang#105946
@estebank
Copy link
Contributor

estebank commented Jan 6, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 6, 2023

📌 Commit 10dbcf0 has been approved by estebank

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

Successful merges:

 - rust-lang#106400 (Point at expressions where inference refines an unexpected type)
 - rust-lang#106491 (Fix error-index redirect to work with the back button.)
 - rust-lang#106494 (Add regression test for rust-lang#58355)
 - rust-lang#106499 (fix [type error] for error E0029 and E0277)
 - rust-lang#106502 (rustdoc: remove legacy user-select CSS)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a8f7ec2 into rust-lang:master Jan 6, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 6, 2023
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.

[type error] when wrongly destructing boxes of ints
6 participants