mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
fix rustdoc tests
This commit is contained in:
parent
a3b5f1ad85
commit
7446012c1e
@ -960,7 +960,7 @@ marker_impls! {
|
||||
#[lang = "destruct"]
|
||||
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
|
||||
#[rustc_deny_explicit_impl(implement_via_object = false)]
|
||||
// FIXME(effects) #[const_trait]
|
||||
#[const_trait]
|
||||
pub trait Destruct {}
|
||||
|
||||
/// A marker for tuple types.
|
||||
|
@ -5,6 +5,8 @@
|
||||
// To future blessers: make sure that `const_trait_impl` is
|
||||
// stabilized when changing `@!has` to `@has`, and please do
|
||||
// not remove this test.
|
||||
//
|
||||
// FIXME(effects) add `const_trait` to `Fn` so we use `~const`
|
||||
#![feature(const_trait_impl)]
|
||||
#![crate_name = "foo"]
|
||||
|
||||
@ -22,9 +24,9 @@ pub trait Tr<T> {
|
||||
// @has - '//section[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn'
|
||||
// @!has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const'
|
||||
// @has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Fn'
|
||||
fn a<A: ~const Fn() + ~const Destruct>()
|
||||
fn a<A: /* ~const */ Fn() + ~const Destruct>()
|
||||
where
|
||||
Option<A>: ~const Fn() + ~const Destruct,
|
||||
Option<A>: /* ~const */ Fn() + ~const Destruct,
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -34,13 +36,13 @@ pub trait Tr<T> {
|
||||
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Fn'
|
||||
// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const'
|
||||
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where fmt-newline"]' ': Fn'
|
||||
impl<T: ~const Fn() + ~const Destruct> const Tr<T> for T
|
||||
impl<T: /* ~const */ Fn() + ~const Destruct> const Tr<T> for T
|
||||
where
|
||||
Option<T>: ~const Fn() + ~const Destruct,
|
||||
Option<T>: /* ~const */ Fn() + ~const Destruct,
|
||||
{
|
||||
fn a<A: ~const Fn() + ~const Destruct>()
|
||||
fn a<A: /* ~const */ Fn() + ~const Destruct>()
|
||||
where
|
||||
Option<A>: ~const Fn() + ~const Destruct,
|
||||
Option<A>: /* ~const */ Fn() + ~const Destruct,
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -49,9 +51,9 @@ where
|
||||
// @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn'
|
||||
// @!has - '//pre[@class="rust item-decl"]/code/span[@class="where fmt-newline"]' '~const'
|
||||
// @has - '//pre[@class="rust item-decl"]/code/span[@class="where fmt-newline"]' ': Fn'
|
||||
pub const fn foo<F: ~const Fn() + ~const Destruct>()
|
||||
pub const fn foo<F: /* ~const */ Fn() + ~const Destruct>()
|
||||
where
|
||||
Option<F>: ~const Fn() + ~const Destruct,
|
||||
Option<F>: /* ~const */ Fn() + ~const Destruct,
|
||||
{
|
||||
F::a()
|
||||
}
|
||||
@ -61,9 +63,9 @@ impl<T> S<T> {
|
||||
// @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn'
|
||||
// @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const'
|
||||
// @has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Fn'
|
||||
pub const fn foo<B, C: ~const Fn() + ~const Destruct>()
|
||||
pub const fn foo<B, C: /* ~const */ Fn() + ~const Destruct>()
|
||||
where
|
||||
B: ~const Fn() + ~const Destruct,
|
||||
B: /* ~const */ Fn() + ~const Destruct,
|
||||
{
|
||||
B::a()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user