auto merge of #5442 : pcwalton/rust/extern-block-restriction, r=pcwalton
r? @graydon
This commit is contained in:
commit
f3c879fdd8
28 changed files with 411 additions and 188 deletions
11
src/test/compile-fail/static-method-privacy.rs
Normal file
11
src/test/compile-fail/static-method-privacy.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
mod a {
|
||||
pub struct S;
|
||||
impl S {
|
||||
static fn new() -> S { S }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = a::S::new(); //~ ERROR function `new` is private
|
||||
}
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// pp-exact
|
||||
fn f() -> [int * 3] {
|
||||
fn f() -> [int, ..3] {
|
||||
let picard = 0;
|
||||
|
||||
let data = 1;
|
||||
|
|
|
|||
|
|
@ -121,13 +121,6 @@ mod test_foreign_items {
|
|||
mod test_use_statements {
|
||||
#[cfg(bogus)]
|
||||
use flippity_foo;
|
||||
|
||||
pub mod rustrt {
|
||||
pub extern {
|
||||
#[cfg(bogus)]
|
||||
use flippity_foo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod test_methods {
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
// xfail-fast
|
||||
|
||||
// Copyright 2012 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.
|
||||
|
||||
mod spam {
|
||||
pub fn ham() { }
|
||||
pub fn eggs() { }
|
||||
}
|
||||
|
||||
mod rustrt {
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
pub use spam::{ham, eggs};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main() { rustrt::ham(); rustrt::eggs(); }
|
||||
8
src/test/run-pass/new-style-constants.rs
Normal file
8
src/test/run-pass/new-style-constants.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use core::io::println;
|
||||
|
||||
static FOO: int = 3;
|
||||
|
||||
fn main() {
|
||||
println(fmt!("%d", FOO));
|
||||
}
|
||||
|
||||
10
src/test/run-pass/new-style-fixed-length-vec.rs
Normal file
10
src/test/run-pass/new-style-fixed-length-vec.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use core::io::println;
|
||||
|
||||
static FOO: [int, ..3] = [1, 2, 3];
|
||||
|
||||
fn main() {
|
||||
println(fmt!("%d %d %d", FOO[0], FOO[1], FOO[2]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue