2 no_core
, lang_items
, intrinsics
, unboxed_closures
, type_ascription
, extern_types
,
3 untagged_unions
, decl_macro
, rustc_attrs
, transparent_unions
, auto_traits
,
10 unsafe extern "C" fn _Unwind_Resume() {
11 intrinsics
::unreachable();
21 pub trait Unsize
<T
: ?Sized
> {}
23 #[lang = "coerce_unsized"]
24 pub trait CoerceUnsized
<T
> {}
26 impl<'a
, 'b
: 'a
, T
: ?Sized
+ Unsize
<U
>, U
: ?Sized
> CoerceUnsized
<&'a U
> for &'b T {}
27 impl<'a
, T
: ?Sized
+ Unsize
<U
>, U
: ?Sized
> CoerceUnsized
<&'a
mut U
> for &'a
mut T {}
28 impl<T
: ?Sized
+ Unsize
<U
>, U
: ?Sized
> CoerceUnsized
<*const U
> for *const T {}
29 impl<T
: ?Sized
+ Unsize
<U
>, U
: ?Sized
> CoerceUnsized
<*mut U
> for *mut T {}
31 #[lang = "dispatch_from_dyn"]
32 pub trait DispatchFromDyn
<T
> {}
35 impl<'a
, T
: ?Sized
+Unsize
<U
>, U
: ?Sized
> DispatchFromDyn
<&'a U
> for &'a T {}
37 impl<'a
, T
: ?Sized
+Unsize
<U
>, U
: ?Sized
> DispatchFromDyn
<&'a
mut U
> for &'a
mut T {}
38 // *const T -> *const U
39 impl<T
: ?Sized
+Unsize
<U
>, U
: ?Sized
> DispatchFromDyn
<*const U
> for *const T {}
41 impl<T
: ?Sized
+Unsize
<U
>, U
: ?Sized
> DispatchFromDyn
<*mut U
> for *mut T {}
42 impl<T
: ?Sized
+ Unsize
<U
>, U
: ?Sized
> DispatchFromDyn
<Box
<U
>> for Box
<T
> {}
47 impl<T
: ?Sized
> Receiver
for &T {}
48 impl<T
: ?Sized
> Receiver
for &mut T {}
49 impl<T
: ?Sized
> Receiver
for Box
<T
> {}
52 pub unsafe trait Copy {}
54 unsafe impl Copy
for bool {}
55 unsafe impl Copy
for u8 {}
56 unsafe impl Copy
for u16 {}
57 unsafe impl Copy
for u32 {}
58 unsafe impl Copy
for u64 {}
59 unsafe impl Copy
for usize {}
60 unsafe impl Copy
for i8 {}
61 unsafe impl Copy
for i16 {}
62 unsafe impl Copy
for i32 {}
63 unsafe impl Copy
for isize {}
64 unsafe impl Copy
for f32 {}
65 unsafe impl Copy
for f64 {}
66 unsafe impl Copy
for char {}
67 unsafe impl<'a
, T
: ?Sized
> Copy
for &'a T {}
68 unsafe impl<T
: ?Sized
> Copy
for *const T {}
69 unsafe impl<T
: ?Sized
> Copy
for *mut T {}
72 pub unsafe trait Sync {}
74 unsafe impl Sync
for bool {}
75 unsafe impl Sync
for u8 {}
76 unsafe impl Sync
for u16 {}
77 unsafe impl Sync
for u32 {}
78 unsafe impl Sync
for u64 {}
79 unsafe impl Sync
for usize {}
80 unsafe impl Sync
for i8 {}
81 unsafe impl Sync
for i16 {}
82 unsafe impl Sync
for i32 {}
83 unsafe impl Sync
for isize {}
84 unsafe impl Sync
for char {}
85 unsafe impl<'a
, T
: ?Sized
> Sync
for &'a T {}
86 unsafe impl Sync
for [u8; 16] {}
89 unsafe auto trait Freeze {}
91 unsafe impl<T
: ?Sized
> Freeze
for PhantomData
<T
> {}
92 unsafe impl<T
: ?Sized
> Freeze
for *const T {}
93 unsafe impl<T
: ?Sized
> Freeze
for *mut T {}
94 unsafe impl<T
: ?Sized
> Freeze
for &T {}
95 unsafe impl<T
: ?Sized
> Freeze
for &mut T {}
97 #[lang = "structural_peq"]
98 pub trait StructuralPartialEq {}
100 #[lang = "structural_teq"]
101 pub trait StructuralEq {}
107 fn not(self) -> Self::Output
;
113 fn not(self) -> bool
{
119 pub trait Mul
<RHS
= Self> {
123 fn mul(self, rhs
: RHS
) -> Self::Output
;
129 fn mul(self, rhs
: Self) -> Self::Output
{
137 fn mul(self, rhs
: Self) -> Self::Output
{
143 pub trait Add
<RHS
= Self> {
146 fn add(self, rhs
: RHS
) -> Self::Output
;
152 fn add(self, rhs
: Self) -> Self {
160 fn add(self, rhs
: Self) -> Self {
168 fn add(self, rhs
: Self) -> Self {
174 pub trait Sub
<RHS
= Self> {
177 fn sub(self, rhs
: RHS
) -> Self::Output
;
183 fn sub(self, rhs
: Self) -> Self {
191 fn sub(self, rhs
: Self) -> Self {
199 fn sub(self, rhs
: Self) -> Self {
207 fn sub(self, rhs
: Self) -> Self {
213 pub trait Rem
<RHS
= Self> {
216 fn rem(self, rhs
: RHS
) -> Self::Output
;
222 fn rem(self, rhs
: Self) -> Self {
228 pub trait BitOr
<RHS
= Self> {
232 fn bitor(self, rhs
: RHS
) -> Self::Output
;
235 impl BitOr
for bool
{
238 fn bitor(self, rhs
: bool
) -> bool
{
243 impl<'a
> BitOr
<bool
> for &'a bool
{
246 fn bitor(self, rhs
: bool
) -> bool
{
252 pub trait PartialEq
<Rhs
: ?Sized
= Self> {
253 fn eq(&self, other
: &Rhs
) -> bool
;
254 fn ne(&self, other
: &Rhs
) -> bool
;
257 impl PartialEq
for u8 {
258 fn eq(&self, other
: &u8) -> bool
{
261 fn ne(&self, other
: &u8) -> bool
{
266 impl PartialEq
for u16 {
267 fn eq(&self, other
: &u16) -> bool
{
270 fn ne(&self, other
: &u16) -> bool
{
275 impl PartialEq
for u32 {
276 fn eq(&self, other
: &u32) -> bool
{
279 fn ne(&self, other
: &u32) -> bool
{
285 impl PartialEq
for u64 {
286 fn eq(&self, other
: &u64) -> bool
{
289 fn ne(&self, other
: &u64) -> bool
{
294 impl PartialEq
for usize {
295 fn eq(&self, other
: &usize) -> bool
{
298 fn ne(&self, other
: &usize) -> bool
{
303 impl PartialEq
for i8 {
304 fn eq(&self, other
: &i8) -> bool
{
307 fn ne(&self, other
: &i8) -> bool
{
312 impl PartialEq
for i32 {
313 fn eq(&self, other
: &i32) -> bool
{
316 fn ne(&self, other
: &i32) -> bool
{
321 impl PartialEq
for isize {
322 fn eq(&self, other
: &isize) -> bool
{
325 fn ne(&self, other
: &isize) -> bool
{
330 impl PartialEq
for char {
331 fn eq(&self, other
: &char) -> bool
{
334 fn ne(&self, other
: &char) -> bool
{
339 impl<T
: ?Sized
> PartialEq
for *const T
{
340 fn eq(&self, other
: &*const T
) -> bool
{
343 fn ne(&self, other
: &*const T
) -> bool
{
352 fn neg(self) -> Self::Output
;
366 fn neg(self) -> i16 {
374 fn neg(self) -> isize {
382 fn neg(self) -> f32 {
394 #[lang = "phantom_data"]
395 pub struct PhantomData
<T
: ?Sized
>;
399 pub trait FnOnce
<Args
> {
400 #[lang = "fn_once_output"]
403 extern "rust-call" fn call_once(self, args
: Args
) -> Self::Output
;
408 pub trait FnMut
<Args
>: FnOnce
<Args
> {
409 extern "rust-call" fn call_mut(&mut self, args
: Args
) -> Self::Output
;
414 pub fn panic(_msg
: &str) -> ! {
416 libc
::puts("Panicking\n\0" as *const str as *const u8);
421 #[lang = "panic_bounds_check"]
423 fn panic_bounds_check(index
: usize, len
: usize) -> ! {
425 libc
::printf("index out of bounds: the len is %d but the index is %d\n\0" as *const str as *const i8, len
, index
);
430 #[lang = "eh_personality"]
431 fn eh_personality() -> ! {
435 #[lang = "drop_in_place"]
436 #[allow(unconditional_recursion)]
437 pub unsafe fn drop_in_place
<T
: ?Sized
>(to_drop
: *mut T
) {
438 // Code here does not matter - this is replaced by the
439 // real drop glue by the compiler.
440 drop_in_place(to_drop
);
447 fn deref(&self) -> &Self::Target
;
450 pub trait Allocator
{
455 impl Allocator
for Global {}
457 #[lang = "owned_box"]
460 A
: Allocator
= Global
,
463 impl<T
: ?Sized
+ Unsize
<U
>, U
: ?Sized
> CoerceUnsized
<Box
<U
>> for Box
<T
> {}
465 impl<T
: ?Sized
, A
: Allocator
> Drop
for Box
<T
, A
> {
467 // drop is currently performed by compiler.
471 impl<T
> Deref
for Box
<T
> {
474 fn deref(&self) -> &Self::Target
{
479 #[lang = "exchange_malloc"]
480 unsafe fn allocate(size
: usize, _align
: usize) -> *mut u8 {
485 unsafe fn box_free
<T
: ?Sized
, A
: Allocator
>(ptr
: *mut T
, alloc
: A
) {
486 libc
::free(ptr
as *mut u8);
494 #[lang = "manually_drop"]
496 pub struct ManuallyDrop
<T
: ?Sized
> {
500 #[lang = "maybe_uninit"]
502 pub union MaybeUninit
<T
> {
504 pub value
: ManuallyDrop
<T
>,
508 extern "rust-intrinsic" {
510 pub fn size_of
<T
>() -> usize;
511 pub fn size_of_val
<T
: ?
::Sized
>(val
: *const T
) -> usize;
512 pub fn min_align_of
<T
>() -> usize;
513 pub fn min_align_of_val
<T
: ?
::Sized
>(val
: *const T
) -> usize;
514 pub fn copy
<T
>(src
: *const T
, dst
: *mut T
, count
: usize);
515 pub fn transmute
<T
, U
>(e
: T
) -> U
;
516 pub fn ctlz_nonzero
<T
>(x
: T
) -> T
;
517 pub fn needs_drop
<T
>() -> bool
;
518 pub fn bitreverse
<T
>(x
: T
) -> T
;
519 pub fn bswap
<T
>(x
: T
) -> T
;
520 pub fn write_bytes
<T
>(dst
: *mut T
, val
: u8, count
: usize);
521 pub fn unreachable() -> !;
528 pub fn puts(s
: *const u8) -> i32;
529 pub fn printf(format
: *const i8, ...) -> i32;
530 pub fn malloc(size
: usize) -> *mut u8;
531 pub fn free(ptr
: *mut u8);
532 pub fn memcpy(dst
: *mut u8, src
: *const u8, size
: usize);
533 pub fn memmove(dst
: *mut u8, src
: *const u8, size
: usize);
534 pub fn strncpy(dst
: *mut u8, src
: *const u8, size
: usize);
539 pub trait Index
<Idx
: ?Sized
> {
541 fn index(&self, index
: Idx
) -> &Self::Output
;
544 impl<T
> Index
<usize> for [T
; 3] {
547 fn index(&self, index
: usize) -> &Self::Output
{
552 impl<T
> Index
<usize> for [T
] {
555 fn index(&self, index
: usize) -> &Self::Output
{
566 pub struct VaList
<'a
>(&'a
mut VaListImpl
);
568 #[rustc_builtin_macro]
569 #[rustc_macro_transparency = "semitransparent"]
570 pub macro stringify($
($t
:tt
)*) { /* compiler built-in */ }
572 #[rustc_builtin_macro]
573 #[rustc_macro_transparency = "semitransparent"]
574 pub macro file() { /* compiler built-in */ }
576 #[rustc_builtin_macro]
577 #[rustc_macro_transparency = "semitransparent"]
578 pub macro line() { /* compiler built-in */ }
580 #[rustc_builtin_macro]
581 #[rustc_macro_transparency = "semitransparent"]
582 pub macro cfg() { /* compiler built-in */ }
584 pub static A_STATIC
: u8 = 42;
586 #[lang = "panic_location"]
587 struct PanicLocation
{
594 pub fn get_tls() -> u8 {