Skip to content

reject reborrowing when the target has no lifetime generic arg - #158966

Open
senioria wants to merge 1 commit into
rust-lang:mainfrom
senioria:reject-reborrow
Open

reject reborrowing when the target has no lifetime generic arg#158966
senioria wants to merge 1 commit into
rust-lang:mainfrom
senioria:reject-reborrow

Conversation

@senioria

@senioria senioria commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

suppresses the ICE in #156307 and #156308, but doesn't fix the problem that reborrowing is conflict with moving.

Reborrow traits experiment: #145612

fixes #156307.

@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 Jul 8, 2026
@rustbot

rustbot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

@rustbot

This comment has been minimized.

suppresses the ICE about hir-typeck passed but Reborrow does not have a lifetime argument,
but doesn't fix the problem that reborrowing is conflict with moving.
@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)
test [crashes] tests/crashes/98322.rs ... ok
test [crashes] tests/crashes/project-to-simd-array-field.rs ... ok
test [crashes] tests/crashes/reborrow/coerce-shared-alias-projection.rs ... ok
test [crashes] tests/crashes/reborrow/coerce-shared-different-layout.rs ... ok
2026-07-08T17:54:58.117806Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/reborrow/coerce-shared-marker-no-target-lifetime.rs ... FAILED
test [crashes] tests/crashes/reborrow/coerce-shared-multi-field.rs ... ok
test [crashes] tests/crashes/reborrow/coerce-shared-nested.rs ... ok
test [crashes] tests/crashes/reborrow/coerce-shared-tuple-phantom-position.rs ... ok
test [crashes] tests/crashes/reborrow/corrected-field-mismatch-coerce-shared-issue-156315.rs ... ok
---

---- [crashes] tests/crashes/reborrow/coerce-shared-marker-no-target-lifetime.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: implementing `CoerceShared` does not allow multiple lifetimes or fields to be coerced
##[error]  --> /checkout/tests/crashes/reborrow/coerce-shared-marker-no-target-lifetime.rs:12:10
   |
12 | impl<'a> CoerceShared<CustomMarkerRef> for CustomMarker<'a> {}
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
##[error]  --> /checkout/tests/crashes/reborrow/coerce-shared-marker-no-target-lifetime.rs:19:12
   |
---
   |
note: function defined here
  --> /checkout/tests/crashes/reborrow/coerce-shared-marker-no-target-lifetime.rs:15:4
   |
15 | fn method(_a: CustomMarkerRef) {}
   |    ^^^^^^ -------------------

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.

------------------------------------------

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/reborrow/coerce-shared-marker-no-target-lifetime.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:16:18:
fatal error
stack backtrace:
   8: __rustc::rust_begin_unwind

@nnethercote

Copy link
Copy Markdown
Contributor

I'm not a good reviewer for this. Let's try...

r? @jackh726

@rustbot rustbot assigned jackh726 and unassigned nnethercote Jul 10, 2026
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.

[ICE]: "hir-typeck passed but Reborrow does not have a lifetime argument"

5 participants