Skip to content

windows-sys v0.59.0 (latest version) hits a FCW on the latest nightly #142330

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

Closed
tgross35 opened this issue Jun 11, 2025 · 14 comments · Fixed by microsoft/windows-rs#3622
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-future-incompatibility Category: Future-incompatibility lints O-windows Operating system: Windows regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tgross35
Copy link
Contributor

I happened to notice this on the playground https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=ef32dafd88af58c9b698a698fd39d818:

warning: the following packages contain code that will be rejected by a future version of Rust: windows-sys v0.59.0

It appears on nightly but not beta so this must be from a recent change. I don't currently have access to a Windows machine to check out what the error actually is, but considering windows-sys is a top 100 crate, we should probably consider removing the relevant lint from report_in_deps before the beta branch to give some migration time. Otherwise almost everybody developing on Windows is going to have a new error that they can't do much about.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 11, 2025
@tgross35 tgross35 added O-windows Operating system: Windows A-diagnostics Area: Messages for errors, warnings, and lints C-future-incompatibility Category: Future-incompatibility lints E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 11, 2025
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 11, 2025
@tgross35
Copy link
Contributor Author

Cc @kennykerr since I believe you maintain windows-sys

@workingjubilee
Copy link
Member

Probably code involving extern "stdcall", cc @RalfJung

@tgross35
Copy link
Contributor Author

That makes perfect sense, #141435 includes

report_in_deps: true,
. Maybe we could drop the report_in_deps for a version or two so windows-sys has a chance to migrate?

@tgross35
Copy link
Contributor Author

@workingjubilee
Copy link
Member

workingjubilee commented Jun 11, 2025

I am revising my guess: it actually is probably usages of extern "cdecl".

@Noratrieb Noratrieb added P-critical Critical priority and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Jun 11, 2025
@Noratrieb
Copy link
Member

I agree that emitting an FCW on every windows build is really bad, we should back that out again. I can do that but will only get to it later today, so if someone else wants to do it that'd be great.

@RalfJung
Copy link
Member

Does someone have the actual full error that is being emitted, not just that one-line summary?

Maybe we could drop the report_in_deps for a version or two so windows-sys has a chance to migrate?

Makes sense.

@ChrisDenton
Copy link
Member

I'm at a PC now so yes I do: warnings.txt

@tgross35
Copy link
Contributor Author

To snip one of the messages from the file:

> warning: use of calling convention not supported on this target
>    --> R:\apps\cargo\registry\src\index.crates.io-1949cf8c6b5b557f\windows-targets-0.52.6\src\lib.rs:39:9
>     |
> 36  |   macro_rules! link {
>     |   ----------------- in this expansion of `windows_targets::link!`
> ...
> 39  | /         extern $abi {
> 40  | |             $(#[link_name=$link_name])?
> 41  | |             pub fn $($function)*;
> 42  | |         }
>     | |_________^
>     |
>    ::: R:\apps\cargo\registry\src\index.crates.io-1949cf8c6b5b557f\windows-sys-0.59.0\src\Windows\Wdk\NetworkManagement\Ndis\mod.rs:123:1
>     |
> 123 |   windows_targets::link!("ndis.sys" "cdecl" fn NdisWriteErrorLogEntry(ndisadapterhandle : *const core::ffi::c_void, errorcode : u32, numberoferrorvalues : u32, ...));
>     |   ------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation
>     |
>     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
>     = note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
>     = help: use `extern "C"` instead

Indeed seems to be cdecl. (When somebody updates this lint, probably wouldn't hurt to add the CC name to the warning message - it's a bit hidden in the macro here.)

@workingjubilee
Copy link
Member

Opened #142353 to nerf the linting on the relevant fronts for now so we can have this discussion.

@RalfJung
Copy link
Member

And that was building for an x86_64 windows target, I assume? Yeah then we would indeed complain about cdecl now.

@Noratrieb Noratrieb added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Jun 11, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 12, 2025
…cl-and-other-abis, r=RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss rust-lang#142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in rust-lang#141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 12, 2025
…cl-and-other-abis, r=RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss rust-lang#142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in rust-lang#141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 12, 2025
…cl-and-other-abis, r=RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss rust-lang#142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in rust-lang#141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 12, 2025
…cl-and-other-abis, r=RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss rust-lang#142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in rust-lang#141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
bors added a commit that referenced this issue Jun 12, 2025
…r-abis, r=RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss #142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in #141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 12, 2025
…cl-and-other-abis, r=RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss rust-lang#142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in rust-lang#141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
bors added a commit that referenced this issue Jun 13, 2025
…r-abis, r=ChrisDenton,RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss #142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in #141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
@jieyouxu
Copy link
Member

#142353 merged to downgrade the FCW to not report-in-deps1, so I believe this is no longer P-critical for prioritization purposes, but the long term discussion of how to transition the FCW to report-in-deps I believe is still outstanding (so this issue should be kept open).

@rustbot label: -P-critical

Footnotes

  1. In the short term.

@rustbot rustbot removed the P-critical Critical priority label Jun 14, 2025
@RalfJung
Copy link
Member

the long term discussion of how to transition the FCW to report-in-deps I believe is still outstanding (so this issue should be kept open).

Isn't #137018 the more natural place for that discussion?

@jieyouxu
Copy link
Member

jieyouxu commented Jun 14, 2025

Feel free to close this issue in favor of that if that issue is more suitable :) I was just looking at P-criticals

github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this issue Jun 16, 2025
…r-abis, r=ChrisDenton,RalfJung

compiler: Ease off the accelerator on `unsupported_calling_conventions`

This is to give us more time to discuss rust-lang/rust#142330 without the ecosystem having an anxiety attack. I have withdrawn `unsupported_calling_conventions` from report-in-deps

I believe we should consider this a simple suspension of the decision in rust-lang/rust#141435 to start this process, rather than a reversal. That is, we may continue with linting again. But I believe we are about to get a... reasonable amount of feedback just from currently available information and should allow ourselves time to process it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-future-incompatibility Category: Future-incompatibility lints O-windows Operating system: Windows regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants