Add a rustdoc test for default methods in external crates
This commit is contained in:
parent
5e1d4fffff
commit
695846331b
6
src/test/run-make/rustdoc-extern-default-method/Makefile
Normal file
6
src/test/run-make/rustdoc-extern-default-method/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
-include ../tools.mk
|
||||
|
||||
all: lib.rs ext.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTC) ext.rs
|
||||
$(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc lib.rs
|
||||
$(HTMLDOCCK) $(TMPDIR)/doc lib.rs
|
21
src/test/run-make/rustdoc-extern-default-method/ext.rs
Normal file
21
src/test/run-make/rustdoc-extern-default-method/ext.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// 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 Trait {
|
||||
fn provided(&self) {}
|
||||
}
|
||||
|
||||
pub struct Struct;
|
||||
|
||||
impl Trait for Struct {
|
||||
fn provided(&self) {}
|
||||
}
|
14
src/test/run-make/rustdoc-extern-default-method/lib.rs
Normal file
14
src/test/run-make/rustdoc-extern-default-method/lib.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// 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 ext;
|
||||
|
||||
// @count lib/struct.Struct.html '//*[@id="method.provided"]' 1
|
||||
pub use ext::Struct;
|
Loading…
Reference in New Issue
Block a user