Skip to content

Commit 9c13894

Browse files
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
1 parent 4284aad commit 9c13894

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/test/rustdoc/const-display.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#[rustc_const_unstable(feature="foo", issue = "none")]
1313
pub const unsafe fn foo() -> u32 { 42 }
1414

15-
// @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32'
15+
// @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32'
1616
#[unstable(feature = "humans", issue = "none")]
1717
pub const fn foo2() -> u32 { 42 }
1818

@@ -21,7 +21,7 @@ pub const fn foo2() -> u32 { 42 }
2121
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
2222
pub const fn bar2() -> u32 { 42 }
2323

24-
// @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32'
24+
// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
2525
#[unstable(feature = "foo2", issue = "none")]
2626
pub const unsafe fn foo2_gated() -> u32 { 42 }
2727

@@ -30,7 +30,7 @@ pub const unsafe fn foo2_gated() -> u32 { 42 }
3030
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
3131
pub const unsafe fn bar2_gated() -> u32 { 42 }
3232

33-
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32'
33+
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
3434
pub const unsafe fn bar_not_gated() -> u32 { 42 }
3535

3636
pub struct Foo;

src/test/rustdoc/issue-76501.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(const_fn)]
2+
3+
// @has 'issue_76501/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
4+
/// A useless function that always returns 1.
5+
pub const fn bloop() -> i32 {
6+
1
7+
}
8+
9+
/// A struct.
10+
pub struct Struct {}
11+
12+
impl Struct {
13+
// @has 'issue_76501/struct.Struct.html' '//*[@class="method"]' 'pub const fn bloop() -> i32'
14+
/// A useless function that always returns 1.
15+
pub const fn bloop() -> i32 {
16+
1
17+
}
18+
}

0 commit comments

Comments
 (0)