Skip to content

Commit f7f135d

Browse files
committed
Fix for newer nightly
1 parent 482fda3 commit f7f135d

File tree

3 files changed

+139
-52
lines changed

3 files changed

+139
-52
lines changed

src/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl Dir {
114114
pub fn find(path: &str) -> Result<(usize, File)> {
115115
let wpath = wstr(path);
116116

117-
for (i, mut fs) in FileSystem::all().iter_mut().enumerate() {
117+
for (i, fs) in FileSystem::all().iter_mut().enumerate() {
118118
let mut root = fs.root()?;
119119
match root.open(&wpath) {
120120
Ok(file) => {

src/lib.rs

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#![no_std]
2-
#![feature(alloc)]
2+
#![feature(asm)]
3+
#![feature(concat_idents)]
34
#![feature(core_intrinsics)]
5+
#![feature(custom_test_frameworks)]
6+
#![feature(format_args_nl)]
7+
#![feature(global_asm)]
48
#![feature(lang_items)]
9+
#![feature(log_syntax)]
510
#![feature(prelude_import)]
611
#![feature(raw)]
712
#![feature(slice_concat_ext)]
13+
#![feature(test)]
14+
#![feature(trace_macros)]
815

916
/* This section was addapted from the Rust Standard Library, and is licensed accordingly
1017
* https://github.com/rust-lang/rust/blob/master/src/libstd/lib.rs
@@ -17,10 +24,6 @@
1724
#[allow(unused)]
1825
use prelude::*;
1926

20-
// Re-export a few macros from core
21-
pub use core::{assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne};
22-
pub use core::{unreachable, unimplemented, write, writeln, r#try};
23-
2427
#[allow(unused_imports)]
2528
#[macro_use]
2629
extern crate alloc as alloc_crate;
@@ -67,14 +70,59 @@ pub use alloc_crate::borrow;
6770
pub use alloc_crate::fmt;
6871
pub use alloc_crate::format;
6972
pub use core::pin;
70-
pub use alloc_crate::collections;
7173
pub use alloc_crate::slice;
7274
pub use alloc_crate::str;
7375
pub use alloc_crate::string;
7476
pub use alloc_crate::vec;
7577
pub use core::char;
7678
pub use core::u128;
7779
pub use core::hint;
80+
pub use core::array;
81+
82+
// Re-export macros defined in libcore.
83+
#[allow(deprecated, deprecated_in_future)]
84+
pub use core::{
85+
// Stable
86+
assert_eq,
87+
assert_ne,
88+
debug_assert_eq,
89+
debug_assert_ne,
90+
debug_assert,
91+
r#try,
92+
unimplemented,
93+
unreachable,
94+
write,
95+
writeln,
96+
// Unstable
97+
todo,
98+
};
99+
100+
// Re-export built-in macros defined through libcore.
101+
pub use core::prelude::v1::{
102+
// Stable
103+
assert,
104+
cfg,
105+
column,
106+
compile_error,
107+
concat,
108+
env,
109+
file,
110+
format_args,
111+
include,
112+
include_bytes,
113+
include_str,
114+
line,
115+
module_path,
116+
option_env,
117+
stringify,
118+
// Unstable
119+
asm,
120+
concat_idents,
121+
format_args_nl,
122+
global_asm,
123+
log_syntax,
124+
trace_macros,
125+
};
78126

79127
/* } */
80128

src/prelude.rs

Lines changed: 84 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,89 @@
33
* {
44
*/
55

6-
// Re-exported core operators
7-
#[doc(no_inline)]
8-
pub use crate::marker::{Copy, Send, Sized, Sync, Unpin};
9-
#[doc(no_inline)]
10-
pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
11-
12-
// Re-exported functions
13-
#[doc(no_inline)]
14-
pub use crate::mem::drop;
15-
16-
// Re-exported types and traits
17-
#[doc(no_inline)]
18-
pub use crate::clone::Clone;
19-
#[doc(no_inline)]
20-
pub use crate::cmp::{PartialEq, PartialOrd, Eq, Ord};
21-
#[doc(no_inline)]
22-
pub use crate::convert::{AsRef, AsMut, Into, From};
23-
#[doc(no_inline)]
24-
pub use crate::default::Default;
25-
#[doc(no_inline)]
26-
pub use crate::iter::{Iterator, Extend, IntoIterator};
27-
#[doc(no_inline)]
28-
pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
29-
#[doc(no_inline)]
30-
pub use crate::option::Option::{self, Some, None};
31-
#[doc(no_inline)]
32-
pub use crate::result::Result::{self, Ok, Err};
33-
34-
35-
// The file so far is equivalent to src/libcore/prelude/v1.rs,
36-
// and below to src/liballoc/prelude.rs.
37-
// Those files are duplicated rather than using glob imports
38-
// because we want docs to show these re-exports as pointing to within `std`.
39-
40-
41-
#[doc(no_inline)]
42-
pub use crate::boxed::Box;
43-
#[doc(no_inline)]
44-
pub use crate::borrow::ToOwned;
45-
#[doc(no_inline)]
46-
pub use crate::slice::SliceConcatExt;
47-
#[doc(no_inline)]
48-
pub use crate::string::{String, ToString};
49-
#[doc(no_inline)]
50-
pub use crate::vec::Vec;
6+
// Re-exported core operators
7+
#[doc(no_inline)]
8+
pub use crate::marker::{Send, Sized, Sync, Unpin};
9+
#[doc(no_inline)]
10+
pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
11+
12+
// Re-exported functions
13+
#[doc(no_inline)]
14+
pub use crate::mem::drop;
15+
16+
// Re-exported types and traits
17+
#[doc(no_inline)]
18+
pub use crate::convert::{AsRef, AsMut, Into, From};
19+
#[doc(no_inline)]
20+
pub use crate::iter::{Iterator, Extend, IntoIterator};
21+
#[doc(no_inline)]
22+
pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
23+
#[doc(no_inline)]
24+
pub use crate::option::Option::{self, Some, None};
25+
#[doc(no_inline)]
26+
pub use crate::result::Result::{self, Ok, Err};
27+
28+
// Re-exported built-in macros
29+
#[doc(no_inline)]
30+
pub use core::prelude::v1::{
31+
asm,
32+
assert,
33+
cfg,
34+
column,
35+
compile_error,
36+
concat,
37+
concat_idents,
38+
env,
39+
file,
40+
format_args,
41+
format_args_nl,
42+
global_asm,
43+
include,
44+
include_bytes,
45+
include_str,
46+
line,
47+
log_syntax,
48+
module_path,
49+
option_env,
50+
stringify,
51+
trace_macros,
52+
};
53+
54+
// FIXME: Attribute and derive macros are not documented because for them rustdoc generates
55+
// dead links which fail link checker testing.
56+
#[allow(deprecated)]
57+
#[doc(hidden)]
58+
pub use core::prelude::v1::{
59+
Clone,
60+
Copy,
61+
Debug,
62+
Default,
63+
Eq,
64+
Hash,
65+
Ord,
66+
PartialEq,
67+
PartialOrd,
68+
RustcDecodable,
69+
RustcEncodable,
70+
bench,
71+
global_allocator,
72+
test,
73+
test_case,
74+
};
75+
76+
// The file so far is equivalent to src/libcore/prelude/v1.rs,
77+
// and below to src/liballoc/prelude.rs.
78+
// Those files are duplicated rather than using glob imports
79+
// because we want docs to show these re-exports as pointing to within `std`.
80+
81+
82+
#[doc(no_inline)]
83+
pub use crate::boxed::Box;
84+
#[doc(no_inline)]
85+
pub use crate::borrow::ToOwned;
86+
#[doc(no_inline)]
87+
pub use crate::string::{String, ToString};
88+
#[doc(no_inline)]
89+
pub use crate::vec::Vec;
5190

5291
/* } */

0 commit comments

Comments
 (0)