2 no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
3 untagged_unions, decl_macro, rustc_attrs
12 pub trait Unsize<T: ?Sized> {}
14 #[lang = "coerce_unsized"]
15 pub trait CoerceUnsized<T> {}
17 impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
18 impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a mut U> for &'a mut T {}
19 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
20 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
22 #[lang = "dispatch_from_dyn"]
23 pub trait DispatchFromDyn<T> {}
26 impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {}
28 impl<'a, T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<&'a mut U> for &'a mut T {}
29 // *const T -> *const U
30 impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
32 impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
33 impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}
38 impl<T: ?Sized> Receiver for &T {}
39 impl<T: ?Sized> Receiver for &mut T {}
40 impl<T: ?Sized> Receiver for Box<T> {}
43 pub unsafe trait Copy {}
45 unsafe impl Copy for bool {}
46 unsafe impl Copy for u8 {}
47 unsafe impl Copy for u16 {}
48 unsafe impl Copy for u32 {}
49 unsafe impl Copy for u64 {}
50 unsafe impl Copy for usize {}
51 unsafe impl Copy for i8 {}
52 unsafe impl Copy for i16 {}
53 unsafe impl Copy for i32 {}
54 unsafe impl Copy for isize {}
55 unsafe impl Copy for f32 {}
56 unsafe impl Copy for char {}
57 unsafe impl<'a, T: ?Sized> Copy for &'a T {}
58 unsafe impl<T: ?Sized> Copy for *const T {}
59 unsafe impl<T: ?Sized> Copy for *mut T {}
62 pub unsafe trait Sync {}
64 unsafe impl Sync for bool {}
65 unsafe impl Sync for u8 {}
66 unsafe impl Sync for u16 {}
67 unsafe impl Sync for u32 {}
68 unsafe impl Sync for u64 {}
69 unsafe impl Sync for usize {}
70 unsafe impl Sync for i8 {}
71 unsafe impl Sync for i16 {}
72 unsafe impl Sync for i32 {}
73 unsafe impl Sync for isize {}
74 unsafe impl Sync for char {}
75 unsafe impl<'a, T: ?Sized> Sync for &'a T {}
76 unsafe impl Sync for [u8; 16] {}
85 fn not(self) -> Self::Output;
91 fn not(self) -> bool {
97 pub trait Mul<RHS = Self> {
101 fn mul(self, rhs: RHS) -> Self::Output;
107 fn mul(self, rhs: Self) -> Self::Output {
115 fn mul(self, rhs: Self) -> Self::Output {
121 pub trait Add<RHS = Self> {
124 fn add(self, rhs: RHS) -> Self::Output;
130 fn add(self, rhs: Self) -> Self {
138 fn add(self, rhs: Self) -> Self {
146 fn add(self, rhs: Self) -> Self {
152 pub trait Sub<RHS = Self> {
155 fn sub(self, rhs: RHS) -> Self::Output;
161 fn sub(self, rhs: Self) -> Self {
169 fn sub(self, rhs: Self) -> Self {
177 fn sub(self, rhs: Self) -> Self {
185 fn sub(self, rhs: Self) -> Self {
191 pub trait Rem<RHS = Self> {
194 fn rem(self, rhs: RHS) -> Self::Output;
200 fn rem(self, rhs: Self) -> Self {
206 pub trait BitOr<RHS = Self> {
210 fn bitor(self, rhs: RHS) -> Self::Output;
213 impl BitOr for bool {
216 fn bitor(self, rhs: bool) -> bool {
221 impl<'a> BitOr<bool> for &'a bool {
224 fn bitor(self, rhs: bool) -> bool {
230 pub trait PartialEq<Rhs: ?Sized = Self> {
231 fn eq(&self, other: &Rhs) -> bool;
232 fn ne(&self, other: &Rhs) -> bool;
235 impl PartialEq for u8 {
236 fn eq(&self, other: &u8) -> bool {
239 fn ne(&self, other: &u8) -> bool {
244 impl PartialEq for u16 {
245 fn eq(&self, other: &u16) -> bool {
248 fn ne(&self, other: &u16) -> bool {
253 impl PartialEq for u32 {
254 fn eq(&self, other: &u32) -> bool {
257 fn ne(&self, other: &u32) -> bool {
263 impl PartialEq for u64 {
264 fn eq(&self, other: &u64) -> bool {
267 fn ne(&self, other: &u64) -> bool {
272 impl PartialEq for usize {
273 fn eq(&self, other: &usize) -> bool {
276 fn ne(&self, other: &usize) -> bool {
281 impl PartialEq for i8 {
282 fn eq(&self, other: &i8) -> bool {
285 fn ne(&self, other: &i8) -> bool {
290 impl PartialEq for i32 {
291 fn eq(&self, other: &i32) -> bool {
294 fn ne(&self, other: &i32) -> bool {
299 impl PartialEq for isize {
300 fn eq(&self, other: &isize) -> bool {
303 fn ne(&self, other: &isize) -> bool {
308 impl PartialEq for char {
309 fn eq(&self, other: &char) -> bool {
312 fn ne(&self, other: &char) -> bool {
317 impl<T: ?Sized> PartialEq for *const T {
318 fn eq(&self, other: &*const T) -> bool {
321 fn ne(&self, other: &*const T) -> bool {
330 fn neg(self) -> Self::Output;
344 fn neg(self) -> i16 {
352 fn neg(self) -> isize {
360 fn neg(self) -> f32 {
372 #[lang = "phantom_data"]
373 pub struct PhantomData<T: ?Sized>;
377 pub trait FnOnce<Args> {
380 extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
385 pub trait FnMut<Args>: FnOnce<Args> {
386 extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
390 pub fn panic(&(_msg, _file, _line, _col): &(&'static str, &'static str, u32, u32)) -> ! {
392 libc::puts("Panicking\0" as *const str as *const u8);
397 #[lang = "eh_personality"]
398 fn eh_personality() -> ! {
402 #[lang = "drop_in_place"]
403 #[allow(unconditional_recursion)]
404 pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
405 // Code here does not matter - this is replaced by the
406 // real drop glue by the compiler.
407 drop_in_place(to_drop);
414 fn deref(&self) -> &Self::Target;
417 #[lang = "owned_box"]
418 pub struct Box<T: ?Sized>(*mut T);
420 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
422 impl<T: ?Sized> Drop for Box<T> {
424 // drop is currently performed by compiler.
428 impl<T> Deref for Box<T> {
431 fn deref(&self) -> &Self::Target {
436 #[lang = "exchange_malloc"]
437 unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
442 unsafe fn box_free<T: ?Sized>(ptr: *mut T) {
443 libc::free(ptr as *mut u8);
451 #[allow(unions_with_drop_fields)]
452 pub union MaybeUninit<T> {
458 extern "rust-intrinsic" {
460 pub fn size_of<T>() -> usize;
461 pub fn size_of_val<T: ?::Sized>(val: &T) -> usize;
462 pub fn min_align_of<T>() -> usize;
463 pub fn min_align_of_val<T: ?::Sized>(val: &T) -> usize;
464 pub fn copy<T>(src: *const T, dst: *mut T, count: usize);
465 pub fn transmute<T, U>(e: T) -> U;
466 pub fn init<T>() -> T;
467 pub fn ctlz_nonzero<T>(x: T) -> T;
468 pub fn needs_drop<T>() -> bool;
469 pub fn bitreverse<T>(x: T) -> T;
470 pub fn bswap<T>(x: T) -> T;
477 pub fn puts(s: *const u8);
478 pub fn printf(format: *const i8, ...) -> i32;
479 pub fn malloc(size: usize) -> *mut u8;
480 pub fn free(ptr: *mut u8);
481 pub fn memcpy(dst: *mut u8, src: *const u8, size: usize);
482 pub fn memmove(dst: *mut u8, src: *const u8, size: usize);
483 pub fn strncpy(dst: *mut u8, src: *const u8, size: usize);
488 pub trait Index<Idx: ?Sized> {
490 fn index(&self, index: Idx) -> &Self::Output;
493 impl<T> Index<usize> for [T; 3] {
496 fn index(&self, index: usize) -> &Self::Output {
501 impl<T> Index<usize> for [T] {
504 fn index(&self, index: usize) -> &Self::Output {
515 pub struct VaList<'a>(&'a mut VaListImpl);
517 #[rustc_builtin_macro]
518 #[rustc_macro_transparency = "semitransparent"]
519 pub macro stringify($($t:tt)*) { /* compiler built-in */ }
521 #[rustc_builtin_macro]
522 #[rustc_macro_transparency = "semitransparent"]
523 pub macro file() { /* compiler built-in */ }
525 #[rustc_builtin_macro]
526 #[rustc_macro_transparency = "semitransparent"]
527 pub macro line() { /* compiler built-in */ }