Skip to content

Commit 49f6726

Browse files
committed
---
yaml --- r: 138417 b: refs/heads/try2 c: e29b7ee h: refs/heads/master i: 138415: 125b640 v: v3
1 parent 254552c commit 49f6726

File tree

13 files changed

+22
-196
lines changed

13 files changed

+22
-196
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: 8f8f0ec2c6761b096eea1f8dceb42c2618f5a196
8+
refs/heads/try2: e29b7eedf9670e2a86647b318f6cb9c2a8a46463
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"Highlight the 78th text column
2+
"Feature became available in v7.3
3+
if version >= 703
4+
set colorcolumn=78
5+
endif

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,15 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\>
103103
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>"
104104
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
105105

106+
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
107+
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
106108
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
107109

108110
syn region rustComment start="/\*" end="\*/" contains=rustComment,rustTodo
109111
syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend
110112

111-
syn keyword rustTodo TODO FIXME XXX NB
113+
114+
syn keyword rustTodo TODO FIXME XXX NB unsafe
112115

113116
hi def link rustHexNumber rustNumber
114117
hi def link rustBinNumber rustNumber
@@ -134,6 +137,7 @@ hi def link rustType Type
134137
hi def link rustTodo Todo
135138
hi def link rustAttribute PreProc
136139
hi def link rustStorage StorageClass
140+
hi def link rustLifetime Special
137141

138142
" Other Suggestions:
139143
" hi rustAssert ctermfg=yellow

branches/try2/src/etc/x86.supp

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -366,55 +366,6 @@
366366
...
367367
}
368368

369-
{
370-
enum-instruction-scheduling-1
371-
Memcheck:Cond
372-
fun:*fold_mod*
373-
...
374-
}
375-
376-
{
377-
enum-instruction-scheduling-2
378-
Memcheck:Cond
379-
fun:*fold_nmod*
380-
...
381-
}
382-
383-
{
384-
enum-instruction-scheduling-3
385-
Memcheck:Cond
386-
fun:*fold_crate*
387-
...
388-
}
389-
390-
{
391-
enum-instruction-scheduling-4
392-
Memcheck:Cond
393-
fun:*fold_enum*
394-
...
395-
}
396-
397-
{
398-
enum-instruction-scheduling-5
399-
Memcheck:Cond
400-
fun:*write_variant*
401-
...
402-
}
403-
404-
{
405-
enum-instruction-scheduling-6
406-
Memcheck:Cond
407-
fun:*merge_method_attrs*
408-
...
409-
}
410-
411-
{
412-
enum-instruction-scheduling-7
413-
Memcheck:Cond
414-
fun:*parse_config_*
415-
...
416-
}
417-
418369
{
419370
llvm-user-new-leak
420371
Memcheck:Leak

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@ pub enum FileType {
184184
ObjectFile = 1
185185
}
186186

187-
pub enum Metadata {
188-
MD_dbg = 0,
189-
MD_tbaa = 1,
190-
MD_prof = 2,
191-
MD_fpmath = 3,
192-
MD_range = 4,
193-
MD_tbaa_struct = 5
194-
}
195-
196187
// Opaque pointer types
197188
pub enum Module_opaque {}
198189
pub type ModuleRef = *Module_opaque;

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,29 +1361,13 @@ pub fn compile_submatch(bcx: block,
13611361
if opts.len() > 0u {
13621362
match opts[0] {
13631363
var(_, vdef) => {
1364-
let variants = ty::enum_variants(tcx, vdef.enm);
1365-
if variants.len() == 1 {
1364+
if (*ty::enum_variants(tcx, vdef.enm)).len() == 1u {
13661365
kind = single;
13671366
} else {
13681367
let enumptr =
13691368
PointerCast(bcx, val, T_opaque_enum_ptr(ccx));
13701369
let discrimptr = GEPi(bcx, enumptr, [0u, 0u]);
1371-
1372-
1373-
assert variants.len() > 1;
1374-
let min_discrim = do variants.foldr(0) |&x, y| {
1375-
int::min(x.disr_val, y)
1376-
};
1377-
let max_discrim = do variants.foldr(0) |&x, y| {
1378-
int::max(x.disr_val, y)
1379-
};
1380-
1381-
test_val = LoadRangeAssert(bcx, discrimptr,
1382-
min_discrim as c_ulonglong,
1383-
(max_discrim + 1)
1384-
as c_ulonglong,
1385-
lib::llvm::True);
1386-
1370+
test_val = Load(bcx, discrimptr);
13871371
kind = switch;
13881372
}
13891373
}

branches/try2/src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use lib::llvm::llvm;
1414
use lib::llvm::{CallConv, TypeKind, AtomicBinOp, AtomicOrdering};
1515
use lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False};
1616
use lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef};
17-
use libc::{c_uint, c_int, c_ulonglong};
17+
use libc::{c_uint, c_int};
1818
use middle::trans::common::*;
19-
use middle::trans::machine::llsize_of_real;
2019

2120
use core::cast::transmute;
2221
use core::cast;
@@ -537,25 +536,6 @@ pub fn Load(cx: block, PointerVal: ValueRef) -> ValueRef {
537536
}
538537
}
539538
540-
pub fn LoadRangeAssert(cx: block, PointerVal: ValueRef, lo: c_ulonglong,
541-
hi: c_ulonglong, signed: lib::llvm::Bool) -> ValueRef {
542-
let value = Load(cx, PointerVal);
543-
544-
unsafe {
545-
let t = llvm::LLVMGetElementType(llvm::LLVMTypeOf(PointerVal));
546-
let min = llvm::LLVMConstInt(t, lo, signed);
547-
let max = llvm::LLVMConstInt(t, hi, signed);
548-
549-
550-
do vec::as_imm_buf([min, max]) |ptr, len| {
551-
llvm::LLVMSetMetadata(value, lib::llvm::MD_range as c_uint,
552-
llvm::LLVMMDNode(ptr, len as c_uint));
553-
}
554-
}
555-
556-
value
557-
}
558-
559539
pub fn Store(cx: block, Val: ValueRef, Ptr: ValueRef) {
560540
unsafe {
561541
if cx.unreachable { return; }

branches/try2/src/librustc/middle/trans/datum.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,7 @@ pub impl Datum {
431431
} else {
432432
match self.mode {
433433
ByValue => self.val,
434-
ByRef => {
435-
if ty::type_is_bool(self.ty) {
436-
LoadRangeAssert(bcx, self.val, 0, 2, lib::llvm::True)
437-
} else {
438-
Load(bcx, self.val)
439-
}
440-
}
434+
ByRef => Load(bcx, self.val)
441435
}
442436
}
443437
}

branches/try2/src/librustc/middle/trans/expr.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -491,29 +491,11 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
491491
ast::expr_swap(dst, src) => {
492492
let dst_datum = unpack_datum!(bcx, trans_lvalue(bcx, dst));
493493
let src_datum = unpack_datum!(bcx, trans_lvalue(bcx, src));
494+
let scratch = scratch_datum(bcx, dst_datum.ty, false);
494495

495-
// If the source and destination are the same, then don't swap.
496-
// Avoids performing an overlapping memcpy
497-
let dst_datum_ref = dst_datum.to_ref_llval(bcx);
498-
let src_datum_ref = src_datum.to_ref_llval(bcx);
499-
let cmp = ICmp(bcx, lib::llvm::IntEQ,
500-
src_datum_ref,
501-
dst_datum_ref);
502-
503-
let swap_cx = base::sub_block(bcx, ~"swap");
504-
let next_cx = base::sub_block(bcx, ~"next");
505-
506-
CondBr(bcx, cmp, next_cx.llbb, swap_cx.llbb);
507-
508-
let scratch = scratch_datum(swap_cx, dst_datum.ty, false);
509-
510-
let swap_cx = dst_datum.move_to_datum(swap_cx, INIT, scratch);
511-
let swap_cx = src_datum.move_to_datum(swap_cx, INIT, dst_datum);
512-
let swap_cx = scratch.move_to_datum(swap_cx, INIT, src_datum);
513-
514-
Br(swap_cx, next_cx.llbb);
515-
516-
return next_cx;
496+
let bcx = dst_datum.move_to_datum(bcx, INIT, scratch);
497+
let bcx = src_datum.move_to_datum(bcx, INIT, dst_datum);
498+
return scratch.move_to_datum(bcx, INIT, src_datum);
517499
}
518500
ast::expr_assign_op(op, dst, src) => {
519501
return trans_assign_op(bcx, expr, op, dst, src);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2823,7 +2823,7 @@ pub pure fn ty_fn_ret(fty: t) -> t {
28232823
}
28242824
}
28252825

2826-
pub fn is_fn_ty(fty: t) -> bool {
2826+
fn is_fn_ty(fty: t) -> bool {
28272827
match get(fty).sty {
28282828
ty_bare_fn(_) => true,
28292829
ty_closure(_) => true,

branches/try2/src/librustc/middle/typeck/check/_match.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
9292
match structure_of(pcx.fcx, pat.span, expected) {
9393
ty::ty_enum(_, ref expected_substs) => {
9494
// Lookup the enum and variant def ids:
95-
let v_def = lookup_def(pcx.fcx, pat.span, pat.id);
95+
let v_def = lookup_def(pcx.fcx, path.span, pat.id);
9696
let v_def_ids = ast_util::variant_def_ids(v_def);
9797

9898
// Assign the pattern the type of the *enum*, not the variant.
@@ -125,17 +125,8 @@ pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
125125
kind_name = "variant";
126126
}
127127
ty::ty_struct(struct_def_id, ref expected_substs) => {
128-
// Lookup the struct ctor def id
129-
let s_def = lookup_def(pcx.fcx, pat.span, pat.id);
130-
let s_def_id = ast_util::def_id_of_def(s_def);
131-
132128
// Assign the pattern the type of the struct.
133-
let ctor_tpt = ty::lookup_item_type(tcx, s_def_id);
134-
let struct_tpt = if ty::is_fn_ty(ctor_tpt.ty) {
135-
{ty: ty::ty_fn_ret(ctor_tpt.ty), ..ctor_tpt}
136-
} else {
137-
ctor_tpt
138-
};
129+
let struct_tpt = ty::lookup_item_type(tcx, struct_def_id);
139130
instantiate_path(pcx.fcx, path, struct_tpt, pat.span, pat.id,
140131
pcx.block_region);
141132

branches/try2/src/test/compile-fail/match-struct.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

branches/try2/src/test/run-pass/swap-overlapping.rs

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)