From 2792b56a92eec4a88b2d625d4584074c3918ef6f Mon Sep 17 00:00:00 2001 From: kennytm Date: Wed, 15 Nov 2017 17:31:23 +0800 Subject: Support `extern type` in rustdoc. Fixes #45640. --- src/test/rustdoc/foreigntype.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/rustdoc/foreigntype.rs (limited to 'src/test/rustdoc') diff --git a/src/test/rustdoc/foreigntype.rs b/src/test/rustdoc/foreigntype.rs new file mode 100644 index 00000000000..06447ffaa75 --- /dev/null +++ b/src/test/rustdoc/foreigntype.rs @@ -0,0 +1,28 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(extern_types)] + +extern { + // @has foreigntype/foreigntype.ExtType.html + pub type ExtType; +} + +impl ExtType { + // @has - '//a[@class="fnname"]' 'do_something' + pub fn do_something(&self) {} +} + +pub trait Trait {} + +// @has foreigntype/trait.Trait.html '//a[@class="foreigntype"]' 'ExtType' +impl Trait for ExtType {} + +// @has foreigntype/index.html '//a[@class="foreigntype"]' 'ExtType' -- cgit 1.4.1-3-g733a5