Skip to content

Rollup of 9 pull requests #86515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jun 21, 2021
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0fdd6cc
Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible lint
0xPoe Jun 10, 2021
c09b699
Add a regression test for issue-85113
JohnTitor Jun 12, 2021
782824c
add regression test for issue #78632
yerke Jun 16, 2021
d2f2237
fix(rustfmt): load nested out-of-line mods correctly
calebcartwright Jun 18, 2021
9c495b3
"(const: unstable)" for stable-but-const-unstable
fee1-dead Jun 20, 2021
f804d8d
Improve documentation
Jun 20, 2021
61b453c
Fix CI to fetch master on beta channel
Mark-Simulacrum Jun 19, 2021
008d4d6
Fix rust.css fonts.
ehuss Jun 21, 2021
e84c9ae
Delete spaces
Jun 21, 2021
5fb27bc
Check for const_unstable before printing `const`
fee1-dead Jun 20, 2021
c4396f4
Added some tests for `unsafe` in const-dispay.rs
fee1-dead Jun 21, 2021
0d69a02
Removed/Updated some cases and simplified `match`
fee1-dead Jun 21, 2021
f82fb30
Update comment regarding staged_api
fee1-dead Jun 21, 2021
b57077b
Readd `unsafe` keyword in tests
fee1-dead Jun 21, 2021
3ee78b3
Rollup merge of #86192 - hi-rustin:rustin-patch-lint, r=nikomatsakis
JohnTitor Jun 21, 2021
ac41056
Rollup merge of #86248 - JohnTitor:issue-85113, r=Mark-Simulacrum
JohnTitor Jun 21, 2021
58e7411
Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3
JohnTitor Jun 21, 2021
aba0bed
Rollup merge of #86349 - yerke:add-test-for-issue-78632, r=Mark-Simul…
JohnTitor Jun 21, 2021
a81f55f
Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Ma…
JohnTitor Jun 21, 2021
9c664b2
Rollup merge of #86472 - Mark-Simulacrum:fix-ci-beta, r=pietroalbini
JohnTitor Jun 21, 2021
f3fe5c3
Rollup merge of #86473 - fee1-dead:rustdoc-const-unstable, r=jyn514
JohnTitor Jun 21, 2021
2fdc2ea
Rollup merge of #86495 - r00ster91:patch-11, r=petrochenkov
JohnTitor Jun 21, 2021
599e8a7
Rollup merge of #86503 - ehuss:rustc.css-fonts, r=jyn514,GuillaumeGomez
JohnTitor Jun 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added some tests for unsafe in const-dispay.rs
  • Loading branch information
fee1-dead committed Jun 21, 2021
commit c4396f476e65ad6d687df414e74b94d1caaacb2b
53 changes: 47 additions & 6 deletions src/test/rustdoc/const-display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,57 @@
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const fn foo() -> u32 { 42 }

// @has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn foo_unsafe() -> u32 { 42 }

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

// @has 'foo/fn.foo2_unsafe.html' '//pre' 'pub const unsafe fn foo2_unsafe() -> u32'
#[unstable(feature = "humans", issue = "none")]
pub const unsafe fn foo2_unsafe() -> u32 { 42 }

// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32'
// @has - //span '1.0.0 (const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const fn bar2() -> u32 { 42 }

// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
// @has 'foo/fn.bar2_unsafe.html' '//pre' 'pub const unsafe fn bar2_unsafe() -> u32'
// @has - //span '1.0.0 (const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const unsafe fn bar2_unsafe() -> u32 { 42 }

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

// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32'
// @has 'foo/fn.foo2_gated_unsafe.html' '//pre' 'pub const unsafe fn foo2_gated_unsafe() -> u32'
#[unstable(feature = "foo2", issue = "none")]
pub const unsafe fn foo2_gated_unsafe() -> u32 { 42 }

// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const fn bar2_gated() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const unsafe fn bar2_gated() -> u32 { 42 }
pub const fn bar2_gated() -> u32 { 42 }

// @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 }
// @has 'foo/fn.bar2_gated_unsafe.html' '//pre' 'pub const unsafe fn bar2_gated_unsafe() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const unsafe fn bar2_gated_unsafe() -> u32 { 42 }

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

// @has 'foo/fn.bar_not_gated_unsafe.html' '//pre' 'pub const unsafe fn bar_not_gated_unsafe() -> u32'
pub const unsafe fn bar_not_gated_unsafe() -> u32 { 42 }

pub struct Foo;

Expand All @@ -45,9 +74,21 @@ impl Foo {
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const fn gated() -> u32 { 42 }

// @has 'foo/struct.Foo.html' '//div[@id="method.gated_unsafe"]/code' 'pub unsafe fn gated_unsafe() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn gated_unsafe() -> u32 { 42 }

// @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl"]/code' 'pub const fn stable_impl() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.2.0")]
pub const fn stable_impl() -> u32 { 42 }

// @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl_unsafe"]/code' 'pub const unsafe fn stable_impl_unsafe() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.2.0")]
pub const unsafe fn stable_impl_unsafe() -> u32 { 42 }
}