mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
rustdoc: Add some basic Safety sections to unsafe functions (#31639)
This commit is contained in:
parent
0860deba05
commit
38db1a5ce9
3 changed files with 22 additions and 0 deletions
|
@ -546,6 +546,11 @@ macro_rules! define_resource_id {
|
|||
impl $name {
|
||||
#[allow(unsafe_code)]
|
||||
#[inline]
|
||||
/// Create a new $name.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Using an invalid OpenGL id may result in undefined behavior.
|
||||
pub unsafe fn new(id: $type) -> Self {
|
||||
$name(<nonzero_type!($type)>::new_unchecked(id))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue