-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Cbindgen fails on latest nightly (1.68.0-nightly) with an internal compiler error #105886
Cbindgen fails on latest nightly (1.68.0-nightly) with an internal compiler error #105886
Comments
searched nightlies: from nightly-2022-12-15 to nightly-2022-12-19 bisected with cargo-bisect-rustc v0.6.5Host triple: x86_64-pc-windows-msvc cargo bisect-rustc --preserve --access github --script bisect.bat at pact-foundation/pact-reference@09479b9 |
Revert rust-lang#103880 "Use non-ascribed type as field's type in mir" This PR prepares a revert for rust-lang#103880 to fix rust-lang#105809, rust-lang#105881, rust-lang#105886 and others (like the duplicates of the first one), in case an actual fix can't get done today. I've also added the MCVE from rust-lang#105809. There is no MCVE for the rust-lang#105881 and rust-lang#105886 ICEs yet however, so there are no tests for them here, although we'll need one before relanding the original changes. Were this PR to land, it would also reopen rust-lang#96514 as it was fixed by the original PR. Opening as draft to allow time for a possible fix. r? `@jackh726`
This should be fixed in tomorrow's nightly now that #105905 has been merged. However, it would be great to have a minimal example that we could add as a non-regression test. |
I worked on an MCVE. It's maybe not minimal yet, but it's standalone. It only works when building as a library (lib.rs), not from a binary (main.rs) use std::future::{pending, Future};
async fn handle_request() -> Result<(), String> {
loop {}
}
struct Server<S> {
_make_service: S,
}
impl Server<()> {
pub fn bind<S>(_make_service: S) -> Server<S> {
loop {}
}
}
impl<T> Server<T> {
fn with_graceful_shutdown<>(self) -> impl Future<Output = ()>
{
pending()
}
}
pub(crate) async fn create_and_bind(
_: impl Future<Output = ()>,
) -> (impl Future<Output = ()>,) {
let server = Server::bind(handle_request().await);
(async { server.with_graceful_shutdown().await; },)
}
pub async fn new() -> Result<(), String> {
let (_future,) = create_and_bind(async { pending().await }).await;
Ok(())
} cc @b-naber |
Thanks a lot. |
should be closed by #105905 |
cbindgen internally runs
cargo rustc -Zunpretty=expanded
which is failing with an internal compiler error. You can see a failed build with the error at https://github.com/pact-foundation/pact-reference/actions/runs/3720065127/jobs/6320910722Code
You can reproduce the error by running:
https://github.com/pact-foundation/pact-reference
cd rust/pact_ffi
rustup run nightly cbindgen --config cbindgen.toml --crate pact_ffi
Meta
Note, cbindgen requires to run with nightly rust.
rustc --version --verbose
:Error output
This has been extracted from the failing CI build:
The text was updated successfully, but these errors were encountered: