Skip to content

Test that you can't implement Unpin for a compiler-generated future using TAIT#157069

Open
Darksonn wants to merge 1 commit into
rust-lang:mainfrom
Darksonn:unpin-for-fut-tait
Open

Test that you can't implement Unpin for a compiler-generated future using TAIT#157069
Darksonn wants to merge 1 commit into
rust-lang:mainfrom
Darksonn:unpin-for-fut-tait

Conversation

@Darksonn
Copy link
Copy Markdown
Member

I came up with this while trying to break pinning. Seems like a good idea to have a test that this doesn't change.

r? @RalfJung

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 28, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@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)
1 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-   --> $DIR/unpin-for-future.rs:18:1
+   --> $DIR/unpin-for-future.rs:19:1
3    |
4 LL | impl Unpin for MyFut {}
5    | ^^^^^^^^^^^^^^^-----

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/impl-trait/unpin-for-future.rs:19:1
+   --> $DIR/unpin-for-future.rs:19:1
---
To only update this specific test, also pass `--test-args impl-trait/unpin-for-future.rs`

error: 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/impl-trait/unpin-for-future.rs" "-Zthreads=1" "-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" "--check-cfg" "cfg(test,FALSE)" "--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/impl-trait/unpin-for-future" "-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=2024"
stdout: none
--- stderr -------------------------------
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
##[error]  --> /checkout/tests/ui/impl-trait/unpin-for-future.rs:19:1
   |
LL | impl Unpin for MyFut {}
   | ^^^^^^^^^^^^^^^-----
   |                |
   |                type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate
   |
   = note: impl doesn't have any local type before any uncovered type parameters

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

4 participants