File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,18 @@ fn stack_check_item(v: StackCheckVisitor,
8080 visit:: walk_method_helper ( & mut v, method, new_cx) ;
8181 }
8282 }
83+ ast:: item_trait( _, _, ref methods) => {
84+ for method in methods. iter ( ) {
85+ match * method {
86+ ast:: provided( @ref method) => {
87+ let safe_stack = fixed_stack_segment ( method. attrs ) ;
88+ let new_cx = Context { safe_stack : safe_stack, ..in_cx} ;
89+ visit:: walk_method_helper ( & mut v, method, new_cx) ;
90+ }
91+ ast:: required( * ) => ( )
92+ }
93+ }
94+ }
8395 _ => {
8496 visit:: walk_item ( & mut v, item, in_cx) ;
8597 }
Original file line number Diff line number Diff line change 1+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ extern {
12+ fn rust_get_test_int ( ) -> std:: libc:: intptr_t ;
13+ }
14+
15+ trait A {
16+ fn foo ( ) {
17+ unsafe {
18+ rust_get_test_int ( ) ; //~ ERROR invoking non-Rust fn
19+ }
20+ }
21+ }
22+
23+ fn main ( ) {
24+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ use std:: libc;
12+
13+ extern {
14+ fn rust_get_test_int ( ) -> libc:: intptr_t ;
15+ }
16+
17+ trait A {
18+ #[ fixed_stack_segment]
19+ fn foo ( ) {
20+ unsafe {
21+ rust_get_test_int ( ) ;
22+ }
23+ }
24+ }
25+
26+ fn main ( ) {
27+ }
You can’t perform that action at this time.
0 commit comments