librustc: Fix problem with cross-crate reexported static methods.
This commit is contained in:
parent
6c37e3b7f8
commit
2bd46e767c
10 changed files with 95 additions and 25 deletions
|
|
@ -13,8 +13,7 @@
|
|||
use std::hashmap::HashMap;
|
||||
|
||||
fn main() {
|
||||
let mut buggy_map :HashMap<uint, &uint> =
|
||||
HashMap::new::<uint, &uint>();
|
||||
let mut buggy_map: HashMap<uint, &uint> = HashMap::new();
|
||||
buggy_map.insert(42, &*~1); //~ ERROR borrowed value does not live long enough
|
||||
|
||||
// but it is ok if we use a temporary
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ use std::hashmap::HashMap;
|
|||
// Test that trait types printed in error msgs include the type arguments.
|
||||
|
||||
fn main() {
|
||||
let x: @Map<~str, ~str> = @HashMap::new::<~str, ~str>() as
|
||||
@Map<~str, ~str>;
|
||||
let x: @HashMap<~str, ~str> = @HashMap::new();
|
||||
let x: @Map<~str, ~str> = x as @Map<~str, ~str>;
|
||||
let y: @Map<uint, ~str> = @x;
|
||||
//~^ ERROR expected trait std::container::Map but found @-ptr
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// aux-build:private_variant_xc.rs
|
||||
// xfail-test
|
||||
|
||||
extern mod private_variant_xc;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ fn main() {
|
|||
// normal method on struct
|
||||
let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); //~ ERROR method `meth_struct` is private
|
||||
// static method on struct
|
||||
let _ = xc_private_method_lib::Struct::static_meth_struct(); //~ ERROR function `static_meth_struct` is private
|
||||
let _ = xc_private_method_lib::Struct::static_meth_struct(); //~ ERROR method `static_meth_struct` is private
|
||||
|
||||
// normal method on enum
|
||||
let _ = xc_private_method_lib::Variant1(20).meth_enum(); //~ ERROR method `meth_enum` is private
|
||||
// static method on enum
|
||||
let _ = xc_private_method_lib::Enum::static_meth_enum(); //~ ERROR function `static_meth_enum` is private
|
||||
let _ = xc_private_method_lib::Enum::static_meth_enum(); //~ ERROR method `static_meth_enum` is private
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
use std::hashmap::HashMap;
|
||||
|
||||
pub fn main() {
|
||||
let mut buggy_map: HashMap<uint, &uint> = HashMap::new::<uint, &uint>();
|
||||
let mut buggy_map: HashMap<uint, &uint> = HashMap::new();
|
||||
let x = ~1;
|
||||
buggy_map.insert(42, &*x);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue