Skip to content

async code fails to compile with -Znext-solver #129865

@0xdeafbeef

Description

@0xdeafbeef

I tried this code:

cd $(mktemp -d) git clone https://github.com/wvwwvwwv/scalable-concurrent-containers.git cd scalable-concurrent-containers/ git checkout c014a2c7ce98a13237b842bd03b80206ff8bb66e

compiling with normal rustc succeeds:

cargo +nightly check --locked Checking sdd v3.0.2 Checking scc v2.1.16 (/tmp/tmp.RjDtqDRisT/scalable-concurrent-containers) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.72s 

using next-solver fails

RUSTFLAGS='-Znext-solver' cargo +nightly check Checking sdd v3.0.2 Checking scc v2.1.16 (/tmp/tmp.RjDtqDRisT/scalable-concurrent-containers) error: concrete type differs from previous defining opaque type use --> src/hash_map.rs:1439:5 | 1439 | async fn cleanse_old_array_async(&self, current_array: &BucketArray<K, V, (), SEQUENTIAL>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{async fn body of hash_map::HashMap<K, V, H>::cleanse_old_array_async()}`, got `{async fn body of hash_map::HashMap<K, V, H>::cleanse_old_array_async()}` | = note: previous use here error: concrete type differs from previous defining opaque type use --> src/hash_index.rs:1090:5 | 1090 | async fn cleanse_old_array_async(&self, current_array: &BucketArray<K, V, (), OPTIMISTIC>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{async fn body of HashIndex<K, V, H>::cleanse_old_array_async()}`, got `{async fn body of HashIndex<K, V, H>::cleanse_old_array_async()}` | = note: previous use here error: concrete type differs from previous defining opaque type use --> src/hash_cache.rs:1064:5 | 1064 | / async fn cleanse_old_array_async( 1065 | | &self, 1066 | | current_array: &BucketArray<K, V, DoublyLinkedList, CACHE>, 1067 | | ) { | |_____^ expected `{async fn body of HashCache<K, V, H>::cleanse_old_array_async()}`, got `{async fn body of HashCache<K, V, H>::cleanse_old_array_async()}` | = note: previous use here error: could not compile `scc` (lib) due to 3 previous errors 

Meta

rustc --version --verbose:

cargo 1.82.0-nightly (8f40fc59f 2024-08-21) release: 1.82.0-nightly commit-hash: 8f40fc59fb0c8df91c97405785197f3c630304ea commit-date: 2024-08-21 host: x86_64-unknown-linux-gnu libgit2: 1.8.1 (sys:0.19.0 vendored) libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w) ssl: OpenSSL 1.1.1w 11 Sep 2023 os: Fedora 40.0.0 [64-bit] 

I'm not sure even if it is an issue, but here's report anyway :)

Metadata

Metadata

Labels

A-async-awaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions