File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ // This test checks that prelude types like `Result` and `Option` still get a link generated.
2+
3+ //@ compile-flags: -Zunstable-options --generate-link-to-definition
4+
5+ #![ crate_name = "foo" ]
6+
7+ //@ has 'src/foo/jump-to-def-prelude-types.rs.html'
8+ // FIXME: would be nice to be able to check both the class and the href at the same time so
9+ // we could check the text as well...
10+ //@ has - '//a[@class="prelude-ty"]/@href' '{{channel}}/core/result/enum.Result.html'
11+ //@ has - '//a[@class="prelude-ty"]/@href' '{{channel}}/core/option/enum.Option.html'
12+ pub fn foo ( ) -> Result < Option < ( ) > , ( ) > { Err ( ( ) ) }
13+
14+ // This part is to ensure that they are not linking to the actual prelude ty.
15+ pub mod bar {
16+ struct Result ;
17+ struct Option ;
18+
19+ //@ has - '//a[@href="#16"]' 'Result'
20+ pub fn bar ( ) -> Result { Result }
21+ //@ has - '//a[@href="#17"]' 'Option'
22+ pub fn bar2 ( ) -> Option { Option }
23+ }
You can’t perform that action at this time.
0 commit comments