mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-21 20:23:21 +00:00
parent
19c0735231
commit
62ba835573
@ -87,6 +87,7 @@ use syntax::parse::token::{special_idents};
|
||||
use syntax::print::pprust::stmt_to_str;
|
||||
use syntax::{ast, ast_util, codemap, ast_map};
|
||||
use syntax::abi::{X86, X86_64, Arm, Mips};
|
||||
use syntax::visit;
|
||||
use syntax::visit::Visitor;
|
||||
|
||||
pub use middle::trans::context::task_llcx;
|
||||
@ -2239,6 +2240,14 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
|
||||
trans_struct_def(ccx, struct_def);
|
||||
}
|
||||
}
|
||||
ast::item_trait(*) => {
|
||||
// Inside of this trait definition, we won't be actually translating any
|
||||
// functions, but the trait still needs to be walked. Otherwise default
|
||||
// methods with items will not get translated and will cause ICE's when
|
||||
// metadata time comes around.
|
||||
let mut v = TransItemVisitor;
|
||||
visit::walk_item(&mut v, item, ccx);
|
||||
}
|
||||
_ => {/* fall through */ }
|
||||
}
|
||||
}
|
||||
|
19
src/test/auxiliary/issue_9123.rs
Normal file
19
src/test/auxiliary/issue_9123.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2013 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.
|
||||
|
||||
#[crate_type = "lib"];
|
||||
|
||||
pub trait X {
|
||||
fn x() {
|
||||
fn f() { }
|
||||
f();
|
||||
}
|
||||
}
|
||||
|
16
src/test/run-pass/issue-9123.rs
Normal file
16
src/test/run-pass/issue-9123.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2013 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.
|
||||
|
||||
// xfail-fast windows doesn't like aux-build
|
||||
// aux-build:issue_9123.rs
|
||||
|
||||
extern mod issue_9123;
|
||||
|
||||
pub fn main() {}
|
Loading…
Reference in New Issue
Block a user