Skip to content

Commit 5de57e2

Browse files
committed
Merge branch 'incoming' into reg-snap
2 parents 476aae1 + 1125831 commit 5de57e2

File tree

106 files changed

+1552
-900
lines changed

Some content is hidden

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

106 files changed

+1552
-900
lines changed

src/cargo/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import rustc::metadata::filesearch::{get_cargo_root, get_cargo_root_nearest,
88
import syntax::diagnostic;
99

1010
import result::{ok, err};
11-
import io::writer_util;
11+
import io::WriterUtil;
1212
import std::{map, json, tempfile, term, sort, getopts};
1313
import map::hashmap;
1414
import to_str::to_str;

src/compiletest/procsrv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import run::spawn_process;
2-
import io::writer_util;
2+
import io::WriterUtil;
33
import libc::{c_int, pid_t};
44

55
import pipes::chan;
@@ -45,8 +45,8 @@ fn run(lib_path: ~str,
4545
let pipe_out = os::pipe();
4646
let pipe_err = os::pipe();
4747
let pid = spawn_process(prog, args,
48-
some(env + target_env(lib_path, prog)),
49-
none, pipe_in.in, pipe_out.out, pipe_err.out);
48+
&some(env + target_env(lib_path, prog)),
49+
&none, pipe_in.in, pipe_out.out, pipe_err.out);
5050

5151
os::close(pipe_in.in);
5252
os::close(pipe_out.out);

src/compiletest/runtest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import io::writer_util;
1+
import io::WriterUtil;
22

33
import common::mode_run_pass;
44
import common::mode_run_fail;
@@ -339,7 +339,7 @@ fn compose_and_run_compiler(
339339
config.compile_lib_path, input)
340340
}
341341

342-
fn ensure_dir(path: path) {
342+
fn ensure_dir(path: Path) {
343343
if os::path_is_dir(path) { return; }
344344
if !os::make_dir(path, 0x1c0i32) {
345345
fail fmt!{"can't make dir %s", path};
@@ -455,7 +455,7 @@ fn dump_output_file(config: config, testfile: ~str,
455455
out: ~str, extension: ~str) {
456456
let outfile = make_out_name(config, testfile, extension);
457457
let writer = result::get(
458-
io::file_writer(outfile, ~[io::create, io::truncate]));
458+
io::file_writer(outfile, ~[io::Create, io::Truncate]));
459459
writer.write_str(out);
460460
}
461461

src/etc/combine-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def scrub(b):
5454
d.write("use std;\n")
5555
d.write("use run_pass_stage2;\n")
5656
d.write("import run_pass_stage2::*;\n")
57-
d.write("import io::writer_util;\n");
57+
d.write("import io::WriterUtil;\n");
5858
d.write("fn main() {\n");
5959
d.write(" let out = io::stdout();\n");
6060
i = 0

src/etc/emacs/README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ rust-mode: A major emacs mode for editing Rust source code
44
`rust-mode` makes editing [Rust](http://rust-lang.org) code with emacs
55
enjoyable.
66

7-
To install, check out this repository and add this to your .emacs
7+
8+
### Manual Installation
9+
10+
To install manually, check out this repository and add this to your .emacs
811
file:
912

1013
(add-to-list 'load-path "/path/to/rust-mode/")
@@ -25,3 +28,60 @@ it, and pressing `C-j`:
2528

2629
Rust mode will automatically be associated with .rs and .rc files. To
2730
enable it explicitly, do `M-x rust-mode`.
31+
32+
### package.el installation via Marmalade
33+
34+
It can be more convenient to use Emacs's package manager to handle
35+
installation for you if you use many elisp libraries. If you have
36+
package.el but haven't added Marmalade, the community package source,
37+
yet, add this to ~/.emacs.d/init.el:
38+
39+
```lisp
40+
(require 'package)
41+
(add-to-list 'package-archives
42+
'("marmalade" . "http://marmalade-repo.org/packages/"))
43+
(package-initialize)
44+
```
45+
46+
Then do this to load the package listing:
47+
48+
* <kbd>M-x eval-buffer</kbd>
49+
* <kbd>M-x package-refresh-contents</kbd>
50+
51+
If you use a version of Emacs prior to 24 that doesn't include
52+
package.el, you can get it from http://bit.ly/pkg-el23.
53+
54+
If you have an older ELPA package.el installed from tromey.com, you
55+
should upgrade in order to support installation from multiple sources.
56+
The ELPA archive is deprecated and no longer accepting new packages,
57+
so the version there (1.7.1) is very outdated.
58+
59+
From there you can install rust-mode or any other modes by choosing
60+
them from a list:
61+
62+
* <kbd>M-x package-list-packages</kbd>
63+
64+
Now, to install packages, move your cursor to them and press i. This
65+
will mark the packages for installation. When you're done with
66+
marking, press x, and ELPA will install the packages for you (under
67+
~/.emacs.d/elpa/).
68+
69+
* or using <kbd>M-x package-install rust-mode
70+
71+
#### Important
72+
73+
In order to have cm-mode properly initialized after compilation prior
74+
to rust-mode.el compilation you will need to add these `advices` to
75+
your init file or if you are a melpa user install the `melpa` package.
76+
77+
```lisp
78+
(defadvice package-download-tar
79+
(after package-download-tar-initialize activate compile)
80+
"initialize the package after compilation"
81+
(package-initialize))
82+
83+
(defadvice package-download-single
84+
(after package-download-single-initialize activate compile)
85+
"initialize the package after compilation"
86+
(package-initialize))
87+
```

src/etc/emacs/cm-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
;;; cm-mode.el --- Wrapper for CodeMirror-style Emacs modes
22

33
;; Version: 0.1.0
4+
;; Author: Mozilla
45
;; Url: https://github.com/mozilla/rust
5-
66
;; Highlighting is done by running a stateful parser (with first-class
77
;; state object) over the buffer, line by line, using the output to
88
;; add 'face properties, and storing the parser state at the end of

src/etc/emacs/rust-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
;;; rust-mode.el --- A major emacs mode for editing Rust source code
22

33
;; Version: 0.1.0
4+
;; Author: Mozilla
45
;; Package-Requires: ((cm-mode "0.1.0"))
56
;; Url: https://github.com/mozilla/rust
67

src/fuzzer/fuzzer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import io::writer_util;
1+
import io::WriterUtil;
22

33
import syntax::{ast, ast_util, fold, visit, codemap};
44
import syntax::parse;
@@ -10,7 +10,7 @@ type context = { mode: test_mode }; // + rng
1010

1111
fn write_file(filename: ~str, content: ~str) {
1212
result::get(
13-
io::file_writer(filename, ~[io::create, io::truncate]))
13+
io::file_writer(filename, ~[io::Create, io::Truncate]))
1414
.write_str(content);
1515
}
1616

@@ -216,9 +216,9 @@ fn under(n: uint, it: fn(uint)) {
216216
while i < n { it(i); i += 1u; }
217217
}
218218

219-
fn devnull() -> io::writer { io::mem_buffer_writer(io::mem_buffer()) }
219+
fn devnull() -> io::Writer { io::mem_buffer_writer(io::mem_buffer()) }
220220

221-
fn as_str(f: fn@(io::writer)) -> ~str {
221+
fn as_str(f: fn@(io::Writer)) -> ~str {
222222
let buf = io::mem_buffer();
223223
f(io::mem_buffer_writer(buf));
224224
io::mem_buffer_str(buf)

src/libcore/comm.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// NB: transitionary, de-mode-ing.
2+
#[forbid(deprecated_mode)];
3+
#[forbid(deprecated_pattern)];
14
/*!
25
* Communication between tasks
36
*
@@ -162,7 +165,7 @@ fn chan<T: send>(p: port<T>) -> chan<T> {
162165
* Sends data over a channel. The sent data is moved into the channel,
163166
* whereupon the caller loses access to it.
164167
*/
165-
fn send<T: send>(ch: chan<T>, -data: T) {
168+
fn send<T: send>(ch: chan<T>, +data: T) {
166169
let chan_t(p) = ch;
167170
let data_ptr = ptr::addr_of(data) as *();
168171
let res = rustrt::rust_port_id_send(p, data_ptr);

src/libcore/core.rc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export send_map;
5454
export hash;
5555
export cmp;
5656
export num;
57+
export path;
5758

5859
// NDM seems to be necessary for resolve to work
5960
export option_iter;
@@ -214,11 +215,16 @@ mod pipes;
214215

215216
// Runtime and language-primitive support
216217

218+
#[warn(non_camel_case_types)]
217219
mod io;
218220
mod libc;
221+
#[warn(non_camel_case_types)]
219222
mod os;
223+
#[warn(non_camel_case_types)]
220224
mod path;
225+
#[warn(non_camel_case_types)]
221226
mod rand;
227+
#[warn(non_camel_case_types)]
222228
mod run;
223229
#[warn(non_camel_case_types)]
224230
mod sys;

src/libcore/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import option::{some, none};
66
import option = option::option;
7-
import path = path::path;
7+
import Path = path::Path;
88
import tuple::{TupleOps, ExtendedTupleOps};
99
import str::{str_slice, unique_str};
1010
import vec::{const_vector, copyable_vector, immutable_vector};
@@ -14,7 +14,7 @@ import num::Num;
1414
import ptr::ptr;
1515
import to_str::ToStr;
1616

17-
export path, option, some, none, unreachable;
17+
export Path, option, some, none, unreachable;
1818
export extensions;
1919
// The following exports are the extension impls for numeric types
2020
export Num, times, timesi;

src/libcore/hash.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// NB: transitionary, de-mode-ing.
2+
#[forbid(deprecated_mode)];
3+
#[forbid(deprecated_pattern)];
4+
15
/*!
26
* Implementation of SipHash 2-4
37
*
@@ -9,8 +13,8 @@
913
* CPRNG like rand::rng.
1014
*/
1115

12-
import io::writer;
13-
import io::writer_util;
16+
import io::Writer;
17+
import io::WriterUtil;
1418

1519
export Streaming, State;
1620
export default_state;
@@ -122,7 +126,7 @@ fn SipState(key0: u64, key1: u64) -> SipState {
122126
}
123127

124128

125-
impl &SipState : io::writer {
129+
impl &SipState : io::Writer {
126130

127131
// Methods for io::writer
128132
fn write(msg: &[const u8]) {
@@ -205,7 +209,7 @@ impl &SipState : io::writer {
205209
self.ntail = left;
206210
}
207211

208-
fn seek(_x: int, _s: io::seek_style) {
212+
fn seek(_x: int, _s: io::SeekStyle) {
209213
fail;
210214
}
211215
fn tell() -> uint {
@@ -214,8 +218,8 @@ impl &SipState : io::writer {
214218
fn flush() -> int {
215219
0
216220
}
217-
fn get_type() -> io::writer_type {
218-
io::file
221+
fn get_type() -> io::WriterType {
222+
io::File
219223
}
220224
}
221225

@@ -362,9 +366,9 @@ fn test_siphash() {
362366
let stream_inc = &State(k0,k1);
363367
let stream_full = &State(k0,k1);
364368

365-
fn to_hex_str(r:[u8]/8) -> ~str {
369+
fn to_hex_str(r: &[u8]/8) -> ~str {
366370
let mut s = ~"";
367-
for vec::each(r) |b| { s += uint::to_str(b as uint, 16u); }
371+
for vec::each(*r) |b| { s += uint::to_str(b as uint, 16u); }
368372
return s;
369373
}
370374

@@ -379,7 +383,7 @@ fn test_siphash() {
379383
stream_full.input(buf);
380384
let f = stream_full.result_str();
381385
let i = stream_inc.result_str();
382-
let v = to_hex_str(vecs[t]);
386+
let v = to_hex_str(&vecs[t]);
383387
debug!{"%d: (%s) => inc=%s full=%s", t, v, i, f};
384388

385389
assert f == i && f == v;

0 commit comments

Comments
 (0)