]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/issue-69368/c.rs
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / tests / run-make-fulldeps / issue-69368 / c.rs
1 #![crate_type = "bin"]
2 #![feature(start)]
3 #![no_std]
4
5 extern crate alloc;
6 extern crate a;
7 extern crate b;
8
9 use alloc::vec::Vec;
10 use core::alloc::*;
11
12 struct Allocator;
13
14 unsafe impl GlobalAlloc for Allocator {
15     unsafe fn alloc(&self, _: Layout) -> *mut u8 {
16         loop {}
17     }
18
19     unsafe fn dealloc(&self, _: *mut u8, _: Layout) {
20         loop {}
21     }
22 }
23
24 #[global_allocator]
25 static ALLOCATOR: Allocator = Allocator;
26
27 #[start]
28 fn main(argc: isize, _argv: *const *const u8) -> isize {
29     let mut v = Vec::new();
30     for i in 0..argc {
31         v.push(i);
32     }
33     v.iter().sum()
34 }