]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #100848 - xfix:use-metadata-for-slice-len, r=thomcc
authorbors <bors@rust-lang.org>
Mon, 24 Oct 2022 04:14:46 +0000 (04:14 +0000)
committerbors <bors@rust-lang.org>
Mon, 24 Oct 2022 04:14:46 +0000 (04:14 +0000)
Use ptr::metadata in <[T]>::len implementation

This avoids duplication of ptr::metadata code.

I believe this is acceptable as the previous approach essentially duplicated `ptr::metadata` because back then `rustc_allow_const_fn_unstable` annotation did not exist.

I would like somebody to ping `@rust-lang/wg-const-eval` as the documentation says:

> Always ping `@rust-lang/wg-const-eval` if you are adding more rustc_allow_const_fn_unstable attributes to any const fn.

1  2 
library/core/src/ptr/mod.rs
library/core/src/slice/mod.rs

Simple merge
Simple merge