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

Make ErrorGuaranteed discoverable outside types, consts, and lifetimes #127808

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jul 16, 2024

types like PatKind could contain ErrorGuaranteed, but not return them via tainted_by_errors or error_reported (see #127687 (comment)). Now this happens, but it's a bit fragile as you can see with the TypeSuperVisitable for Ty impl.

We will catch any problems around Ty, Region or Const at runtime with an assert, and everything using derives will not have such issues, as it will just invoke the TypeVisitable for ErrorGuaranteed impl

@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2024

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 16, 2024
@oli-obk
Copy link
Contributor Author

oli-obk commented Jul 16, 2024

We could use derives for TyKind, ConstKind and RegionKind to avoid the hand written impls, but not sure that has a perf impact and it's also annoying to do: https://github.com/oli-obk/rust/pull/new/tainting_visitors

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 16, 2024
Make ErrorGuaranteed discoverable outside types, consts, and lifetimes

types like `PatKind` could contain `ErrorGuaranteed`, but not return them via `tainted_by_errors` or `error_reported` (see rust-lang#127687 (comment)). Now this happens, but it's a bit fragile as you can see with the `TypeSuperVisitable for Ty` impl.

We will catch any problems around Ty, Region or Const at runtime with an assert, and everything using derives will not have such issues, as it will just invoke the `TypeVisitable for ErrorGuaranteed` impl
@bors
Copy link
Contributor

bors commented Jul 16, 2024

⌛ Trying commit 149fb97 with merge 0197366...

@nnethercote
Copy link
Contributor

r=me if perf is ok.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

you also have to update the HasTypeFlags visitor, don't you?

@bors
Copy link
Contributor

bors commented Jul 16, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0197366): 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 (primary 2.1%)

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)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Cycles

Results (secondary 1.4%)

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)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 700.256s -> 700.171s (-0.01%)
Artifact size: 328.62 MiB -> 328.59 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 16, 2024
@lcnr
Copy link
Contributor

lcnr commented Jul 16, 2024

@bors r=lcnr,nnethercote rollup

@bors
Copy link
Contributor

bors commented Jul 16, 2024

📌 Commit 53f7f8c has been approved by lcnr,nnethercote

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 Jul 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 16, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#127669 (Fix the issue of invalid suggestion for a reference of iterator)
 - rust-lang#127707 (match lowering: Use an iterator to find `expand_until`)
 - rust-lang#127730 (Fix and enforce `unsafe_op_in_unsafe_fn` in compiler)
 - rust-lang#127789 (delete #![allow(unsafe_op_in_unsafe_fn)] in teeos)
 - rust-lang#127805 (run-make-support: update gimli to 0.31.0)
 - rust-lang#127808 (Make ErrorGuaranteed discoverable outside types, consts, and lifetimes)
 - rust-lang#127817 (Fix a bunch of sites that were walking instead of visiting, making it impossible for visitor impls to look at these values)
 - rust-lang#127818 (Various ast validation simplifications)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8fd1df8 into rust-lang:master Jul 16, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 16, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 16, 2024
Rollup merge of rust-lang#127808 - oli-obk:tainting_visitors2, r=lcnr,nnethercote

Make ErrorGuaranteed discoverable outside types, consts, and lifetimes

types like `PatKind` could contain `ErrorGuaranteed`, but not return them via `tainted_by_errors` or `error_reported` (see rust-lang#127687 (comment)). Now this happens, but it's a bit fragile as you can see with the `TypeSuperVisitable for Ty` impl.

We will catch any problems around Ty, Region or Const at runtime with an assert, and everything using derives will not have such issues, as it will just invoke the `TypeVisitable for ErrorGuaranteed` impl
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.

6 participants