]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/impl-disambiguation.rs
Rollup merge of #39660 - alexcrichton:shasum-dirs, r=brson
[rust.git] / src / test / rustdoc / impl-disambiguation.rs
1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![crate_name = "foo"]
12
13 pub trait Foo {}
14
15 pub struct Bar<T> { field: T }
16
17 // @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
18 //     "impl Foo for Bar<u8>"
19 impl Foo for Bar<u8> {}
20 // @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
21 //     "impl Foo for Bar<u16>"
22 impl Foo for Bar<u16> {}
23 // @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
24 //     "impl<'a> Foo for &'a Bar<u8>"
25 impl<'a> Foo for &'a Bar<u8> {}
26
27 pub mod mod1 {
28     pub struct Baz {}
29 }
30
31 pub mod mod2 {
32     pub enum Baz {}
33 }
34
35 // @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
36 //     "impl Foo for foo::mod1::Baz"
37 impl Foo for mod1::Baz {}
38 // @has foo/trait.Foo.html '//*[@class="item-list"]//code' \
39 //     "impl<'a> Foo for &'a foo::mod2::Baz"
40 impl<'a> Foo for &'a mod2::Baz {}