Files
rust/library/core/src
León Orell Valerian Liehr ab9e0a72ef Rollup merge of #125043 - RalfJung:ref-type-safety-invariant, r=scottmcm
reference type safety invariant docs: clarification

The old text could have been read as saying that you can call a function if these requirements are upheld, which is definitely not true as they are an underapproximation of the actual safety invariant.

I removed the part about functions relaxing the requirements via their documentation... this seems incoherent with saying that it may actually be unsound to ever temporarily violate the requirement. Furthermore, a function *cannot* just relax this for its return value, that would in general be unsound. And the part about "unsafe code in a safe function may assume these invariants are ensured of arguments passed by the caller" also interacts with relaxing things: clearly, if the invariant has been relaxed, unsafe code cannot rely on it any more. There may be a place to give general guidance on what kinds of function contracts can exist, but the reference type is definitely not the right place to write that down.

I also took a clarification from https://github.com/rust-lang/rust/pull/121965 that is orthogonal to the rest of that PR.

Cc ```@joshlf``` ```@scottmcm```
2024-05-22 23:41:11 +02:00
..
2024-05-20 19:21:30 -04:00
2024-02-13 12:04:44 +01:00
2024-05-09 17:04:30 +02:00
2024-05-04 22:56:35 +01:00
2024-05-01 22:19:11 -04:00
2024-03-29 17:10:17 +01:00
2024-05-20 19:21:30 -04:00
2024-05-01 22:19:11 -04:00
2024-05-01 22:19:11 -04:00
2024-05-01 22:19:11 -04:00
2024-03-29 10:10:52 -07:00
2024-03-07 07:49:22 +01:00
2024-05-09 17:04:30 +02:00
2023-04-16 07:20:26 +00:00
2023-07-28 14:46:17 +02:00
2024-05-01 22:19:11 -04:00
2024-05-01 22:19:11 -04:00
2023-09-06 09:47:22 -07:00
2024-03-02 16:03:23 +08:00
2024-05-09 17:04:30 +02:00
2024-05-01 22:19:11 -04:00
2024-04-08 11:57:17 +00:00
2024-05-15 08:07:16 -03:00