Skip to content

Commit

Permalink
Fix const-display.rs XPATH queries (#1)
Browse files Browse the repository at this point in the history
* Fix `const-display.rs` XPATH queries

* Add `issue_76501.rs` test file

* Rename issue_76501.rs to issue-76501.rs
  • Loading branch information
slightlyoutofphase committed Sep 12, 2020
1 parent 4284aad commit 9c13894
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/rustdoc/const-display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand All @@ -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 }

Expand All @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions src/test/rustdoc/issue-76501.rs
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 9c13894

Please sign in to comment.