diff options
author | 2024-04-01 14:45:36 -0700 | |
---|---|---|
committer | 2024-05-05 13:19:37 +0200 | |
commit | be2ca1e03965ffb214b6cbda0ffd84daeeb5f214 (patch) | |
tree | 2985316ea302b188c1a7e4fbe342ea74cdb9ad98 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | rust: kernel: remove usage of `allocator_api` unstable feature (diff) | |
download | wireguard-linux-be2ca1e03965ffb214b6cbda0ffd84daeeb5f214.tar.xz wireguard-linux-be2ca1e03965ffb214b6cbda0ffd84daeeb5f214.zip |
rust: types: Make Opaque::get const
To support a potential usage:
static foo: Opaque<Foo> = ..; // Or defined in an extern block.
...
fn bar() {
let ptr = foo.get();
}
`Opaque::get` need to be `const`, otherwise compiler will complain
because calls on statics are limited to const functions.
Also `Opaque::get` should be naturally `const` since it's a composition
of two `const` functions: `UnsafeCell::get` and `ptr::cast`.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Wedson Almeida Filho <walmeida@microsoft.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20240401214543.1242286-1-boqun.feng@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions