File tree 4 files changed +1650
-3
lines changed
4 files changed +1650
-3
lines changed Original file line number Diff line number Diff line change 281
281
#[ allow( unused_extern_crates) ]
282
282
extern crate self as core;
283
283
284
+ #[ allow( unused_imports) ]
285
+ use crate :: marker:: FnPtr ;
284
286
#[ prelude_import]
285
287
#[ allow( unused) ]
286
288
use prelude:: v1:: * ;
287
-
288
289
#[ cfg( not( test) ) ] // See #65860
289
290
#[ macro_use]
290
291
mod macros;
@@ -453,5 +454,4 @@ pub mod simd {
453
454
#[ unstable( feature = "portable_simd" , issue = "86656" ) ]
454
455
pub use crate :: core_simd:: simd:: * ;
455
456
}
456
-
457
457
include ! ( "primitive_docs.rs" ) ;
Original file line number Diff line number Diff line change @@ -1655,6 +1655,7 @@ mod prim_ref {}
1655
1655
/// * [`Clone`]
1656
1656
/// * [`Copy`]
1657
1657
/// * [`Send`]
1658
+ /// * [`Sized`]
1658
1659
/// * [`Sync`]
1659
1660
/// * [`Unpin`]
1660
1661
/// * [`UnwindSafe`]
@@ -1670,6 +1671,41 @@ mod prim_ref {}
1670
1671
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1671
1672
mod prim_fn { }
1672
1673
1674
+ // Fake impl that's only really used for docs.
1675
+ #[ cfg( doc) ]
1676
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1677
+ #[ doc( fake_variadic) ]
1678
+ /// This trait is implemented on function pointers with any number of arguments.
1679
+ impl < Ret , T > Clone for fn ( T ) -> Ret {
1680
+ fn clone ( & self ) -> Self {
1681
+ loop { }
1682
+ }
1683
+ }
1684
+
1685
+ // Fake impl that's only really used for docs.
1686
+ #[ cfg( doc) ]
1687
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1688
+ #[ doc( fake_variadic) ]
1689
+ /// This trait is implemented on function pointers with any number of arguments.
1690
+ impl < Ret , T > Copy for fn ( T ) -> Ret {
1691
+ // empty
1692
+ }
1693
+
1694
+ // Fake impl that's only really used for docs.
1695
+ #[ cfg( doc) ]
1696
+ #[ unstable(
1697
+ feature = "fn_ptr_trait" ,
1698
+ issue = "none" ,
1699
+ reason = "internal trait for implementing various traits for all function pointers"
1700
+ ) ]
1701
+ #[ doc( fake_variadic) ]
1702
+ /// This trait is implemented on function pointers with any number of arguments.
1703
+ impl < Ret , T > FnPtr for fn ( T ) -> Ret {
1704
+ fn addr ( self ) -> * const ( ) {
1705
+ // empty
1706
+ }
1707
+ }
1708
+
1673
1709
// Required to make auto trait impls render.
1674
1710
// See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls
1675
1711
#[ doc( hidden) ]
Original file line number Diff line number Diff line change 381
381
#![ feature( const_format_args) ]
382
382
#![ feature( custom_test_frameworks) ]
383
383
#![ feature( edition_panic) ]
384
+ #![ feature( fn_ptr_trait) ]
384
385
#![ feature( format_args_nl) ]
385
386
#![ feature( get_many_mut) ]
386
387
#![ feature( lazy_cell) ]
408
409
409
410
// Explicitly import the prelude. The compiler uses this same unstable attribute
410
411
// to import the prelude implicitly when building crates that depend on std.
412
+ #[ allow( unused_imports) ]
413
+ use crate :: marker:: FnPtr ;
411
414
#[ prelude_import]
412
415
#[ allow( unused) ]
413
416
use prelude:: rust_2021:: * ;
414
-
415
417
// Access to Bencher, etc.
416
418
#[ cfg( test) ]
417
419
extern crate test;
You can’t perform that action at this time.
0 commit comments