Skip to content

Commit cd6300e

Browse files
committed
libstd: turn time::Tm and time::Timespec into structs
This avoids rust-lang#4044 by not using the enum wrapper, and turning Tm_ directly into a struct. Along the way it modernizes the codebase to eliminate no-implicit-copies warnings.
1 parent a18f0d4 commit cd6300e

File tree

3 files changed

+177
-195
lines changed

3 files changed

+177
-195
lines changed

Diff for: src/librustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ fn trans_fn(ccx: @crate_ctxt,
16431643
impl_id: Option<ast::def_id>) {
16441644
let do_time = ccx.sess.trans_stats();
16451645
let start = if do_time { time::get_time() }
1646-
else { {sec: 0i64, nsec: 0i32} };
1646+
else { time::Timespec::new(0, 0) };
16471647
debug!("trans_fn(ty_self=%?)", ty_self);
16481648
let _icx = ccx.insn_ctxt("trans_fn");
16491649
ccx.stats.n_fns += 1;

Diff for: src/libstd/std.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// A curious inner-module that's not exported that contains the binding
2+
// 'std' so that macro-expanded references to std::serialization and such
3+
// can be resolved within libcore.
4+
#[doc(hidden)] // FIXME #3538
5+
mod std {
6+
pub use serialization;
7+
}

0 commit comments

Comments
 (0)