Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1069a68

Browse files
core: VaArgSafe is an unsafe trait
`T: VaArgSafe` is relied on for soundness. Safe impls promise nothing.Therefore this must be an unsafe trait. Slightly pedantic, asonly core can impl this, but we could choose to unseal the trait.That would allow soundly (but unsafely) implementing this for e.g.a `#[repr(C)] struct` that should be passable by varargs.
1 parente51d8a2 commit1069a68

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎core/src/ffi/mod.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ mod sealed_trait {
484484
all supported platforms",
485485
issue ="44930"
486486
)]
487-
pubtraitVaArgSafe{}
487+
pubunsafetraitVaArgSafe{}
488488
}
489489

490490
macro_rules! impl_va_arg_safe{
@@ -494,7 +494,7 @@ macro_rules! impl_va_arg_safe {
494494
reason ="the `c_variadic` feature has not been properly tested on\
495495
all supported platforms",
496496
issue ="44930")]
497-
impl sealed_trait::VaArgSafefor $t{}
497+
unsafeimpl sealed_trait::VaArgSafefor $t{}
498498
)+
499499
}
500500
}
@@ -509,14 +509,15 @@ impl_va_arg_safe! {f64}
509509
all supported platforms",
510510
issue ="44930"
511511
)]
512-
impl<T> sealed_trait::VaArgSafefor*mutT{}
512+
unsafeimpl<T> sealed_trait::VaArgSafefor*mutT{}
513+
513514
#[unstable(
514515
feature ="c_variadic",
515516
reason ="the `c_variadic` feature has not been properly tested on\
516517
all supported platforms",
517518
issue ="44930"
518519
)]
519-
impl<T> sealed_trait::VaArgSafefor*constT{}
520+
unsafeimpl<T> sealed_trait::VaArgSafefor*constT{}
520521

521522
#[unstable(
522523
feature ="c_variadic",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp