Skip to content

Commit 15e9a7a

Browse files
committed
---
yaml --- r: 143891 b: refs/heads/try2 c: ecfc9a8 h: refs/heads/master i: 143889: 25a81be 143887: ed0bcf7 v: v3
1 parent f83cd4e commit 15e9a7a

File tree

111 files changed

+2753
-848
lines changed

Some content is hidden

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

111 files changed

+2753
-848
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0b35e3b5a3468d5a8b5b86f0f6b369b8f663ce17
8+
refs/heads/try2: ecfc9a82231eef47bf522e6d18138a0f3414d914
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ match crayons[0] {
13051305
A vector can be destructured using pattern matching:
13061306
13071307
~~~~
1308-
let numbers: [int, ..3] = [1, 2, 3];
1308+
let numbers: &[int] = &[1, 2, 3];
13091309
let score = match numbers {
13101310
[] => 0,
13111311
[a] => a * 10,
@@ -2195,7 +2195,7 @@ use std::float::consts::pi;
21952195
# impl Shape for CircleStruct { fn area(&self) -> float { pi * square(self.radius) } }
21962196
21972197
let concrete = @CircleStruct{center:Point{x:3f,y:4f},radius:5f};
2198-
let mycircle: Circle = concrete as @Circle;
2198+
let mycircle: @Circle = concrete as @Circle;
21992199
let nonsense = mycircle.radius() * mycircle.area();
22002200
~~~
22012201

branches/try2/src/etc/emacs/rust-mode.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929

3030
table))
3131

32+
(defcustom rust-indent-offset default-tab-width
33+
"*Indent Rust code by this number of spaces.
34+
35+
The initializer is `DEFAULT-TAB-WIDTH'.")
36+
3237
(defun rust-paren-level () (nth 0 (syntax-ppss)))
3338
(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))
3439
(defun rust-rewind-past-str-cmnt () (goto-char (nth 8 (syntax-ppss))))
@@ -49,10 +54,10 @@
4954
(let ((level (rust-paren-level)))
5055
(cond
5156
;; A function return type is 1 level indented
52-
((looking-at "->") (* default-tab-width (+ level 1)))
57+
((looking-at "->") (* rust-indent-offset (+ level 1)))
5358

5459
;; A closing brace is 1 level unindended
55-
((looking-at "}") (* default-tab-width (- level 1)))
60+
((looking-at "}") (* rust-indent-offset (- level 1)))
5661

5762
;; If we're in any other token-tree / sexp, then:
5863
;; - [ or ( means line up with the opening token
@@ -70,18 +75,18 @@
7075
(goto-char pt)
7176
(back-to-indentation)
7277
(if (looking-at "\\<else\\>")
73-
(* default-tab-width (+ 1 level))
78+
(* rust-indent-offset (+ 1 level))
7479
(progn
7580
(goto-char pt)
7681
(beginning-of-line)
7782
(rust-rewind-irrelevant)
7883
(end-of-line)
7984
(if (looking-back "[{};,]")
80-
(* default-tab-width level)
85+
(* rust-indent-offset level)
8186
(back-to-indentation)
8287
(if (looking-at "#")
83-
(* default-tab-width level)
84-
(* default-tab-width (+ 1 level))))))))))
88+
(* rust-indent-offset level)
89+
(* rust-indent-offset (+ 1 level))))))))))
8590

8691
;; Otherwise we're in a column-zero definition
8792
(t 0))))))

branches/try2/src/etc/zsh/_rust

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ _rustc_opts_switches=(
2727
--sysroot'[Override the system root]'
2828
--test'[Build a test harness]'
2929
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
30-
--target-feature'[Target specific attributes (llc -mattr=help for detail)]'
30+
--target-cpu'[Select target processor (llc -mcpu=help for details)]'
31+
--target-feature'[Target specific attributes (llc -mattr=help for details)]'
3132
--android-cross-path'[The path to the Android NDK]'
3233
{-v,--version}'[Print version info and exit]'
3334
)

branches/try2/src/librustc/back/abi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ pub static tydesc_field_take_glue: uint = 2u;
4646
pub static tydesc_field_drop_glue: uint = 3u;
4747
pub static tydesc_field_free_glue: uint = 4u;
4848
pub static tydesc_field_visit_glue: uint = 5u;
49-
pub static n_tydesc_fields: uint = 6u;
49+
pub static tydesc_field_borrow_offset: uint = 6u;
50+
pub static n_tydesc_fields: uint = 7u;
5051

5152
// The two halves of a closure: code and environment.
5253
pub static fn_field_code: uint = 0u;

branches/try2/src/librustc/back/link.rs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pub fn llvm_err(sess: Session, msg: ~str) -> ! {
6969
pub fn WriteOutputFile(sess: Session,
7070
PM: lib::llvm::PassManagerRef, M: ModuleRef,
7171
Triple: &str,
72+
Cpu: &str,
7273
Feature: &str,
7374
Output: &str,
7475
// FIXME: When #2334 is fixed, change
@@ -78,19 +79,22 @@ pub fn WriteOutputFile(sess: Session,
7879
EnableSegmentedStacks: bool) {
7980
unsafe {
8081
do Triple.to_c_str().with_ref |Triple| {
81-
do Feature.to_c_str().with_ref |Feature| {
82-
do Output.to_c_str().with_ref |Output| {
83-
let result = llvm::LLVMRustWriteOutputFile(
84-
PM,
85-
M,
86-
Triple,
87-
Feature,
88-
Output,
89-
FileType,
90-
OptLevel,
91-
EnableSegmentedStacks);
92-
if (!result) {
93-
llvm_err(sess, ~"Could not write output");
82+
do Cpu.to_c_str().with_ref |Cpu| {
83+
do Feature.to_c_str().with_ref |Feature| {
84+
do Output.to_c_str().with_ref |Output| {
85+
let result = llvm::LLVMRustWriteOutputFile(
86+
PM,
87+
M,
88+
Triple,
89+
Cpu,
90+
Feature,
91+
Output,
92+
FileType,
93+
OptLevel,
94+
EnableSegmentedStacks);
95+
if (!result) {
96+
llvm_err(sess, ~"Could not write output");
97+
}
9498
}
9599
}
96100
}
@@ -346,6 +350,7 @@ pub mod write {
346350
pm.llpm,
347351
llmod,
348352
sess.targ_cfg.target_strs.target_triple,
353+
opts.target_cpu,
349354
opts.target_feature,
350355
output.to_str(),
351356
lib::llvm::AssemblyFile as c_uint,
@@ -362,6 +367,7 @@ pub mod write {
362367
pm.llpm,
363368
llmod,
364369
sess.targ_cfg.target_strs.target_triple,
370+
opts.target_cpu,
365371
opts.target_feature,
366372
output.to_str(),
367373
lib::llvm::ObjectFile as c_uint,
@@ -376,6 +382,7 @@ pub mod write {
376382
pm.llpm,
377383
llmod,
378384
sess.targ_cfg.target_strs.target_triple,
385+
opts.target_cpu,
379386
opts.target_feature,
380387
output.to_str(),
381388
FileType as c_uint,

branches/try2/src/librustc/driver/driver.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,9 @@ pub fn build_session_options(binary: @str,
684684
link::output_type_bitcode
685685
} else { link::output_type_exe };
686686
let sysroot_opt = getopts::opt_maybe_str(matches, "sysroot").map_move(|m| @Path(m));
687-
let target_opt = getopts::opt_maybe_str(matches, "target");
688-
let target_feature_opt = getopts::opt_maybe_str(matches, "target-feature");
687+
let target = getopts::opt_maybe_str(matches, "target").unwrap_or_default(host_triple());
688+
let target_cpu = getopts::opt_maybe_str(matches, "target-cpu").unwrap_or_default(~"generic");
689+
let target_feature = getopts::opt_maybe_str(matches, "target-feature").unwrap_or_default(~"");
689690
let save_temps = getopts::opt_present(matches, "save-temps");
690691
let opt_level = {
691692
if (debugging_opts & session::no_opt) != 0 {
@@ -713,15 +714,6 @@ pub fn build_session_options(binary: @str,
713714
let debuginfo = debugging_opts & session::debug_info != 0 ||
714715
extra_debuginfo;
715716
let statik = debugging_opts & session::statik != 0;
716-
let target =
717-
match target_opt {
718-
None => host_triple(),
719-
Some(s) => s
720-
};
721-
let target_feature = match target_feature_opt {
722-
None => ~"",
723-
Some(s) => s
724-
};
725717

726718
let addl_lib_search_paths = getopts::opt_strs(matches, "L").map(|s| Path(*s));
727719
let linker = getopts::opt_maybe_str(matches, "linker");
@@ -760,6 +752,7 @@ pub fn build_session_options(binary: @str,
760752
linker_args: linker_args,
761753
maybe_sysroot: sysroot_opt,
762754
target_triple: target,
755+
target_cpu: target_cpu,
763756
target_feature: target_feature,
764757
cfg: cfg,
765758
binary: binary,
@@ -785,7 +778,7 @@ pub fn build_session(sopts: @session::options,
785778
pub fn build_session_(sopts: @session::options,
786779
cm: @codemap::CodeMap,
787780
demitter: diagnostic::Emitter,
788-
span_diagnostic_handler: @diagnostic::span_handler)
781+
span_diagnostic_handler: @mut diagnostic::span_handler)
789782
-> Session {
790783
let target_cfg = build_target_config(sopts, demitter);
791784
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler,
@@ -876,10 +869,13 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
876869
optopt("", "target",
877870
"Target triple cpu-manufacturer-kernel[-os]
878871
to compile for (see chapter 3.4 of http://www.sourceware.org/autobook/
879-
for detail)", "TRIPLE"),
872+
for details)", "TRIPLE"),
873+
optopt("", "target-cpu",
874+
"Select target processor (llc -mcpu=help
875+
for details)", "CPU"),
880876
optopt("", "target-feature",
881877
"Target specific attributes (llc -mattr=help
882-
for detail)", "FEATURE"),
878+
for details)", "FEATURE"),
883879
optopt("", "android-cross-path",
884880
"The path to the Android NDK", "PATH"),
885881
optflagopt("W", "warn",

branches/try2/src/librustc/driver/session.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ pub struct options {
153153
linker_args: ~[~str],
154154
maybe_sysroot: Option<@Path>,
155155
target_triple: ~str,
156+
target_cpu: ~str,
156157
target_feature: ~str,
157158
// User-specified cfg meta items. The compiler itself will add additional
158159
// items to the crate config, and during parsing the entire crate config
@@ -192,7 +193,7 @@ pub struct Session_ {
192193
// For a library crate, this is always none
193194
entry_fn: @mut Option<(NodeId, codemap::span)>,
194195
entry_type: @mut Option<EntryFnType>,
195-
span_diagnostic: @diagnostic::span_handler,
196+
span_diagnostic: @mut diagnostic::span_handler,
196197
filesearch: @filesearch::FileSearch,
197198
building_library: @mut bool,
198199
working_dir: Path,
@@ -261,7 +262,7 @@ impl Session_ {
261262
pub fn next_node_id(@self) -> ast::NodeId {
262263
return syntax::parse::next_node_id(self.parse_sess);
263264
}
264-
pub fn diagnostic(@self) -> @diagnostic::span_handler {
265+
pub fn diagnostic(@self) -> @mut diagnostic::span_handler {
265266
self.span_diagnostic
266267
}
267268
pub fn debugging_opt(@self, opt: uint) -> bool {
@@ -340,6 +341,7 @@ pub fn basic_options() -> @options {
340341
linker_args: ~[],
341342
maybe_sysroot: None,
342343
target_triple: host_triple(),
344+
target_cpu: ~"generic",
343345
target_feature: ~"",
344346
cfg: ~[],
345347
binary: @"rustc",

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,7 @@ pub mod llvm {
18111811
pub fn LLVMRustWriteOutputFile(PM: PassManagerRef,
18121812
M: ModuleRef,
18131813
Triple: *c_char,
1814+
Cpu: *c_char,
18141815
Feature: *c_char,
18151816
Output: *c_char,
18161817
// FIXME: When #2334 is fixed,
@@ -2082,6 +2083,9 @@ pub mod llvm {
20822083
Elements: ValueRef,
20832084
RunTimeLang: c_uint)
20842085
-> ValueRef;
2086+
2087+
#[fast_ffi]
2088+
pub fn LLVMSetUnnamedAddr(GlobalVar: ValueRef, UnnamedAddr: Bool);
20852089
}
20862090
}
20872091

@@ -2101,6 +2105,12 @@ pub fn SetLinkage(Global: ValueRef, Link: Linkage) {
21012105
}
21022106
}
21032107

2108+
pub fn SetUnnamedAddr(Global: ValueRef, Unnamed: bool) {
2109+
unsafe {
2110+
llvm::LLVMSetUnnamedAddr(Global, Unnamed as Bool);
2111+
}
2112+
}
2113+
21042114
pub fn ConstICmp(Pred: IntPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef {
21052115
unsafe {
21062116
llvm::LLVMConstICmp(Pred as c_ushort, V1, V2)

branches/try2/src/librustc/metadata/creader.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::oldvisit;
2929

3030
// Traverses an AST, reading all the information about use'd crates and extern
3131
// libraries necessary for later resolving, typechecking, linking, etc.
32-
pub fn read_crates(diag: @span_handler,
32+
pub fn read_crates(diag: @mut span_handler,
3333
crate: &ast::Crate,
3434
cstore: @mut cstore::CStore,
3535
filesearch: @FileSearch,
@@ -74,7 +74,7 @@ fn dump_crates(crate_cache: &[cache_entry]) {
7474
}
7575

7676
fn warn_if_multiple_versions(e: @mut Env,
77-
diag: @span_handler,
77+
diag: @mut span_handler,
7878
crate_cache: &[cache_entry]) {
7979
use std::either::*;
8080

@@ -113,7 +113,7 @@ fn warn_if_multiple_versions(e: @mut Env,
113113
}
114114

115115
struct Env {
116-
diag: @span_handler,
116+
diag: @mut span_handler,
117117
filesearch: @FileSearch,
118118
cstore: @mut cstore::CStore,
119119
os: loader::os,

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub type encode_inlined_item<'self> = &'self fn(ecx: &EncodeContext,
5555
ii: ast::inlined_item);
5656

5757
pub struct EncodeParams<'self> {
58-
diag: @span_handler,
58+
diag: @mut span_handler,
5959
tcx: ty::ctxt,
6060
reexports2: middle::resolve::ExportMap2,
6161
item_symbols: &'self HashMap<ast::NodeId, ~str>,
@@ -82,7 +82,7 @@ struct Stats {
8282
}
8383

8484
pub struct EncodeContext<'self> {
85-
diag: @span_handler,
85+
diag: @mut span_handler,
8686
tcx: ty::ctxt,
8787
stats: @mut Stats,
8888
reexports2: middle::resolve::ExportMap2,

branches/try2/src/librustc/metadata/loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub enum os {
4343
}
4444

4545
pub struct Context {
46-
diag: @span_handler,
46+
diag: @mut span_handler,
4747
filesearch: @FileSearch,
4848
span: span,
4949
ident: @str,
@@ -163,7 +163,7 @@ pub fn package_id_from_metas(metas: &[@ast::MetaItem]) -> Option<@str> {
163163
}
164164

165165
pub fn note_linkage_attrs(intr: @ident_interner,
166-
diag: @span_handler,
166+
diag: @mut span_handler,
167167
attrs: ~[ast::Attribute]) {
168168
let r = attr::find_linkage_metas(attrs);
169169
for mi in r.iter() {

branches/try2/src/librustc/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::diagnostic::span_handler;
2525
use syntax::print::pprust::*;
2626

2727
pub struct ctxt {
28-
diag: @span_handler,
28+
diag: @mut span_handler,
2929
// Def -> str Callback:
3030
ds: @fn(def_id) -> ~str,
3131
// The type context.

branches/try2/src/librustc/middle/astencode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ impl tr for method_origin {
586586
}
587587
)
588588
}
589-
typeck::method_trait(did, m, vstore) => {
590-
typeck::method_trait(did.tr(xcx), m, vstore)
589+
typeck::method_trait(did, m) => {
590+
typeck::method_trait(did.tr(xcx), m)
591591
}
592592
}
593593
}

branches/try2/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl<'self> CheckLoanCtxt<'self> {
362362
}
363363

364364
mc::cat_discr(b, _) |
365-
mc::cat_deref(b, _, mc::uniq_ptr(*)) => {
365+
mc::cat_deref(b, _, mc::uniq_ptr) => {
366366
assert_eq!(cmt.mutbl, mc::McInherited);
367367
cmt = b;
368368
}

branches/try2/src/librustc/middle/borrowck/gather_loans/gather_moves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
173173
}
174174
}
175175

176-
mc::cat_deref(b, _, mc::uniq_ptr(*)) |
176+
mc::cat_deref(b, _, mc::uniq_ptr) |
177177
mc::cat_discr(b, _) => {
178178
check_is_legal_to_move_from(bccx, cmt0, b)
179179
}

0 commit comments

Comments
 (0)