Skip to content

Commit b3b4936

Browse files
committed
---
yaml --- r: 73622 b: refs/heads/dist-snap c: c77d58f h: refs/heads/master v: v3
1 parent 1df02b8 commit b3b4936

File tree

108 files changed

+1930
-1047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1930
-1047
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: e694e5fc592491097470e996fb41bd25104252fc
10+
refs/heads/dist-snap: c77d58fad8b484abdc0140d5adb27c738d46f261
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/kate/rust.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<item> Copy </item>
5050
<item> Send </item>
5151
<item> Owned </item>
52+
<item> Sized </item>
5253
<item> Eq </item>
5354
<item> Ord </item>
5455
<item> Num </item>

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ syn keyword rustType size_t ptrdiff_t clock_t time_t
4444
syn keyword rustType c_longlong c_ulonglong intptr_t uintptr_t
4545
syn keyword rustType off_t dev_t ino_t pid_t mode_t ssize_t
4646

47-
syn keyword rustTrait Const Copy Send Owned " inherent traits
47+
syn keyword rustTrait Const Copy Send Owned Sized " inherent traits
4848
syn keyword rustTrait Eq Ord Num Ptr
4949
syn keyword rustTrait Drop Add Sub Mul Quot Rem Neg BitAnd BitOr
5050
syn keyword rustTrait BitXor Shl Shr Index

branches/dist-snap/src/etc/zsh/_rust

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#compdef rustc
2+
3+
local -a _rustc_opts_switches _rustc_opts_lint _rustc_opts_debug
4+
5+
typeset -A opt_args
6+
7+
_rustc_opts_switches=(
8+
--bin'[Compile an executable crate (default)]'
9+
-c'[Compile and assemble, but do not link]'
10+
--cfg'[Configure the compilation environment]'
11+
--emit-llvm'[Produce an LLVM bitcode file]'
12+
{-h,--help}'[Display this message]'
13+
-L'[Add a directory to the library search path]'
14+
--lib'[Compile a library crate]'
15+
--linker'[Program to use for linking instead of the default.]'
16+
--link-args'[FLAGS is a space-separated list of flags passed to the linker]'
17+
--ls'[List the symbols defined by a library crate]'
18+
--no-trans'[Run all passes except translation; no output]'
19+
-O'[Equivalent to --opt-level=2]'
20+
-o'[Write output to <filename>]'
21+
--opt-level'[Optimize with possible levels 0-3]'
22+
--out-dir'[Write output to compiler-chosen filename in <dir>]'
23+
--parse-only'[Parse only; do not compile, assemble, or link]'
24+
--pretty'[Pretty-print the input instead of compiling]'
25+
-S'[Compile only; do not assemble or link]'
26+
--save-temps'[Write intermediate files (.bc, .opt.bc, .o) in addition to normal output]'
27+
--sysroot'[Override the system root]'
28+
--test'[Build a test harness]'
29+
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
30+
--target-feature'[Target specific attributes (llc -mattr=help for detail)]'
31+
--android-cross-path'[The path to the Android NDK]'
32+
{-W,--warn}'[Set lint warnings]'
33+
{-A,--allow}'[Set lint allowed]'
34+
{-D,--deny}'[Set lint denied]'
35+
{-F,--forbid}'[Set lint forbidden]'
36+
-Z'[Set internal debugging options]'
37+
{-v,--version}'[Print version info and exit]'
38+
)
39+
40+
_rustc_opts_lint=(
41+
'path-statement:path statements with no effect'
42+
'deprecated-pattern:warn about deprecated uses of pattern bindings'
43+
'non-implicitly-copyable-typarams:passing non implicitly copyable types as copy type params'
44+
'missing-trait-doc:detects missing documentation for traits'
45+
'missing-struct-doc:detects missing documentation for structs'
46+
'ctypes:proper use of core::libc types in foreign modules'
47+
'implicit-copies:implicit copies of non implicitly copyable data'
48+
"unused-mut:detect mut variables which don't need to be mutable"
49+
'unused-imports:imports that are never used'
50+
'heap-memory:use of any (~ type or @ type) heap memory'
51+
'default-methods:allow default methods'
52+
'unused-variable:detect variables which are not used in any way'
53+
'dead-assignment:detect assignments that will never be read'
54+
'unrecognized-lint:unrecognized lint attribute'
55+
'type-limits:comparisons made useless by limits of the types involved'
56+
'unused-unsafe:unnecessary use of an `unsafe` block'
57+
'while-true:suggest using loop { } instead of while(true) { }'
58+
'non-camel-case-types:types, variants and traits should have camel case names'
59+
'managed-heap-memory:use of managed (@ type) heap memory'
60+
'unnecessary-allocation:detects unnecessary allocations that can be eliminated'
61+
'owned-heap-memory:use of owned (~ type) heap memory'
62+
)
63+
64+
_rustc_opts_debug=(
65+
'verbose:in general, enable more debug printouts'
66+
'time-passes:measure time of each rustc pass'
67+
'count-llvm-insns:count where LLVM instrs originate'
68+
'time-llvm-passes:measure time of each LLVM pass'
69+
'trans-stats:gather trans statistics'
70+
'asm-comments:generate comments into the assembly (may change behavior)'
71+
'no-verify:skip LLVM verification'
72+
'trace:emit trace logs'
73+
'coherence:perform coherence checking'
74+
'borrowck-stats:gather borrowck statistics'
75+
"borrowck-note-pure:note where purity is req'd"
76+
"borrowck-note-loan:note where loans are req'd"
77+
'no-landing-pads:omit landing pads for unwinding'
78+
'debug-llvm:enable debug output from LLVM'
79+
'count-type-sizes:count the sizes of aggregate types'
80+
'meta-stats:gather metadata statistics'
81+
'no-opt:do not optimize, even if -O is passed'
82+
'no-monomorphic-collapse:do not collapse template instantiations'
83+
'print-link-args:Print the arguments passed to the linker'
84+
'gc:Garbage collect shared data (experimental)'
85+
'jit:Execute using JIT (experimental)'
86+
'extra-debug-info:Extra debugging info (experimental)'
87+
'debug-info:Produce debug info (experimental)'
88+
'static:Use or produce static libraries or binaries (experimental)'
89+
'no-debug-borrows:do not show where borrow checks fail'
90+
'lint-llvm:Run the LLVM lint pass on the pre-optimization IR'
91+
)
92+
93+
_rustc() {
94+
case $words[2] in
95+
-[WADF]) _describe 'options' _rustc_opts_lint ;;
96+
-Z) _describe 'options' _rustc_opts_debug ;;
97+
-) _arguments -s -w : "$_rustc_opts_switches[@]" ;;
98+
*) _files -g "*.rs" ;;
99+
esac
100+
}
101+
102+
_rustc "$@"

branches/dist-snap/src/libextra/bitv.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -13,7 +13,6 @@ use core::prelude::*;
1313
use core::cmp;
1414
use core::ops;
1515
use core::uint;
16-
use core::vec::from_elem;
1716
use core::vec;
1817

1918
struct SmallBitv {

branches/dist-snap/src/libextra/ebml.rs

Lines changed: 79 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,34 @@ pub enum EbmlEncoderTag {
5151
EsI16, // 8
5252
EsI8, // 9
5353
EsBool, // 10
54-
EsStr, // 11
55-
EsF64, // 12
56-
EsF32, // 13
57-
EsFloat, // 14
58-
EsEnum, // 15
59-
EsEnumVid, // 16
60-
EsEnumBody, // 17
61-
EsVec, // 18
62-
EsVecLen, // 19
63-
EsVecElt, // 20
54+
EsChar, // 11
55+
EsStr, // 12
56+
EsF64, // 13
57+
EsF32, // 14
58+
EsFloat, // 15
59+
EsEnum, // 16
60+
EsEnumVid, // 17
61+
EsEnumBody, // 18
62+
EsVec, // 19
63+
EsVecLen, // 20
64+
EsVecElt, // 21
65+
EsMap, // 22
66+
EsMapLen, // 23
67+
EsMapKey, // 24
68+
EsMapVal, // 25
6469

6570
EsOpaque,
6671

67-
EsLabel // Used only when debugging
72+
EsLabel, // Used only when debugging
6873
}
6974
// --------------------------------------
7075

7176
pub mod reader {
72-
use core::prelude::*;
77+
use super::*;
7378

74-
use ebml::{Doc, EbmlEncoderTag, EsBool, EsEnum, EsEnumBody, EsEnumVid};
75-
use ebml::{EsI16, EsI32, EsI64, EsI8, EsInt};
76-
use ebml::{EsLabel, EsOpaque, EsStr, EsU16, EsU32, EsU64, EsU8, EsUint};
77-
use ebml::{EsVec, EsVecElt, EsVecLen, TaggedDoc};
7879
use serialize;
7980

81+
use core::prelude::*;
8082
use core::cast::transmute;
8183
use core::int;
8284
use core::io;
@@ -321,12 +323,14 @@ pub mod reader {
321323
r_doc
322324
}
323325

324-
fn push_doc<T>(&mut self, d: Doc, f: &fn() -> T) -> T {
326+
fn push_doc<T>(&mut self, exp_tag: EbmlEncoderTag,
327+
f: &fn(&mut Decoder) -> T) -> T {
328+
let d = self.next_doc(exp_tag);
325329
let old_parent = self.parent;
326330
let old_pos = self.pos;
327331
self.parent = d;
328332
self.pos = d.start;
329-
let r = f();
333+
let r = f(self);
330334
self.parent = old_parent;
331335
self.pos = old_pos;
332336
r
@@ -395,10 +399,21 @@ pub mod reader {
395399
doc_as_u8(self.next_doc(EsBool)) as bool
396400
}
397401

398-
fn read_f64(&mut self) -> f64 { fail!("read_f64()"); }
399-
fn read_f32(&mut self) -> f32 { fail!("read_f32()"); }
400-
fn read_float(&mut self) -> float { fail!("read_float()"); }
401-
fn read_char(&mut self) -> char { fail!("read_char()"); }
402+
fn read_f64(&mut self) -> f64 {
403+
let bits = doc_as_u64(self.next_doc(EsF64));
404+
unsafe { transmute(bits) }
405+
}
406+
fn read_f32(&mut self) -> f32 {
407+
let bits = doc_as_u32(self.next_doc(EsF32));
408+
unsafe { transmute(bits) }
409+
}
410+
fn read_float(&mut self) -> float {
411+
let bits = doc_as_u64(self.next_doc(EsFloat));
412+
(unsafe { transmute::<u64, f64>(bits) }) as float
413+
}
414+
fn read_char(&mut self) -> char {
415+
doc_as_u32(self.next_doc(EsChar)) as char
416+
}
402417
fn read_str(&mut self) -> ~str { doc_as_str(self.next_doc(EsStr)) }
403418

404419
// Compound types:
@@ -541,66 +556,50 @@ pub mod reader {
541556

542557
fn read_seq<T>(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T {
543558
debug!("read_seq()");
544-
let doc = self.next_doc(EsVec);
545-
546-
let (old_parent, old_pos) = (self.parent, self.pos);
547-
self.parent = doc;
548-
self.pos = self.parent.start;
549-
550-
let len = self._next_uint(EsVecLen);
551-
debug!(" len=%u", len);
552-
let result = f(self, len);
553-
554-
self.parent = old_parent;
555-
self.pos = old_pos;
556-
result
559+
do self.push_doc(EsVec) |d| {
560+
let len = d._next_uint(EsVecLen);
561+
debug!(" len=%u", len);
562+
f(d, len)
563+
}
557564
}
558565

559566
fn read_seq_elt<T>(&mut self, idx: uint, f: &fn(&mut Decoder) -> T)
560567
-> T {
561568
debug!("read_seq_elt(idx=%u)", idx);
562-
let doc = self.next_doc(EsVecElt);
563-
564-
let (old_parent, old_pos) = (self.parent, self.pos);
565-
self.parent = doc;
566-
self.pos = self.parent.start;
567-
568-
let result = f(self);
569-
570-
self.parent = old_parent;
571-
self.pos = old_pos;
572-
result
569+
self.push_doc(EsVecElt, f)
573570
}
574571

575-
fn read_map<T>(&mut self, _: &fn(&mut Decoder, uint) -> T) -> T {
572+
fn read_map<T>(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T {
576573
debug!("read_map()");
577-
fail!("read_map is unimplemented");
574+
do self.push_doc(EsMap) |d| {
575+
let len = d._next_uint(EsMapLen);
576+
debug!(" len=%u", len);
577+
f(d, len)
578+
}
578579
}
579580

580581
fn read_map_elt_key<T>(&mut self,
581582
idx: uint,
582-
_: &fn(&mut Decoder) -> T)
583+
f: &fn(&mut Decoder) -> T)
583584
-> T {
584585
debug!("read_map_elt_key(idx=%u)", idx);
585-
fail!("read_map_elt_val is unimplemented");
586+
self.push_doc(EsMapKey, f)
586587
}
587588

588589
fn read_map_elt_val<T>(&mut self,
589590
idx: uint,
590-
_: &fn(&mut Decoder) -> T)
591+
f: &fn(&mut Decoder) -> T)
591592
-> T {
592593
debug!("read_map_elt_val(idx=%u)", idx);
593-
fail!("read_map_elt_val is unimplemented");
594+
self.push_doc(EsMapVal, f)
594595
}
595596
}
596597
}
597598

598599
pub mod writer {
599-
use ebml::{EbmlEncoderTag, EsBool, EsEnum, EsEnumBody, EsEnumVid};
600-
use ebml::{EsI16, EsI32, EsI64, EsI8, EsInt};
601-
use ebml::{EsLabel, EsOpaque, EsStr, EsU16, EsU32, EsU64, EsU8, EsUint};
602-
use ebml::{EsVec, EsVecElt, EsVecLen};
600+
use super::*;
603601

602+
use core::cast;
604603
use core::io;
605604
use core::str;
606605

@@ -806,19 +805,21 @@ pub mod writer {
806805
self.wr_tagged_u8(EsBool as uint, v as u8)
807806
}
808807

809-
// FIXME (#2742): implement these
810-
fn emit_f64(&mut self, _v: f64) {
811-
fail!("Unimplemented: serializing an f64");
808+
fn emit_f64(&mut self, v: f64) {
809+
let bits = unsafe { cast::transmute(v) };
810+
self.wr_tagged_u64(EsF64 as uint, bits);
812811
}
813-
fn emit_f32(&mut self, _v: f32) {
814-
fail!("Unimplemented: serializing an f32");
812+
fn emit_f32(&mut self, v: f32) {
813+
let bits = unsafe { cast::transmute(v) };
814+
self.wr_tagged_u32(EsF32 as uint, bits);
815815
}
816-
fn emit_float(&mut self, _v: float) {
817-
fail!("Unimplemented: serializing a float");
816+
fn emit_float(&mut self, v: float) {
817+
let bits = unsafe { cast::transmute(v as f64) };
818+
self.wr_tagged_u64(EsFloat as uint, bits);
818819
}
819820

820-
fn emit_char(&mut self, _v: char) {
821-
fail!("Unimplemented: serializing a char");
821+
fn emit_char(&mut self, v: char) {
822+
self.wr_tagged_u32(EsChar as uint, v as u32);
822823
}
823824

824825
fn emit_str(&mut self, v: &str) {
@@ -914,16 +915,23 @@ pub mod writer {
914915
self.end_tag();
915916
}
916917

917-
fn emit_map(&mut self, _len: uint, _f: &fn(&mut Encoder)) {
918-
fail!("emit_map is unimplemented");
918+
fn emit_map(&mut self, len: uint, f: &fn(&mut Encoder)) {
919+
self.start_tag(EsMap as uint);
920+
self._emit_tagged_uint(EsMapLen, len);
921+
f(self);
922+
self.end_tag();
919923
}
920924

921-
fn emit_map_elt_key(&mut self, _idx: uint, _f: &fn(&mut Encoder)) {
922-
fail!("emit_map_elt_key is unimplemented");
925+
fn emit_map_elt_key(&mut self, _idx: uint, f: &fn(&mut Encoder)) {
926+
self.start_tag(EsMapKey as uint);
927+
f(self);
928+
self.end_tag();
923929
}
924930

925-
fn emit_map_elt_val(&mut self, _idx: uint, _f: &fn(&mut Encoder)) {
926-
fail!("emit_map_elt_val is unimplemented");
931+
fn emit_map_elt_val(&mut self, _idx: uint, f: &fn(&mut Encoder)) {
932+
self.start_tag(EsMapVal as uint);
933+
f(self);
934+
self.end_tag();
927935
}
928936
}
929937
}

0 commit comments

Comments
 (0)