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

Fix another clashing_extern_declarations false positive. #75885

Conversation

jumbatm
Copy link
Contributor

@jumbatm jumbatm commented Aug 24, 2020

Fixes #75739.

Fix another clashing_extern_declarations false positive, this time for transparent newtype with a non-zero member.

r? @lcnr

Fixes a false positive for transparent newtype with a non-zero member.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2020
@Mark-Simulacrum
Copy link
Member

I'm going to nominate this for beta backport, similarly to #73990. However, note:

  • 1.46 received a beta backport simply allowing this lint by default
  • 1.47 (current nightly, soon to be promoted to beta) has the lint on by default

I suspect that it might make sense to continue allowing the lint by default for another cycle, though this patch does seem more minimal than the previous PR which we declined a direct backport of.

We could also say this is "just a bug" and that it is fine for the false-positive here; I am not clear how likely it is in real-world code to hit this case.

@Mark-Simulacrum Mark-Simulacrum added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 24, 2020
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.

This change looks good to me 👍

I kind of feel like this lint is getting somewhat unwieldy though but don't really know how to clean this up myself so 🤷

A few minor nits, otherwise r=me

src/librustc_lint/builtin.rs Outdated Show resolved Hide resolved
src/test/ui/lint/clashing-extern-fn.rs Outdated Show resolved Hide resolved
src/librustc_lint/types.rs Outdated Show resolved Hide resolved
@jumbatm jumbatm force-pushed the issue75739-clashing-extern-declarations-transparent-nonzero branch from a678150 to 352df40 Compare August 25, 2020 14:19
@jumbatm
Copy link
Contributor Author

jumbatm commented Aug 25, 2020

Should be good to go once green.

@lcnr
Copy link
Contributor

lcnr commented Aug 25, 2020

thanks

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 25, 2020

📌 Commit 352df40 has been approved by lcnr

@bors
Copy link
Contributor

bors commented Aug 25, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@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 Aug 25, 2020
@nikomatsakis nikomatsakis assigned lcnr and unassigned lcnr Aug 27, 2020
@spastorino
Copy link
Member

discussed in T-compiler meeting, declined to backport.

@rustbot modify labels: -beta-nominated

@rustbot rustbot removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 27, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Aug 27, 2020
…declarations-transparent-nonzero, r=lcnr

Fix another clashing_extern_declarations false positive.

Fixes rust-lang#75739.

Fix another clashing_extern_declarations false positive, this time for transparent newtype with a non-zero member.

r? @lcnr
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Aug 28, 2020
…declarations-transparent-nonzero, r=lcnr

Fix another clashing_extern_declarations false positive.

Fixes rust-lang#75739.

Fix another clashing_extern_declarations false positive, this time for transparent newtype with a non-zero member.

r? @lcnr
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Aug 29, 2020
…declarations-transparent-nonzero, r=lcnr

Fix another clashing_extern_declarations false positive.

Fixes rust-lang#75739.

Fix another clashing_extern_declarations false positive, this time for transparent newtype with a non-zero member.

r? @lcnr
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Aug 29, 2020
…declarations-transparent-nonzero, r=lcnr

Fix another clashing_extern_declarations false positive.

Fixes rust-lang#75739.

Fix another clashing_extern_declarations false positive, this time for transparent newtype with a non-zero member.

r? @lcnr
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 30, 2020
Rollup of 14 pull requests

Successful merges:

 - rust-lang#75832 (Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs…)
 - rust-lang#75852 (Switch to intra-doc links in `core::hash`)
 - rust-lang#75874 (Shorten liballoc doc intra link while readable)
 - rust-lang#75881 (Expand rustdoc theme chooser x padding)
 - rust-lang#75885 (Fix another clashing_extern_declarations false positive.)
 - rust-lang#75892 (Fix typo in TLS Model in Unstable Book)
 - rust-lang#75910 (Add test for issue rust-lang#27130)
 - rust-lang#75917 (Move to intra doc links for core::ptr::non_null)
 - rust-lang#75975 (Allow --bess ing expect-tests in tools)
 - rust-lang#75990 (Add __fastfail for Windows on arm/aarch64)
 - rust-lang#76015 (Fix loading pretty-printers in rust-lldb script)
 - rust-lang#76022 (Clean up rustdoc front-end source code)
 - rust-lang#76029 (Move to intra-doc links for library/core/src/sync/atomic.rs)
 - rust-lang#76057 (Move retokenize hack to save_analysis)

Failed merges:

r? @ghost
@bors bors merged commit 5511e73 into rust-lang:master Aug 30, 2020
@cuviper cuviper added this to the 1.48.0 milestone Nov 17, 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.

Additional incorrect clashing_extern_decl warning for #[repr(transparent)] non-zero types
9 participants