Skip to content

Commit 266ed66

Browse files
committed
rebase
1 parent 65ea825 commit 266ed66

File tree

4 files changed

+1630
-3
lines changed

4 files changed

+1630
-3
lines changed

library/core/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,11 @@
271271
#[allow(unused_extern_crates)]
272272
extern crate self as core;
273273

274+
#[allow(unused_imports)]
275+
use crate::marker::FnPtr;
274276
#[prelude_import]
275277
#[allow(unused)]
276278
use prelude::v1::*;
277-
278279
#[cfg(not(test))] // See #65860
279280
#[macro_use]
280281
mod macros;
@@ -440,5 +441,4 @@ pub mod simd {
440441
#[unstable(feature = "portable_simd", issue = "86656")]
441442
pub use crate::core_simd::simd::*;
442443
}
443-
444444
include!("primitive_docs.rs");

library/core/src/primitive_docs.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ mod prim_ref {}
15491549
/// * [`Clone`]
15501550
/// * [`Copy`]
15511551
/// * [`Send`]
1552+
/// * [`Sized`]
15521553
/// * [`Sync`]
15531554
/// * [`Unpin`]
15541555
/// * [`UnwindSafe`]
@@ -1588,3 +1589,18 @@ impl<Ret, T> Clone for fn(T) -> Ret {
15881589
impl<Ret, T> Copy for fn(T) -> Ret {
15891590
// empty
15901591
}
1592+
1593+
// Fake impl that's only really used for docs.
1594+
#[cfg(doc)]
1595+
#[unstable(
1596+
feature = "fn_ptr_trait",
1597+
issue = "none",
1598+
reason = "internal trait for implementing various traits for all function pointers"
1599+
)]
1600+
#[doc(fake_variadic)]
1601+
/// This trait is implemented on function pointers with any number of arguments.
1602+
impl<Ret, T> FnPtr for fn(T) -> Ret {
1603+
fn addr(self) -> *const () {
1604+
// empty
1605+
}
1606+
}

library/std/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371
#![feature(core_panic)]
372372
#![feature(custom_test_frameworks)]
373373
#![feature(edition_panic)]
374+
#![feature(fn_ptr_trait)]
374375
#![feature(format_args_nl)]
375376
#![feature(get_many_mut)]
376377
#![feature(lazy_cell)]
@@ -399,10 +400,11 @@
399400

400401
// Explicitly import the prelude. The compiler uses this same unstable attribute
401402
// to import the prelude implicitly when building crates that depend on std.
403+
#[allow(unused_imports)]
404+
use crate::marker::FnPtr;
402405
#[prelude_import]
403406
#[allow(unused)]
404407
use prelude::rust_2021::*;
405-
406408
// Access to Bencher, etc.
407409
#[cfg(test)]
408410
extern crate test;

0 commit comments

Comments
 (0)