diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-03-16 22:59:55 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-03-17 00:27:36 +0100 |
| commit | 5364acb41870eca5b7b41c7980851e6a524c4ca3 (patch) | |
| tree | 1504176c950943675ed37469b8ab7027bbd8cc0c /src/test/rustdoc | |
| parent | 0aeb9c12979e6da753701a798d04105b6b1a8c28 (diff) | |
| download | rust-5364acb41870eca5b7b41c7980851e6a524c4ca3.tar.gz rust-5364acb41870eca5b7b41c7980851e6a524c4ca3.zip | |
Fix invalid debug display for associated consts
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/const-doc.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/rustdoc/const-doc.rs b/src/test/rustdoc/const-doc.rs new file mode 100644 index 00000000000..9f70fe43175 --- /dev/null +++ b/src/test/rustdoc/const-doc.rs @@ -0,0 +1,31 @@ +// 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 <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. + +#![feature(associated_consts)] + +use std::marker::PhantomData; + +pub struct Foo<'a> { + f: PhantomData<&'a u32>, +} + +pub struct ContentType { + pub ttype: Foo<'static>, + pub subtype: Foo<'static>, + pub params: Option<Foo<'static>>, +} + +impl ContentType { + // @has const_doc/struct.ContentType.html + // @has - '//*[@class="docblock"]' 'Any: ContentType = ContentType{ttype: Foo{f: ' + pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, }, + subtype: Foo { f: PhantomData, }, + params: None, }; +} |
