Commit 5b31bf57 authored by Jeremy Soller's avatar Jeremy Soller

Update to latest rust

parent 120b4733
......@@ -97,7 +97,7 @@ fn main() {
// Write header
f.write_all(b"
mod gen {
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
pub fn gen() -> BTreeMap<&'static [u8], (&'static [u8], bool)> {
let mut files: BTreeMap<&'static [u8], (&'static [u8], bool)> = BTreeMap::new();
").unwrap();
......
use alloc::arc::Arc;
use alloc::sync::Arc;
use alloc::boxed::Box;
use alloc::{Vec, VecDeque};
use alloc::vec::Vec;
use alloc::collections::VecDeque;
use core::cmp::Ordering;
use core::mem;
use spin::Mutex;
......
//! File structs
use alloc::arc::Arc;
use alloc::sync::Arc;
use event;
use spin::RwLock;
use scheme::{self, SchemeId};
......
use alloc::arc::Arc;
use alloc::sync::Arc;
use alloc::boxed::Box;
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
use core::alloc::{GlobalAlloc, Layout};
use core::mem;
use core::sync::atomic::Ordering;
......@@ -35,7 +35,7 @@ impl ContextList {
self.map.get(&super::CONTEXT_ID.load(Ordering::SeqCst))
}
pub fn iter(&self) -> ::alloc::btree_map::Iter<ContextId, Arc<RwLock<Context>>> {
pub fn iter(&self) -> ::alloc::collections::btree_map::Iter<ContextId, Arc<RwLock<Context>>> {
self.map.iter()
}
......
use alloc::arc::{Arc, Weak};
use alloc::VecDeque;
use alloc::sync::{Arc, Weak};
use alloc::collections::VecDeque;
use core::intrinsics;
use spin::Mutex;
......
use alloc::arc::Arc;
use alloc::sync::Arc;
use core::mem;
use context::{contexts, switch, Status, WaitpidKey};
......
use alloc::vec_deque::VecDeque;
use alloc::collections::VecDeque;
use spin::{Once, Mutex, MutexGuard};
use event;
......
//! ELF executables
use alloc::String;
use alloc::string::String;
use goblin::elf::section_header::SHT_SYMTAB;
......
use alloc::arc::Arc;
use alloc::BTreeMap;
use alloc::sync::Arc;
use alloc::collections::BTreeMap;
use core::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
......
......@@ -15,21 +15,15 @@
#![feature(alloc)]
#![feature(allocator_api)]
#![feature(asm)]
#![feature(collections)]
#![feature(concat_idents)]
#![feature(const_atomic_usize_new)]
#![feature(const_fn)]
#![feature(const_max_value)]
#![feature(const_size_of)]
#![feature(core_intrinsics)]
#![feature(integer_atomics)]
#![feature(lang_items)]
#![feature(naked_functions)]
#![feature(never_type)]
#![feature(panic_implementation)]
#![feature(ptr_internals)]
#![feature(thread_local)]
#![feature(unique)]
#![no_std]
pub extern crate x86;
......
//! Recycle allocator
//! Uses freed frames if possible, then uses inner allocator
use alloc::Vec;
use alloc::vec::Vec;
use paging::PhysicalAddress;
......
//! Intrinsics for panic handling
use core::alloc::Layout;
use core::panic::PanicInfo;
use interrupt;
......@@ -9,7 +10,7 @@ use interrupt;
pub extern "C" fn rust_eh_personality() {}
/// Required to handle panics
#[panic_implementation]
#[panic_handler]
#[no_mangle]
pub extern "C" fn rust_begin_unwind(info: &PanicInfo) -> ! {
println!("KERNEL PANIC: {}", info);
......@@ -24,7 +25,7 @@ pub extern "C" fn rust_begin_unwind(info: &PanicInfo) -> ! {
#[lang = "oom"]
#[no_mangle]
pub extern fn rust_oom() -> ! {
pub extern fn rust_oom(_layout: Layout) -> ! {
panic!("kernel memory allocation failed");
}
......
use alloc::arc::Arc;
use alloc::sync::Arc;
use core::{mem, slice};
use event::{EventQueue, EventQueueId, next_queue_id, queues, queues_mut};
......
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
use core::{cmp, str};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::RwLock;
......@@ -10,7 +10,7 @@ use syscall::scheme::Scheme;
#[cfg(test)]
mod gen {
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
pub fn gen() -> BTreeMap<&'static [u8], (&'static [u8], bool)> { BTreeMap::new() }
}
......
/// Disk scheme replacement when making live disk
use alloc::arc::Arc;
use alloc::BTreeMap;
use alloc::sync::Arc;
use alloc::collections::BTreeMap;
use core::{cmp, slice};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::RwLock;
......
use alloc::{BTreeMap, Vec};
use alloc::collections::BTreeMap;
use alloc::vec::Vec;
use core::sync::atomic::{AtomicUsize, Ordering};
use memory::{free_frames, used_frames};
use spin::Mutex;
......
......@@ -6,9 +6,9 @@
//! The kernel validates paths and file descriptors before they are passed to schemes,
//! also stripping the scheme identifier of paths if necessary.
use alloc::arc::Arc;
use alloc::sync::Arc;
use alloc::boxed::Box;
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
use core::sync::atomic::AtomicUsize;
use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
......@@ -74,7 +74,7 @@ pub const ATOMIC_SCHEMEID_INIT: AtomicSchemeId = AtomicSchemeId::default();
int_like!(FileHandle, AtomicFileHandle, usize, AtomicUsize);
pub struct SchemeIter<'a> {
inner: Option<::alloc::btree_map::Iter<'a, Box<[u8]>, SchemeId>>
inner: Option<::alloc::collections::btree_map::Iter<'a, Box<[u8]>, SchemeId>>
}
impl<'a> Iterator for SchemeIter<'a> {
......@@ -171,7 +171,7 @@ impl SchemeList {
Ok(to)
}
pub fn iter(&self) -> ::alloc::btree_map::Iter<SchemeId, Arc<Box<Scheme + Send + Sync>>> {
pub fn iter(&self) -> ::alloc::collections::btree_map::Iter<SchemeId, Arc<Box<Scheme + Send + Sync>>> {
self.map.iter()
}
......
use alloc::arc::{Arc, Weak};
use alloc::{BTreeMap, VecDeque};
use alloc::sync::{Arc, Weak};
use alloc::collections::{BTreeMap, VecDeque};
use core::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use spin::{Mutex, Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
......
use alloc::arc::Arc;
use alloc::sync::Arc;
use alloc::boxed::Box;
use alloc::{BTreeMap, Vec};
use alloc::collections::BTreeMap;
use alloc::vec::Vec;
use core::str;
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::{Mutex, RwLock};
......
use alloc::{String, Vec};
use alloc::string::String;
use alloc::vec::Vec;
use core::str;
use context;
......
use alloc::Vec;
use alloc::vec::Vec;
use device::cpu::cpu_info;
use syscall::error::{Error, EIO, Result};
......
use alloc::Vec;
use alloc::vec::Vec;
use context;
use syscall::error::{Error, ESRCH, Result};
......
use alloc::{String, Vec};
use alloc::string::String;
use alloc::vec::Vec;
use core::fmt::Write;
use core::str;
......
use alloc::boxed::Box;
use alloc::{BTreeMap, Vec};
use alloc::collections::BTreeMap;
use alloc::vec::Vec;
use core::{cmp, str};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::RwLock;
......
use alloc::Vec;
use alloc::vec::Vec;
use context;
use scheme;
......
use alloc::Vec;
use alloc::vec::Vec;
use context;
use scheme;
......
use alloc::{String, Vec};
use alloc::string::String;
use alloc::vec::Vec;
use core::fmt::Write;
use core::str;
......
use alloc::Vec;
use alloc::vec::Vec;
use syscall::error::Result;
pub fn resource() -> Result<Vec<u8>> {
......
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
use core::{mem, slice, str};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::RwLock;
......
use alloc::arc::{Arc, Weak};
use alloc::sync::{Arc, Weak};
use alloc::boxed::Box;
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
use core::sync::atomic::{AtomicU64, Ordering};
use core::{mem, slice, usize};
use spin::{Mutex, RwLock};
......
use alloc::arc::Arc;
use alloc::Vec;
use alloc::sync::Arc;
use alloc::vec::Vec;
use spin::{Mutex, RwLock};
use context::{self, Context};
......
use alloc::BTreeMap;
use alloc::collections::BTreeMap;
use core::mem;
use spin::Mutex;
......
use alloc::vec_deque::VecDeque;
use alloc::collections::VecDeque;
use spin::Mutex;
use sync::WaitCondition;
......
use core::mem;
use core::ops::Range;
use alloc::{String, Vec};
use alloc::string::String;
use alloc::vec::Vec;
use super::data::{Stat, TimeSpec};
use super::flag::*;
......
//! Filesystem syscalls
use core::sync::atomic::Ordering;
use alloc::arc::Arc;
use alloc::sync::Arc;
use spin::RwLock;
use context;
......
......@@ -2,8 +2,8 @@
//! Futex or Fast Userspace Mutex is "a method for waiting until a certain condition becomes true."
//!
//! For more information about futexes, please read [this](https://eli.thegreenplace.net/2018/basics-of-futexes/) blog post, and the [futex(2)](http://man7.org/linux/man-pages/man2/futex.2.html) man page
use alloc::arc::Arc;
use alloc::VecDeque;
use alloc::sync::Arc;
use alloc::collections::VecDeque;
use core::intrinsics;
use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
......
use alloc::Vec;
use alloc::vec::Vec;
use context;
use scheme::{self, SchemeNamespace};
......
use alloc::arc::Arc;
use alloc::sync::Arc;
use alloc::boxed::Box;
use alloc::vec::Vec;
use core::alloc::{GlobalAlloc, Layout};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment