diff options
| author | SlightlyOutOfPhase <slightlyoutofphase@gmail.com> | 2020-09-12 10:52:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-12 10:52:12 -0400 |
| commit | 9c1389418e547e7feb0dc8f4cb42fbdcd1089467 (patch) | |
| tree | 951243729c1674061518bde0d1644e16581e4500 | |
| parent | 4284aad8fc500c6e9b19309e2ca561ec0f433555 (diff) | |
| download | rust-9c1389418e547e7feb0dc8f4cb42fbdcd1089467.tar.gz rust-9c1389418e547e7feb0dc8f4cb42fbdcd1089467.zip | |
Fix `const-display.rs` XPATH queries (#1)
* Fix `const-display.rs` XPATH queries * Add `issue_76501.rs` test file * Rename issue_76501.rs to issue-76501.rs
| -rw-r--r-- | src/test/rustdoc/const-display.rs | 6 | ||||
| -rw-r--r-- | src/test/rustdoc/issue-76501.rs | 18 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs index c5016c650e5..b3fbe377f0b 100644 --- a/src/test/rustdoc/const-display.rs +++ b/src/test/rustdoc/const-display.rs @@ -12,7 +12,7 @@ #[rustc_const_unstable(feature="foo", issue = "none")] pub const unsafe fn foo() -> u32 { 42 } -// @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32' +// @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32' #[unstable(feature = "humans", issue = "none")] pub const fn foo2() -> u32 { 42 } @@ -21,7 +21,7 @@ pub const fn foo2() -> u32 { 42 } #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn bar2() -> u32 { 42 } -// @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32' +// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32' #[unstable(feature = "foo2", issue = "none")] pub const unsafe fn foo2_gated() -> u32 { 42 } @@ -30,7 +30,7 @@ pub const unsafe fn foo2_gated() -> u32 { 42 } #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const unsafe fn bar2_gated() -> u32 { 42 } -// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32' +// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32' pub const unsafe fn bar_not_gated() -> u32 { 42 } pub struct Foo; diff --git a/src/test/rustdoc/issue-76501.rs b/src/test/rustdoc/issue-76501.rs new file mode 100644 index 00000000000..e2755fc0358 --- /dev/null +++ b/src/test/rustdoc/issue-76501.rs @@ -0,0 +1,18 @@ +#![feature(const_fn)] + +// @has 'issue_76501/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32' +/// A useless function that always returns 1. +pub const fn bloop() -> i32 { + 1 +} + +/// A struct. +pub struct Struct {} + +impl Struct { + // @has 'issue_76501/struct.Struct.html' '//*[@class="method"]' 'pub const fn bloop() -> i32' + /// A useless function that always returns 1. + pub const fn bloop() -> i32 { + 1 + } +} |
