Skip to content

improve next solver higher-ranked Send diagnostic - #162302

Draft
amirHdev wants to merge 1 commit into
rust-lang:mainfrom
amirHdev:next-solver-hr-region-diagnostics
Draft

improve next solver higher-ranked Send diagnostic#162302
amirHdev wants to merge 1 commit into
rust-lang:mainfrom
amirHdev:next-solver-hr-region-diagnostics

Conversation

@amirHdev

@amirHdev amirHdev commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 4, 2026
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
@amirHdev
amirHdev force-pushed the next-solver-hr-region-diagnostics branch from 20289dc to a327c7f Compare September 4, 2026 17:46
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:

---- [ui] tests/ui/async-await/higher-ranked-auto-trait-18.rs#no_assumptions stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/async-await/higher-ranked-auto-trait-18.no_assumptions/higher-ranked-auto-trait-18.no_assumptions.stderr`
diff of stderr:

- error: higher-ranked lifetime error
+ error: implementation of `Send` is not general enough
2   --> $DIR/higher-ranked-auto-trait-18.rs:69:5
3    |
4 LL | /     require_send(async {

5 LL | |         let r = Receiver::<Box<dyn MyTrait>> { _value: None, _not_sync: PhantomData };
6 LL | |         let _ = r.await;
7 LL | |     });
-    | |______^
+    | |______^ implementation of `Send` is not general enough
9    |
-    = note: could not prove `{async block@$DIR/higher-ranked-auto-trait-18.rs:69:18: 69:23}: Send`
+    = note: `Send` would have to be implemented for the type `Receiver<Box<dyn MyTrait>>`
+    = note: ...but `Send` is actually implemented for the type `Receiver<Box<(dyn MyTrait + '0)>>`, for some specific lifetime `'0`
11 
12 error: aborting due to 1 previous error
13 


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/higher-ranked-auto-trait-18.rs`

error in revision `no_assumptions`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/higher-ranked-auto-trait-18.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "no_assumptions" "--check-cfg" "cfg(test,FALSE,assumptions,no_assumptions)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/async-await/higher-ranked-auto-trait-18.no_assumptions" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021"
stdout: none
--- stderr -------------------------------
error: implementation of `Send` is not general enough
##[error]  --> /checkout/tests/ui/async-await/higher-ranked-auto-trait-18.rs:69:5
   |
LL | /     require_send(async {
LL | |         let r = Receiver::<Box<dyn MyTrait>> { _value: None, _not_sync: PhantomData };
LL | |         let _ = r.await;
LL | |     });
   | |______^ implementation of `Send` is not general enough
   |
   = note: `Send` would have to be implemented for the type `Receiver<Box<dyn MyTrait>>`
   = note: ...but `Send` is actually implemented for the type `Receiver<Box<(dyn MyTrait + '0)>>`, for some specific lifetime `'0`

error: aborting due to 1 previous error
------------------------------------------

---- [ui] tests/ui/async-await/higher-ranked-auto-trait-18.rs#no_assumptions stdout end ----

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants