parent
43b8503568
commit
abae840f45
6 changed files with 70 additions and 7 deletions
8
src/test/run-make/rustdoc-extern-method/Makefile
Normal file
8
src/test/run-make/rustdoc-extern-method/Makefile
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all: foo.rs bar.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTC) foo.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc bar.rs
|
||||
$(HTMLDOCCK) $(TMPDIR)/doc bar.rs
|
||||
|
||||
24
src/test/run-make/rustdoc-extern-method/bar.rs
Normal file
24
src/test/run-make/rustdoc-extern-method/bar.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2015 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.
|
||||
|
||||
extern crate foo;
|
||||
|
||||
// @has bar/trait.Foo.html //pre "pub trait Foo"
|
||||
// @has - '//*[@id="tymethod.foo"]//code' 'extern "rust-call" fn foo'
|
||||
// @has - '//*[@id="tymethod.foo_"]//code' 'extern "rust-call" fn foo_'
|
||||
pub use foo::Foo;
|
||||
|
||||
// @has bar/trait.Bar.html //pre "pub trait Bar"
|
||||
pub trait Bar {
|
||||
// @has - '//*[@id="tymethod.bar"]//code' 'extern "rust-call" fn bar'
|
||||
extern "rust-call" fn bar(&self, _: ());
|
||||
// @has - '//*[@id="method.bar_"]//code' 'extern "rust-call" fn bar_'
|
||||
extern "rust-call" fn bar_(&self, _: ()) { }
|
||||
}
|
||||
16
src/test/run-make/rustdoc-extern-method/foo.rs
Normal file
16
src/test/run-make/rustdoc-extern-method/foo.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2015 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 Foo {
|
||||
extern "rust-call" fn foo(&self, _: ()) -> i32;
|
||||
extern "rust-call" fn foo_(&self, _: ()) -> i32 { 0 }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue