diff options
| author | bors <bors@rust-lang.org> | 2015-02-08 06:15:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-08 06:15:52 +0000 |
| commit | cdaf3a4393927ddfba071cfbfe86d95b68e7ae3e (patch) | |
| tree | 9828694d7a89d98659c4f8b7c79d466dabb0b435 /src/test/run-make/rustdoc-extern-method | |
| parent | f16de18db448ca5de45bff90579990259518e1fc (diff) | |
| parent | e43c478035d82556168432d9be1027eca75af495 (diff) | |
Auto merge of #21999 - tomjakubowski:rustdoc-fixes, r=alexcrichton
r? @alexcrichton
Diffstat (limited to 'src/test/run-make/rustdoc-extern-method')
| -rw-r--r-- | src/test/run-make/rustdoc-extern-method/Makefile | 8 | ||||
| -rw-r--r-- | src/test/run-make/rustdoc-extern-method/bar.rs | 24 | ||||
| -rw-r--r-- | src/test/run-make/rustdoc-extern-method/foo.rs | 16 |
3 files changed, 48 insertions, 0 deletions
diff --git a/src/test/run-make/rustdoc-extern-method/Makefile b/src/test/run-make/rustdoc-extern-method/Makefile new file mode 100644 index 00000000000..c87684f59ea --- /dev/null +++ b/src/test/run-make/rustdoc-extern-method/Makefile @@ -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 + diff --git a/src/test/run-make/rustdoc-extern-method/bar.rs b/src/test/run-make/rustdoc-extern-method/bar.rs new file mode 100644 index 00000000000..672090c13a2 --- /dev/null +++ b/src/test/run-make/rustdoc-extern-method/bar.rs @@ -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, _: ()) { } +} diff --git a/src/test/run-make/rustdoc-extern-method/foo.rs b/src/test/run-make/rustdoc-extern-method/foo.rs new file mode 100644 index 00000000000..fc5f03e8bd3 --- /dev/null +++ b/src/test/run-make/rustdoc-extern-method/foo.rs @@ -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 } +} |
