auto merge of #5442 : pcwalton/rust/extern-block-restriction, r=pcwalton

r? @graydon
This commit is contained in:
bors 2013-03-19 21:57:49 -07:00
commit f3c879fdd8
28 changed files with 411 additions and 188 deletions

View 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
}

View file

@ -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;

View file

@ -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 {

View file

@ -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(); }

View file

@ -0,0 +1,8 @@
use core::io::println;
static FOO: int = 3;
fn main() {
println(fmt!("%d", FOO));
}

View 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]));
}