auto merge of #14955 : alexcrichton/rust/rollup, r=alexcrichton
This commit is contained in:
commit
09967665ea
64 changed files with 777 additions and 356 deletions
|
|
@ -26,13 +26,13 @@ struct fish {
|
|||
fn main() {
|
||||
let a: clam = clam{x: box(GC) 1, y: box(GC) 2};
|
||||
let b: clam = clam{x: box(GC) 10, y: box(GC) 20};
|
||||
let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `@int`
|
||||
let z: int = a.x + b.y; //~ ERROR binary operation `+` cannot be applied to type `Gc<int>`
|
||||
println!("{:?}", z);
|
||||
assert_eq!(z, 21);
|
||||
let forty: fish = fish{a: box(GC) 40};
|
||||
let two: fish = fish{a: box(GC) 2};
|
||||
let answer: int = forty.a + two.a;
|
||||
//~^ ERROR binary operation `+` cannot be applied to type `@int`
|
||||
//~^ ERROR binary operation `+` cannot be applied to type `Gc<int>`
|
||||
println!("{:?}", answer);
|
||||
assert_eq!(answer, 42);
|
||||
}
|
||||
|
|
|
|||
21
src/test/compile-fail/issue-14915.rs
Normal file
21
src/test/compile-fail/issue-14915.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::gc::{GC,Gc};
|
||||
|
||||
fn main() {
|
||||
let x: Box<int> = box 0;
|
||||
let y: Gc<int> = box (GC) 0;
|
||||
|
||||
println!("{}", x + 1); //~ ERROR binary operation `+` cannot be applied to type `Box<int>`
|
||||
//~^ ERROR cannot determine a type for this bounded type parameter: unconstrained type
|
||||
println!("{}", y + 1);
|
||||
//~^ ERROR binary operation `+` cannot be applied to type `Gc<int>`
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ struct A {
|
|||
|
||||
fn main() {
|
||||
let a = A {v: box B{v: None} as Box<Foo+Send>};
|
||||
//~^ ERROR cannot pack type `~B`, which does not fulfill `Send`
|
||||
//~^ ERROR cannot pack type `Box<B>`, which does not fulfill `Send`
|
||||
let v = Rc::new(RefCell::new(a));
|
||||
let w = v.clone();
|
||||
let b = &*v;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ struct BarStruct;
|
|||
|
||||
impl<'a> BarStruct {
|
||||
fn foo(&'a mut self) -> Gc<BarStruct> { self }
|
||||
//~^ ERROR: error: mismatched types: expected `@BarStruct` but found `&'a mut BarStruct
|
||||
//~^ ERROR: error: mismatched types: expected `Gc<BarStruct>` but found `&'a mut BarStruct
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,16 @@ impl Point {
|
|||
|
||||
fn main() {
|
||||
let point: Point = Point::new();
|
||||
let px: int = point.get_x;//~ ERROR attempted to take value of method `get_x` on type `Point`
|
||||
//~^ NOTE maybe a missing `()` to call it? If not, try an anonymous function.
|
||||
let px: int = point
|
||||
.get_x;//~ ERROR attempted to take value of method `get_x` on type `Point`
|
||||
//~^ NOTE maybe a missing `()` to call it? If not, try an anonymous
|
||||
|
||||
// Ensure the span is useful
|
||||
let ys = &[1,2,3,4,5,6,7];
|
||||
let a = ys.iter()
|
||||
.map(|x| x)
|
||||
.filter(|&&x| x == 1)
|
||||
.filter_map; //~ ERROR attempted to take value of method `filter_map` on type
|
||||
//~^ NOTE maybe a missing `()` to call it? If not, try an anonymous function.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ impl<'a> set_f<'a> for c<'a> {
|
|||
}
|
||||
|
||||
fn set_f_bad(&self, b: Gc<b>) {
|
||||
self.f = b; //~ ERROR mismatched types: expected `@@&'a int` but found `@@&int`
|
||||
self.f = b; //~ ERROR mismatched types: expected `Gc<Gc<&'a int>>` but found `Gc<Gc<&int>>`
|
||||
//~^ ERROR cannot infer
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
ifndef IS_WINDOWS
|
||||
|
||||
all:
|
||||
$(RUSTDOC) --test foo.rs
|
||||
$(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) --test foo.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
|
||||
cp verify.sh $(TMPDIR)
|
||||
$(call RUN,verify.sh) $(TMPDIR)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
-include ../tools.mk
|
||||
all:
|
||||
$(RUSTDOC) -w json -o $(TMPDIR)/doc.json foo.rs
|
||||
$(RUSTDOC) -o $(TMPDIR)/doc $(TMPDIR)/doc.json
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -w json -o $(TMPDIR)/doc.json foo.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -o $(TMPDIR)/doc $(TMPDIR)/doc.json
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
-include ../tools.mk
|
||||
all:
|
||||
$(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
|
||||
cp verify.sh $(TMPDIR)
|
||||
$(call RUN,verify.sh) $(TMPDIR)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
export LD_LIBRARY_PATH:=$(TMPDIR):$(LD_LIBRARY_PATH)
|
||||
export DYLD_LIBRARY_PATH:=$(TMPDIR):$(DYLD_LIBRARY_PATH)
|
||||
|
||||
RUSTC := $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
||||
CC := $(CC) -L $(TMPDIR)
|
||||
|
||||
# These deliberately use `=` and not `:=` so that client makefiles can
|
||||
# augment HOST_RPATH_DIR / TARGET_RPATH_DIR.
|
||||
HOST_RPATH_ENV = \
|
||||
$(LD_LIB_PATH_ENVVAR)=$$$(LD_LIB_PATH_ENVVAR):$(HOST_RPATH_DIR)
|
||||
$(LD_LIB_PATH_ENVVAR)=$(HOST_RPATH_DIR):$$$(LD_LIB_PATH_ENVVAR)
|
||||
TARGET_RPATH_ENV = \
|
||||
$(LD_LIB_PATH_ENVVAR)=$$$(LD_LIB_PATH_ENVVAR):$(TARGET_RPATH_DIR)
|
||||
$(LD_LIB_PATH_ENVVAR)=$(TARGET_RPATH_DIR):$$$(LD_LIB_PATH_ENVVAR)
|
||||
|
||||
RUSTC := $(HOST_RPATH_ENV) $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
||||
CC := $(CC) -L $(TMPDIR)
|
||||
|
||||
# This is the name of the binary we will generate and run; use this
|
||||
# e.g. for `$(CC) -o $(RUN_BINFILE)`.
|
||||
|
|
|
|||
15
src/test/run-pass/issue-14933.rs
Normal file
15
src/test/run-pass/issue-14933.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(default_type_params)]
|
||||
|
||||
pub type BigRat<T = int> = T;
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
// ignore-android
|
||||
// ignore-win32
|
||||
// exec-env:RUST_LOG=debug
|
||||
|
||||
#![feature(phase)]
|
||||
|
||||
|
|
@ -29,9 +30,8 @@ fn main() {
|
|||
return
|
||||
}
|
||||
|
||||
let env = [("RUST_LOG".to_string(), "debug".to_string())];
|
||||
let p = Command::new(args[0].as_slice())
|
||||
.arg("child").env(env.as_slice())
|
||||
.arg("child")
|
||||
.spawn().unwrap().wait_with_output().unwrap();
|
||||
assert!(p.status.success());
|
||||
let mut lines = str::from_utf8(p.error.as_slice()).unwrap().lines();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue