File tree 4 files changed +37
-3
lines changed
4 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 271
271
#[ allow( unused_extern_crates) ]
272
272
extern crate self as core;
273
273
274
+ #[ allow( unused_imports) ]
275
+ use crate :: marker:: FnPtr ;
274
276
#[ prelude_import]
275
277
#[ allow( unused) ]
276
278
use prelude:: v1:: * ;
277
-
278
279
#[ cfg( not( test) ) ] // See #65860
279
280
#[ macro_use]
280
281
mod macros;
@@ -440,5 +441,4 @@ pub mod simd {
440
441
#[ unstable( feature = "portable_simd" , issue = "86656" ) ]
441
442
pub use crate :: core_simd:: simd:: * ;
442
443
}
443
-
444
444
include ! ( "primitive_docs.rs" ) ;
Original file line number Diff line number Diff line change @@ -1552,6 +1552,7 @@ mod prim_ref {}
1552
1552
/// * [`Clone`]
1553
1553
/// * [`Copy`]
1554
1554
/// * [`Send`]
1555
+ /// * [`Sized`]
1555
1556
/// * [`Sync`]
1556
1557
/// * [`Unpin`]
1557
1558
/// * [`UnwindSafe`]
@@ -1591,3 +1592,18 @@ impl<Ret, T> Clone for fn(T) -> Ret {
1591
1592
impl < Ret , T > Copy for fn ( T ) -> Ret {
1592
1593
// empty
1593
1594
}
1595
+
1596
+ // Fake impl that's only really used for docs.
1597
+ #[ cfg( doc) ]
1598
+ #[ unstable(
1599
+ feature = "fn_ptr_trait" ,
1600
+ issue = "none" ,
1601
+ reason = "internal trait for implementing various traits for all function pointers"
1602
+ ) ]
1603
+ #[ doc( fake_variadic) ]
1604
+ /// This trait is implemented on function pointers with any number of arguments.
1605
+ impl < Ret , T > FnPtr for fn ( T ) -> Ret {
1606
+ fn addr ( self ) -> * const ( ) {
1607
+ // empty
1608
+ }
1609
+ }
Original file line number Diff line number Diff line change 347
347
#![ feature( core_panic) ]
348
348
#![ feature( custom_test_frameworks) ]
349
349
#![ feature( edition_panic) ]
350
+ #![ feature( fn_ptr_trait) ]
350
351
#![ feature( format_args_nl) ]
351
352
#![ feature( get_many_mut) ]
352
353
#![ feature( lazy_cell) ]
376
377
377
378
// Explicitly import the prelude. The compiler uses this same unstable attribute
378
379
// to import the prelude implicitly when building crates that depend on std.
380
+ #[ allow( unused_imports) ]
381
+ use crate :: marker:: FnPtr ;
379
382
#[ prelude_import]
380
383
#[ allow( unused) ]
381
384
use prelude:: rust_2021:: * ;
382
-
383
385
// Access to Bencher, etc.
384
386
#[ cfg( test) ]
385
387
extern crate test;
Original file line number Diff line number Diff line change @@ -1552,6 +1552,7 @@ mod prim_ref {}
1552
1552
/// * [`Clone`]
1553
1553
/// * [`Copy`]
1554
1554
/// * [`Send`]
1555
+ /// * [`Sized`]
1555
1556
/// * [`Sync`]
1556
1557
/// * [`Unpin`]
1557
1558
/// * [`UnwindSafe`]
@@ -1591,3 +1592,18 @@ impl<Ret, T> Clone for fn(T) -> Ret {
1591
1592
impl < Ret , T > Copy for fn ( T ) -> Ret {
1592
1593
// empty
1593
1594
}
1595
+
1596
+ // Fake impl that's only really used for docs.
1597
+ #[ cfg( doc) ]
1598
+ #[ unstable(
1599
+ feature = "fn_ptr_trait" ,
1600
+ issue = "none" ,
1601
+ reason = "internal trait for implementing various traits for all function pointers"
1602
+ ) ]
1603
+ #[ doc( fake_variadic) ]
1604
+ /// This trait is implemented on function pointers with any number of arguments.
1605
+ impl < Ret , T > FnPtr for fn ( T ) -> Ret {
1606
+ fn addr ( self ) -> * const ( ) {
1607
+ // empty
1608
+ }
1609
+ }
You can’t perform that action at this time.
0 commit comments