mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Fix and enable unsafe_op_in_unsafe_fn
This commit is contained in:
parent
eeb192b79a
commit
b392eb4eb5
6 changed files with 29 additions and 30 deletions
|
@ -63,7 +63,8 @@ impl InternId {
|
|||
/// `value` must be less than `MAX`
|
||||
pub const unsafe fn new_unchecked(value: u32) -> Self {
|
||||
debug_assert!(value < InternId::MAX);
|
||||
InternId { value: NonZeroU32::new_unchecked(value + 1) }
|
||||
let value = unsafe { NonZeroU32::new_unchecked(value + 1) };
|
||||
InternId { value }
|
||||
}
|
||||
|
||||
/// Convert this raw-id into a u32 value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue