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

Ignore derived Default implementations during dead code analysis #120923

Closed

Conversation

mu001999
Copy link
Contributor

Fixes #98871

@rustbot
Copy link
Collaborator

rustbot commented Feb 11, 2024

r? @michaelwoerister

rustbot has assigned @michaelwoerister.
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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 11, 2024
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#13 3.852 Building wheels for collected packages: reuse
#13 3.853   Building wheel for reuse (pyproject.toml): started
#13 4.180   Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 4.181   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#13 4.181   Stored in directory: /tmp/pip-ephem-wheel-cache-m6mg_29l/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#13 4.184 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#13 4.208   Attempting uninstall: setuptools
#13 4.208     Found existing installation: setuptools 59.6.0
#13 4.209     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
---

error: variant `Init` is never constructed
   --> src/tools/miri/src/shims/tls.rs:229:5
    |
227 | enum TlsDtorsStatePriv {
    |      ----------------- variant in this enum
228 |     #[default]
    |     ^^^^
    |
    |
    = note: `TlsDtorsStatePriv` has derived impls for the traits `Default` and `Debug`, but these are intentionally ignored during dead code analysis
    Checking cargo_metadata v0.15.4
    Checking rustfix v0.6.1
error: could not compile `miri` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

@mu001999
Copy link
Contributor Author

Looks like this doesn't work, we cannot simply add #[rustc_trivial_field_reads].

@mu001999 mu001999 closed this Feb 11, 2024
@mu001999 mu001999 deleted the dead_code/ignore_default branch February 11, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

derive(Default) suppresses warn(dead_code)
4 participants