Skip to content

Commit b90eef9

Browse files
committed
---
yaml --- r: 212881 b: refs/heads/master c: abe5f7b h: refs/heads/master i: 212879: dc75ae5 v: v3
1 parent 3fc39d5 commit b90eef9

File tree

154 files changed

+434
-428
lines changed

Some content is hidden

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

154 files changed

+434
-428
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b26eeffacb80c122e0559ada5584fdce7183561b
2+
refs/heads/master: abe5f7b95a1d856b69eb68344426e29d30918aea
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/src/librustc_trans/save/dump_csv.rs

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -437,30 +437,20 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
437437

438438
fn process_struct_field_def(&mut self,
439439
field: &ast::StructField,
440-
qualname: &str,
441-
scope_id: NodeId) {
442-
match field.node.kind {
443-
ast::NamedField(ident, _) => {
444-
let name = get_ident(ident);
445-
let qualname = format!("{}::{}", qualname, name);
446-
let typ =
447-
ppaux::ty_to_string(
448-
&self.analysis.ty_cx,
449-
*self.analysis.ty_cx.node_types().get(&field.node.id).unwrap());
450-
match self.span.sub_span_before_token(field.span, token::Colon) {
451-
Some(sub_span) => self.fmt.field_str(field.span,
452-
Some(sub_span),
453-
field.node.id,
454-
&name,
455-
&qualname,
456-
&typ,
457-
scope_id),
458-
None => self.sess.span_bug(field.span,
459-
&format!("Could not find sub-span for field {}",
460-
qualname)),
461-
}
462-
},
463-
_ => (),
440+
parent_id: NodeId) {
441+
let field_data = self.save_ctxt.get_field_data(field, parent_id);
442+
if let Some(field_data) = field_data {
443+
if let super::Data::VariableData(field_data) = field_data {
444+
self.fmt.field_str(field.span,
445+
Some(field_data.span),
446+
field_data.id,
447+
&field_data.name,
448+
&field_data.qualname,
449+
&field_data.type_value,
450+
field_data.scope);
451+
} else {
452+
self.sess.span_bug(field.span, "expected VariableData");
453+
}
464454
}
465455
}
466456

@@ -593,8 +583,8 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
593583

594584
// fields
595585
for field in &def.fields {
596-
self.process_struct_field_def(field, &qualname, item.id);
597-
self.visit_ty(&*field.node.ty);
586+
self.process_struct_field_def(field, item.id);
587+
self.visit_ty(&field.node.ty);
598588
}
599589

600590
self.process_generic_params(ty_params, item.span, &qualname, item.id);
@@ -648,7 +638,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
648638
item.id);
649639

650640
for field in &struct_def.fields {
651-
self.process_struct_field_def(field, &qualname, variant.node.id);
641+
self.process_struct_field_def(field, variant.node.id);
652642
self.visit_ty(&*field.node.ty);
653643
}
654644
}

trunk/src/librustc_trans/save/mod.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ use syntax::parse::token::{self, get_ident, keywords};
2323
use syntax::visit::{self, Visitor};
2424
use syntax::print::pprust::ty_to_string;
2525

26+
use util::ppaux;
2627

2728
use self::span_utils::SpanUtils;
2829

30+
2931
mod span_utils;
3032
mod recorder;
3133

@@ -47,7 +49,7 @@ pub struct CrateData {
4749
pub enum Data {
4850
/// Data for all kinds of functions and methods.
4951
FunctionData(FunctionData),
50-
/// Data for local and global variables (consts and statics).
52+
/// Data for local and global variables (consts and statics), and fields.
5153
VariableData(VariableData),
5254
/// Data for modules.
5355
ModData(ModData),
@@ -218,6 +220,33 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
218220
}
219221
}
220222

223+
// FIXME: we ought to be able to get the parent id ourselves, but we can't
224+
// for now.
225+
pub fn get_field_data(&self, field: &ast::StructField, parent: NodeId) -> Option<Data> {
226+
match field.node.kind {
227+
ast::NamedField(ident, _) => {
228+
let name = get_ident(ident);
229+
let qualname = format!("::{}::{}",
230+
self.analysis.ty_cx.map.path_to_string(parent),
231+
name);
232+
let typ = ppaux::ty_to_string(&self.analysis.ty_cx,
233+
*self.analysis.ty_cx.node_types()
234+
.get(&field.node.id).unwrap());
235+
let sub_span = self.span_utils.sub_span_before_token(field.span, token::Colon);
236+
Some(Data::VariableData(VariableData {
237+
id: field.node.id,
238+
name: get_ident(ident).to_string(),
239+
qualname: qualname,
240+
span: sub_span.unwrap(),
241+
scope: parent,
242+
value: "".to_owned(),
243+
type_value: typ,
244+
}))
245+
},
246+
_ => None,
247+
}
248+
}
249+
221250
pub fn get_expr_data(&self, expr: &ast::Expr) -> Data {
222251
match expr.node {
223252
ast::ExprField(ref sub_ex, ident) => {

trunk/src/rustllvm/ExecutionEngineWrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ using namespace llvm;
1616
using namespace llvm::sys;
1717
using namespace llvm::object;
1818

19-
// libmorestack is not used on other platforms
20-
#if defined(__linux__) || defined(__APPLE__)
19+
// libmorestack is not used on Windows
20+
#if !defined(_WIN32) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__Bitrig__)
2121
extern "C" void __morestack(void);
2222

2323
static void* morestack_addr() {
@@ -35,7 +35,7 @@ class RustJITMemoryManager : public SectionMemoryManager
3535

3636
uint64_t getSymbolAddress(const std::string &Name) override
3737
{
38-
#if defined(__linux__) || defined(__APPLE__)
38+
#if !defined(_WIN32) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__Bitrig__)
3939
if (Name == "__morestack" || Name == "___morestack")
4040
return reinterpret_cast<uint64_t>(__morestack);
4141
if (Name == "__morestack_addr" || Name == "___morestack_addr")

trunk/src/test/auxiliary/extern_calling_convention.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#[inline(never)]
1515
#[cfg(target_arch = "x86_64")]
1616
pub extern "win64" fn foo(a: isize, b: isize, c: isize, d: isize) {
17-
assert_eq!(a, 1);
18-
assert_eq!(b, 2);
19-
assert_eq!(c, 3);
20-
assert_eq!(d, 4);
17+
assert!(a == 1);
18+
assert!(b == 2);
19+
assert!(c == 3);
20+
assert!(d == 4);
2121

2222
println!("a: {}, b: {}, c: {}, d: {}",
2323
a, b, c, d)
@@ -26,10 +26,10 @@ pub extern "win64" fn foo(a: isize, b: isize, c: isize, d: isize) {
2626
#[inline(never)]
2727
#[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "aarch64"))]
2828
pub extern fn foo(a: isize, b: isize, c: isize, d: isize) {
29-
assert_eq!(a, 1);
30-
assert_eq!(b, 2);
31-
assert_eq!(c, 3);
32-
assert_eq!(d, 4);
29+
assert!(a == 1);
30+
assert!(b == 2);
31+
assert!(c == 3);
32+
assert!(d == 4);
3333

3434
println!("a: {}, b: {}, c: {}, d: {}",
3535
a, b, c, d)

trunk/src/test/bench/shootout-mandelbrot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const LIMIT: f64 = 2.0;
5454
const WORKERS: usize = 16;
5555

5656
fn mandelbrot<W: Write>(w: usize, mut out: W) -> io::Result<()> {
57-
assert_eq!(WORKERS % 2, 0);
57+
assert!(WORKERS % 2 == 0);
5858

5959
// Ensure w and h are multiples of 8.
6060
let w = (w + 7) / 8 * 8;
@@ -76,7 +76,7 @@ fn mandelbrot<W: Write>(w: usize, mut out: W) -> io::Result<()> {
7676
let v_consts = f64x2(1.5, 1.0);
7777

7878
// A lot of this code assumes this (so do other lang benchmarks)
79-
assert_eq!(w, h);
79+
assert!(w == h);
8080
let mut precalc_r = Vec::with_capacity(w);
8181
let mut precalc_i = Vec::with_capacity(h);
8282

trunk/src/test/compile-fail/builtin-superkinds-self-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ impl <T: Sync> Foo for T { }
2323
fn main() {
2424
let (tx, rx) = channel();
2525
1193182.foo(tx);
26-
assert_eq!(rx.recv(), 1193182);
26+
assert!(rx.recv() == 1193182);
2727
}

trunk/src/test/compile-fail/match-static-const-lc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn f() {
2222
//~^ ERROR constant in pattern `a` should have an upper case name such as `A`
2323
(x, y) => 1 + x + y,
2424
};
25-
assert_eq!(r, 1);
25+
assert!(r == 1);
2626
}
2727

2828
mod m {
@@ -37,7 +37,7 @@ fn g() {
3737
//~^ ERROR constant in pattern `aha` should have an upper case name such as `AHA`
3838
(x, y) => 1 + x + y,
3939
};
40-
assert_eq!(r, 1);
40+
assert!(r == 1);
4141
}
4242

4343
mod n {
@@ -51,7 +51,7 @@ fn h() {
5151
//~^ ERROR constant in pattern `not_okay` should have an upper case name such as `NOT_OKAY`
5252
(x, y) => 1 + x + y,
5353
};
54-
assert_eq!(r, 1);
54+
assert!(r == 1);
5555
}
5656

5757
fn main () {

trunk/src/test/compile-fail/mod_file_correct_spans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
mod mod_file_aux;
1414

1515
fn main() {
16-
assert_eq!(mod_file_aux::bar(), 10); //~ ERROR unresolved name
16+
assert!(mod_file_aux::bar() == 10); //~ ERROR unresolved name
1717
}

trunk/src/test/compile-fail/private-struct-field-cross-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ use cci_class::kitties::cat;
1414

1515
fn main() {
1616
let nyan : cat = cat(52, 99);
17-
assert_eq!(nyan.meows, 52);
17+
assert!((nyan.meows == 52));
1818
//~^ ERROR field `meows` of struct `cci_class::kitties::cat` is private
1919
}

trunk/src/test/compile-fail/private-struct-field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ mod cat {
2020

2121
fn main() {
2222
let nyan = cat::new_cat();
23-
assert_eq!(nyan.meows, 52); //~ ERROR field `meows` of struct `cat::Cat` is private
23+
assert!(nyan.meows == 52); //~ ERROR field `meows` of struct `cat::Cat` is private
2424
}

trunk/src/test/compile-fail/syntax-extension-minor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ pub fn main() {
1717
assert_eq!(concat_idents!(asd, f_f, dsa), "<.<".to_string());
1818
//~^ ERROR: unresolved name `asdf_fdsa`
1919

20-
assert_eq!(stringify!(use_mention_distinction), "use_mention_distinction");
20+
assert!(stringify!(use_mention_distinction) ==
21+
"use_mention_distinction");
2122
}

trunk/src/test/parse-fail/macros-no-semicolon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// compile-flags: -Z parse-only
1212

1313
fn main() {
14-
assert_eq!(1, 2)
15-
assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `assert_eq`
14+
assert!(1 == 2)
15+
assert!(3 == 4) //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `assert`
1616
println!("hello");
1717
}

trunk/src/test/pretty/do1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
fn f<F>(f: F) where F: Fn(isize) { f(10) }
1414

15-
fn main() { f(|i| { assert_eq!(i , 10) }) }
15+
fn main() { f(|i| { assert!(i == 10) }) }

trunk/src/test/run-fail/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// except according to those terms.
1010

1111
// error-pattern:1 == 2
12-
fn main() { assert!(1 == 2); }
12+
fn main() { assert!((1 == 2)); }

trunk/src/test/run-make/extern-flag-disambiguates/d.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ extern crate c;
1616
fn t(a: &'static usize) -> usize { a as *const _ as usize }
1717

1818
fn main() {
19-
assert_eq!(t(a::token()), t(b::a_token()));
19+
assert!(t(a::token()) == t(b::a_token()));
2020
assert!(t(a::token()) != t(c::a_token()));
2121
}

trunk/src/test/run-make/static-unwinding/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() {
2828
}).join().err().unwrap();
2929

3030
unsafe {
31-
assert_eq!(lib::statik, 1);
32-
assert_eq!(statik, 1);
31+
assert!(lib::statik == 1);
32+
assert!(statik == 1);
3333
}
3434
}

trunk/src/test/run-pass-fulldeps/compiler-calls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ fn main() {
7878
// we should never get use this filename, but lets make sure they are valid args.
7979
let args = vec!["compiler-calls".to_string(), "foo.rs".to_string()];
8080
rustc_driver::run_compiler(&args, &mut tc);
81-
assert_eq!(tc.count, 30);
81+
assert!(tc.count == 30);
8282
}

trunk/src/test/run-pass-valgrind/dst-dtor-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ pub fn main() {
2727
let _x: Box<Fat<[Foo]>> = Box::<Fat<[Foo; 3]>>::new(Fat { f: [Foo, Foo, Foo] });
2828
}
2929
unsafe {
30-
assert_eq!(DROP_RAN, 3);
30+
assert!(DROP_RAN == 3);
3131
}
3232
}

trunk/src/test/run-pass/arith-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313

1414
pub fn main() {
1515
let i32_c: isize = 0x10101010;
16-
assert_eq!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3),
16+
assert!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) ==
1717
i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3));
1818
}

trunk/src/test/run-pass/artificial-block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212
fn f() -> isize { { return 3; } }
1313

14-
pub fn main() { assert_eq!(f(), 3); }
14+
pub fn main() { assert!((f() == 3)); }

trunk/src/test/run-pass/assignability-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn length<A, T: iterable<A>>(x: T) -> usize {
4343
pub fn main() {
4444
let x: Vec<isize> = vec!(0,1,2,3);
4545
// Call a method
46-
x.iterate(|y| { assert_eq!(x[*y as usize], *y); true });
46+
x.iterate(|y| { assert!(x[*y as usize] == *y); true });
4747
// Call a parameterized function
4848
assert_eq!(length(x.clone()), x.len());
4949
// Call a parameterized function, with type arguments that require

trunk/src/test/run-pass/associated-types-return.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub trait Foo {
1616
fn boo(&self) -> <Self as Foo>::A;
1717
}
1818

19-
#[derive(PartialEq, Debug)]
19+
#[derive(PartialEq)]
2020
pub struct Bar;
2121

2222
impl Foo for isize {
@@ -44,12 +44,12 @@ fn foo2<I: Foo>(x: I) -> <I as Foo>::A {
4444

4545
pub fn main() {
4646
let a = 42;
47-
assert_eq!(foo2(a), 42);
47+
assert!(foo2(a) == 42);
4848

4949
let a = Bar;
50-
assert_eq!(foo2(a), 43);
50+
assert!(foo2(a) == 43);
5151

5252
let a = 'a';
5353
foo1(a);
54-
assert_eq!(foo2(a), Bar);
54+
assert!(foo2(a) == Bar);
5555
}

trunk/src/test/run-pass/bool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ fn main() {
7474
assert!(true >= false);
7575
assert!(!(true <= false));
7676

77-
assert_eq!(true.cmp(&true), Equal);
78-
assert_eq!(false.cmp(&false), Equal);
79-
assert_eq!(true.cmp(&false), Greater);
80-
assert_eq!(false.cmp(&true), Less);
77+
assert!(true.cmp(&true) == Equal);
78+
assert!(false.cmp(&false) == Equal);
79+
assert!(true.cmp(&false) == Greater);
80+
assert!(false.cmp(&true) == Less);
8181
}

trunk/src/test/run-pass/builtin-superkinds-capabilities-transitive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ fn foo<T: Foo + 'static>(val: T, chan: Sender<T>) {
3030
pub fn main() {
3131
let (tx, rx) = channel();
3232
foo(31337, tx);
33-
assert_eq!(rx.recv().unwrap(), 31337);
33+
assert!(rx.recv().unwrap() == 31337);
3434
}

trunk/src/test/run-pass/builtin-superkinds-capabilities-xc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern crate trait_superkinds_in_metadata;
2020
use std::sync::mpsc::{channel, Sender, Receiver};
2121
use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
2222

23-
#[derive(PartialEq, Debug)]
23+
#[derive(PartialEq)]
2424
struct X<T>(T);
2525

2626
impl <T: Sync> RequiresShare for X<T> { }
@@ -33,5 +33,5 @@ fn foo<T: RequiresRequiresShareAndSend + 'static>(val: T, chan: Sender<T>) {
3333
pub fn main() {
3434
let (tx, rx): (Sender<X<isize>>, Receiver<X<isize>>) = channel();
3535
foo(X(31337), tx);
36-
assert_eq!(rx.recv().unwrap(), X(31337));
36+
assert!(rx.recv().unwrap() == X(31337));
3737
}

0 commit comments

Comments
 (0)