about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-13 07:03:51 +0200
committerGitHub <noreply@github.com>2025-08-13 07:03:51 +0200
commitb60d5b3672f701f182f5c4f6315c83e2c0223ee3 (patch)
treea516bb2809ba062d07cb082d66a6db4e3f10cc76 /compiler/rustc_codegen_gcc
parenta0ed0889bb246b1bf484d70f9561f1c494049458 (diff)
parent427be23b22573699f396431e48970a5659389b27 (diff)
downloadrust-b60d5b3672f701f182f5c4f6315c83e2c0223ee3.tar.gz
rust-b60d5b3672f701f182f5c4f6315c83e2c0223ee3.zip
Rollup merge of #145308 - giltho:dangling-doc, r=scottmcm
Adjust documentation of `dangling`

I believe the current doc of `dangling` is slightly off as it indicates:
`Note that the pointer value may potentially represent a valid pointer to a T`

The returned pointer has no provenance, so it may not be a valid pointer (except in the case of ZSTs, but I don't think this is what the documentation is trying to warn about).

See: https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Dangling.20pointers.3A.20definition

The value returned by dangling may never be used to dereference a value that isn't a ZST, even if address equality is detected with that of a valid pointer.
This is a minor fix, but this doc still got me confused for a second
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions