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();
18 pub trait Unsize<T: ?Sized> {}
20 #[lang = "coerce_unsized"]
21 pub trait CoerceUnsized<T> {}
23 impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
24 impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a mut U> for &'a mut T {}
25 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
26 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
28 #[lang = "dispatch_from_dyn"]
29 pub trait DispatchFromDyn<T> {}
32 impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {}
34 impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<&'a mut U> for &'a mut T {}
35 // *const T -> *const U
36 impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
38 impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
39 impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}
44 impl<T: ?Sized> Receiver for &T {}
45 impl<T: ?Sized> Receiver for &mut T {}
46 impl<T: ?Sized> Receiver for Box<T> {}
49 pub unsafe trait Copy {}
51 unsafe impl Copy for bool {}
52 unsafe impl Copy for u8 {}
53 unsafe impl Copy for u16 {}
54 unsafe impl Copy for u32 {}
55 unsafe impl Copy for u64 {}
56 unsafe impl Copy for usize {}
57 unsafe impl Copy for i8 {}
58 unsafe impl Copy for i16 {}
59 unsafe impl Copy for i32 {}
60 unsafe impl Copy for isize {}
61 unsafe impl Copy for f32 {}
62 unsafe impl Copy for char {}
63 unsafe impl<'a, T: ?Sized> Copy for &'a T {}
64 unsafe impl<T: ?Sized> Copy for *const T {}
65 unsafe impl<T: ?Sized> Copy for *mut T {}
68 pub unsafe trait Sync {}
70 unsafe impl Sync for bool {}
71 unsafe impl Sync for u8 {}
72 unsafe impl Sync for u16 {}
73 unsafe impl Sync for u32 {}
74 unsafe impl Sync for u64 {}
75 unsafe impl Sync for usize {}
76 unsafe impl Sync for i8 {}
77 unsafe impl Sync for i16 {}
78 unsafe impl Sync for i32 {}
79 unsafe impl Sync for isize {}
80 unsafe impl Sync for char {}
81 unsafe impl<'a, T: ?Sized> Sync for &'a T {}
82 unsafe impl Sync for [u8; 16] {}
85 unsafe auto trait Freeze {}
87 unsafe impl<T: ?Sized> Freeze for PhantomData<T> {}
88 unsafe impl<T: ?Sized> Freeze for *const T {}
89 unsafe impl<T: ?Sized> Freeze for *mut T {}
90 unsafe impl<T: ?Sized> Freeze for &T {}
91 unsafe impl<T: ?Sized> Freeze for &mut T {}
93 #[lang = "structural_peq"]
94 pub trait StructuralPartialEq {}
96 #[lang = "structural_teq"]
97 pub trait StructuralEq {}
103 fn not(self) -> Self::Output;
109 fn not(self) -> bool {
115 pub trait Mul<RHS = Self> {
119 fn mul(self, rhs: RHS) -> Self::Output;
125 fn mul(self, rhs: Self) -> Self::Output {
133 fn mul(self, rhs: Self) -> Self::Output {
139 pub trait Add<RHS = Self> {
142 fn add(self, rhs: RHS) -> Self::Output;
148 fn add(self, rhs: Self) -> Self {
156 fn add(self, rhs: Self) -> Self {
164 fn add(self, rhs: Self) -> Self {
170 pub trait Sub<RHS = Self> {
173 fn sub(self, rhs: RHS) -> Self::Output;
179 fn sub(self, rhs: Self) -> Self {
187 fn sub(self, rhs: Self) -> Self {
195 fn sub(self, rhs: Self) -> Self {
203 fn sub(self, rhs: Self) -> Self {
209 pub trait Rem<RHS = Self> {
212 fn rem(self, rhs: RHS) -> Self::Output;
218 fn rem(self, rhs: Self) -> Self {
224 pub trait BitOr<RHS = Self> {
228 fn bitor(self, rhs: RHS) -> Self::Output;
231 impl BitOr for bool {
234 fn bitor(self, rhs: bool) -> bool {
239 impl<'a> BitOr<bool> for &'a bool {
242 fn bitor(self, rhs: bool) -> bool {
248 pub trait PartialEq<Rhs: ?Sized = Self> {
249 fn eq(&self, other: &Rhs) -> bool;
250 fn ne(&self, other: &Rhs) -> bool;
253 impl PartialEq for u8 {
254 fn eq(&self, other: &u8) -> bool {
257 fn ne(&self, other: &u8) -> bool {
262 impl PartialEq for u16 {
263 fn eq(&self, other: &u16) -> bool {
266 fn ne(&self, other: &u16) -> bool {
271 impl PartialEq for u32 {
272 fn eq(&self, other: &u32) -> bool {
275 fn ne(&self, other: &u32) -> bool {
281 impl PartialEq for u64 {
282 fn eq(&self, other: &u64) -> bool {
285 fn ne(&self, other: &u64) -> bool {
290 impl PartialEq for usize {
291 fn eq(&self, other: &usize) -> bool {
294 fn ne(&self, other: &usize) -> bool {
299 impl PartialEq for i8 {
300 fn eq(&self, other: &i8) -> bool {
303 fn ne(&self, other: &i8) -> bool {
308 impl PartialEq for i32 {
309 fn eq(&self, other: &i32) -> bool {
312 fn ne(&self, other: &i32) -> bool {
317 impl PartialEq for isize {
318 fn eq(&self, other: &isize) -> bool {
321 fn ne(&self, other: &isize) -> bool {
326 impl PartialEq for char {
327 fn eq(&self, other: &char) -> bool {
330 fn ne(&self, other: &char) -> bool {
335 impl<T: ?Sized> PartialEq for *const T {
336 fn eq(&self, other: &*const T) -> bool {
339 fn ne(&self, other: &*const T) -> bool {
348 fn neg(self) -> Self::Output;
362 fn neg(self) -> i16 {
370 fn neg(self) -> isize {
378 fn neg(self) -> f32 {
390 #[lang = "phantom_data"]
391 pub struct PhantomData<T: ?Sized>;
395 pub trait FnOnce<Args> {
396 #[lang = "fn_once_output"]
399 extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
404 pub trait FnMut<Args>: FnOnce<Args> {
405 extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
410 pub fn panic(_msg: &str) -> ! {
412 libc::puts("Panicking\n\0" as *const str as *const u8);
417 #[lang = "panic_bounds_check"]
419 fn panic_bounds_check(index: usize, len: usize) -> ! {
421 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);
426 #[lang = "eh_personality"]
427 fn eh_personality() -> ! {
431 #[lang = "drop_in_place"]
432 #[allow(unconditional_recursion)]
433 pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
434 // Code here does not matter - this is replaced by the
435 // real drop glue by the compiler.
436 drop_in_place(to_drop);
443 fn deref(&self) -> &Self::Target;
446 #[lang = "owned_box"]
447 pub struct Box<T: ?Sized>(*mut T);
449 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
451 impl<T: ?Sized> Drop for Box<T> {
453 // drop is currently performed by compiler.
457 impl<T> Deref for Box<T> {
460 fn deref(&self) -> &Self::Target {
465 #[lang = "exchange_malloc"]
466 unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
471 unsafe fn box_free<T: ?Sized>(ptr: *mut T) {
472 libc::free(ptr as *mut u8);
480 #[lang = "manually_drop"]
482 pub struct ManuallyDrop<T: ?Sized> {
486 #[lang = "maybe_uninit"]
488 pub union MaybeUninit<T> {
490 pub value: ManuallyDrop<T>,
494 extern "rust-intrinsic" {
496 pub fn size_of<T>() -> usize;
497 pub fn size_of_val<T: ?::Sized>(val: *const T) -> usize;
498 pub fn min_align_of<T>() -> usize;
499 pub fn min_align_of_val<T: ?::Sized>(val: *const T) -> usize;
500 pub fn copy<T>(src: *const T, dst: *mut T, count: usize);
501 pub fn transmute<T, U>(e: T) -> U;
502 pub fn ctlz_nonzero<T>(x: T) -> T;
503 pub fn needs_drop<T>() -> bool;
504 pub fn bitreverse<T>(x: T) -> T;
505 pub fn bswap<T>(x: T) -> T;
506 pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
507 pub fn unreachable() -> !;
514 pub fn puts(s: *const u8) -> i32;
515 pub fn printf(format: *const i8, ...) -> i32;
516 pub fn malloc(size: usize) -> *mut u8;
517 pub fn free(ptr: *mut u8);
518 pub fn memcpy(dst: *mut u8, src: *const u8, size: usize);
519 pub fn memmove(dst: *mut u8, src: *const u8, size: usize);
520 pub fn strncpy(dst: *mut u8, src: *const u8, size: usize);
525 pub trait Index<Idx: ?Sized> {
527 fn index(&self, index: Idx) -> &Self::Output;
530 impl<T> Index<usize> for [T; 3] {
533 fn index(&self, index: usize) -> &Self::Output {
538 impl<T> Index<usize> for [T] {
541 fn index(&self, index: usize) -> &Self::Output {
552 pub struct VaList<'a>(&'a mut VaListImpl);
554 #[rustc_builtin_macro]
555 #[rustc_macro_transparency = "semitransparent"]
556 pub macro stringify($($t:tt)*) { /* compiler built-in */ }
558 #[rustc_builtin_macro]
559 #[rustc_macro_transparency = "semitransparent"]
560 pub macro file() { /* compiler built-in */ }
562 #[rustc_builtin_macro]
563 #[rustc_macro_transparency = "semitransparent"]
564 pub macro line() { /* compiler built-in */ }
566 #[rustc_builtin_macro]
567 #[rustc_macro_transparency = "semitransparent"]
568 pub macro cfg() { /* compiler built-in */ }
570 pub static A_STATIC: u8 = 42;
572 #[lang = "panic_location"]
573 struct PanicLocation {
580 pub fn get_tls() -> u8 {