Skip to content

Conversation

@hkBst
Copy link
Member

@hkBst hkBst commented Nov 4, 2025

Continuation of #148348
r? @Urgau

@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 Nov 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 4, 2025

r? @lcnr

rustbot has assigned @lcnr.
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

@rustbot rustbot assigned Urgau and unassigned lcnr Nov 4, 2025
@Urgau Urgau added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2025
@hkBst
Copy link
Member Author

hkBst commented Nov 5, 2025

BTW help vs note: help should be used to show changes the user can possibly make to fix the problem. note should be used for everything else, such as other context, information and facts, online resources to read, etc. -- https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels

Should probably change a lot of these helps to notes...

@rust-cloud-vms rust-cloud-vms bot force-pushed the dangling-ptr-lint-2 branch from 0ef89d7 to 09188da Compare November 5, 2025 14:11
@hkBst
Copy link
Member Author

hkBst commented Nov 5, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 5, 2025
@rust-cloud-vms rust-cloud-vms bot force-pushed the dangling-ptr-lint-2 branch from 09188da to 9fb5a03 Compare November 7, 2025 10:54
.note_safe = a dangling pointer is safe, but dereferencing one is undefined behavior
.note_more_info = for more information, see <https://doc.rust-lang.org/reference/destructors.html>
lint_dangling_pointers_from_temporaries = dangling pointer because temporary `{$ty}` is dropped at end of statement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a native English speaker but I think it's missing a word that links "dangling pointer" and "because temporary [...]", maybe "created" or "made"?

dangling pointer created because {$ty} temporary is dropped at end of statement

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose there is an implied "there is a" at the beginning, but I suppose instead of "dangling pointer", "pointer is dangling" is not that much longer. Would that make it better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that works to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Urgau Urgau added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2025
@rust-cloud-vms rust-cloud-vms bot force-pushed the dangling-ptr-lint-2 branch 2 times, most recently from cf34e89 to 6d9c94c Compare November 28, 2025 12:22
@hkBst
Copy link
Member Author

hkBst commented Nov 28, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 28, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the dangling-ptr-lint-2 branch from 6d9c94c to 7606f4d Compare November 28, 2025 15:19
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-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/lint/dangling-pointers-from-temporaries/allow.rs stdout ----

error: 2 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/allow.rs:9:28: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/allow.rs:20:28: WARN: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 2 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/allow.rs:9:9: ERROR: dangling pointer
  reported with different kind: NOTE
  reported with different kind: NOTE
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/allow.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/allow.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/lint/dangling-pointers-from-temporaries/allow" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/allow.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/calls.rs stdout ----

error: 5 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/calls.rs:27:29: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/calls.rs:32:29: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/calls.rs:41:37: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/calls.rs:43:41: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/calls.rs:45:39: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 5 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/calls.rs:27:9: ERROR: dangling pointer
  reported with different kind: NOTE
  reported with different kind: NOTE
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/calls.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/calls.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/lint/dangling-pointers-from-temporaries/calls" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/calls.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs stdout ----

error: 2 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs:15:48: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs:9:52: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 2 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs:9:9: ERROR: dangling pointer
  reported with different kind: NOTE on different line: tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs:15:48
  reported with different kind: NOTE on different line: tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs:15:48
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/cstring-as-ptr.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/lint/dangling-pointers-from-temporaries/cstring-as-ptr" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/cstring-as-ptr.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.rs stdout ----

error: 2 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.rs:5:48: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.rs:7:70: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 2 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.rs:5:5: ERROR: dangling pointer
  reported with different kind: NOTE
  reported with different kind: NOTE
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/example-from-issue123613.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/lint/dangling-pointers-from-temporaries/example-from-issue123613" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/methods.rs stdout ----

error: 2 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/methods.rs:4:15: ERROR: pointer is dangling because temporary `Vec<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/methods.rs:6:15: ERROR: pointer is dangling because temporary `Vec<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 2 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/methods.rs:4:5: ERROR: dangling pointer
  reported with different kind: NOTE
  reported with different kind: NOTE
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/methods.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/methods.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/lint/dangling-pointers-from-temporaries/methods" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/methods.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/ext.rs stdout ----

error: 2 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/ext.rs:28:35: ERROR: pointer is dangling because temporary `Vec<u32>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/ext.rs:30:25: ERROR: pointer is dangling because temporary `Vec<u32>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 2 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/ext.rs:28:5: ERROR: dangling pointer
  reported with different kind: NOTE
  reported with different kind: NOTE
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/ext.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/ext.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/lint/dangling-pointers-from-temporaries/ext" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/ext.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs stdout ----

error: 8 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:21:14: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:25:25: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:32:26: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:68:61: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:77:10: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:86:10: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:94:18: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:134:15: ERROR: pointer is dangling because temporary `Vec<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer

error: 8 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs:21:5: ERROR: dangling pointer
  reported with different kind: NOTE
  reported with different kind: NOTE
---

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/temporaries.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/lint/dangling-pointers-from-temporaries/temporaries" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/temporaries.rs stdout end ----
---- [ui] tests/ui/lint/dangling-pointers-from-temporaries/types.rs stdout ----

error: 17 diagnostics reported in JSON output but not expected in test file
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:21:26: ERROR: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `CString`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:23:25: ERROR: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `String`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:25:26: ERROR: pointer is dangling because temporary `Vec<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Vec<u8>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:27:31: ERROR: pointer is dangling because temporary `Box<CString>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<CString>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:29:28: ERROR: pointer is dangling because temporary `Box<[u8]>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<[u8]>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:31:27: ERROR: pointer is dangling because temporary `Box<str>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<str>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:33:28: ERROR: pointer is dangling because temporary `Box<CStr>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<CStr>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:35:27: ERROR: pointer is dangling because temporary `[u8; 10]` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `[u8; 10]`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:37:32: ERROR: pointer is dangling because temporary `Box<[u8; 10]>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<[u8; 10]>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:39:31: ERROR: pointer is dangling because temporary `Box<Vec<u8>>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<Vec<u8>>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:41:30: ERROR: pointer is dangling because temporary `Box<String>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<String>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:43:43: ERROR: pointer is dangling because temporary `Box<Box<Box<Box<[u8]>>>>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Box<Box<Box<Box<[u8]>>>>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:45:27: ERROR: pointer is dangling because temporary `Cell<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Cell<u8>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:47:34: ERROR: pointer is dangling because temporary `MaybeUninit<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `MaybeUninit<u8>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:49:33: ERROR: pointer is dangling because temporary `Vec<AsPtrFake>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `Vec<AsPtrFake>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:51:33: ERROR: pointer is dangling because temporary `UnsafeCell<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `UnsafeCell<u8>`
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:53:37: ERROR: pointer is dangling because temporary `SyncUnsafeCell<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
  expected with different message: dangling pointer because temporary `SyncUnsafeCell<u8>`

error: 17 diagnostics expected in test file but not reported in JSON output
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:21:5: ERROR: dangling pointer because temporary `CString`
  reported with different message: pointer is dangling because temporary `CString` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:23:5: ERROR: dangling pointer because temporary `String`
  reported with different message: pointer is dangling because temporary `String` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:25:5: ERROR: dangling pointer because temporary `Vec<u8>`
  reported with different message: pointer is dangling because temporary `Vec<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:27:5: ERROR: dangling pointer because temporary `Box<CString>`
  reported with different message: pointer is dangling because temporary `Box<CString>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:29:5: ERROR: dangling pointer because temporary `Box<[u8]>`
  reported with different message: pointer is dangling because temporary `Box<[u8]>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:31:5: ERROR: dangling pointer because temporary `Box<str>`
  reported with different message: pointer is dangling because temporary `Box<str>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:33:5: ERROR: dangling pointer because temporary `Box<CStr>`
  reported with different message: pointer is dangling because temporary `Box<CStr>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:35:5: ERROR: dangling pointer because temporary `[u8; 10]`
  reported with different message: pointer is dangling because temporary `[u8; 10]` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:37:5: ERROR: dangling pointer because temporary `Box<[u8; 10]>`
  reported with different message: pointer is dangling because temporary `Box<[u8; 10]>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:39:5: ERROR: dangling pointer because temporary `Box<Vec<u8>>`
  reported with different message: pointer is dangling because temporary `Box<Vec<u8>>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:41:5: ERROR: dangling pointer because temporary `Box<String>`
  reported with different message: pointer is dangling because temporary `Box<String>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:43:5: ERROR: dangling pointer because temporary `Box<Box<Box<Box<[u8]>>>>`
  reported with different message: pointer is dangling because temporary `Box<Box<Box<Box<[u8]>>>>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:45:5: ERROR: dangling pointer because temporary `Cell<u8>`
  reported with different message: pointer is dangling because temporary `Cell<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:47:5: ERROR: dangling pointer because temporary `MaybeUninit<u8>`
  reported with different message: pointer is dangling because temporary `MaybeUninit<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:49:5: ERROR: dangling pointer because temporary `Vec<AsPtrFake>`
  reported with different message: pointer is dangling because temporary `Vec<AsPtrFake>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:51:5: ERROR: dangling pointer because temporary `UnsafeCell<u8>`
  reported with different message: pointer is dangling because temporary `UnsafeCell<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]
tests/ui/lint/dangling-pointers-from-temporaries/types.rs:53:5: ERROR: dangling pointer because temporary `SyncUnsafeCell<u8>`
  reported with different message: pointer is dangling because temporary `SyncUnsafeCell<u8>` is dropped at end of statement [dangling_pointers_from_temporaries]

thread '[ui] tests/ui/lint/dangling-pointers-from-temporaries/types.rs' panicked at src/tools/compiletest/src/runtest.rs:923:13:
errors differ from expected
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/lint/dangling-pointers-from-temporaries/types.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/lint/dangling-pointers-from-temporaries/types" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"

stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   6: core::panicking::panic_fmt

@Urgau Urgau added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 3, 2025
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants