mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
Update tests/rustdoc
to new test syntax
This commit is contained in:
parent
d3ec92e16e
commit
1b67035579
@ -7,11 +7,11 @@
|
||||
|
||||
extern crate alias_reexport2;
|
||||
|
||||
// @has 'foo/reexport/fn.foo.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
|
||||
// @has 'foo/reexport/fn.foo2.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
// @has 'foo/reexport/type.Reexported.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;'
|
||||
//@ has 'foo/reexport/fn.foo.html'
|
||||
//@ has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
|
||||
//@ has 'foo/reexport/fn.foo2.html'
|
||||
//@ has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
//@ has 'foo/reexport/type.Reexported.html'
|
||||
//@ has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;'
|
||||
#[doc(inline)]
|
||||
pub use alias_reexport2 as reexport;
|
||||
|
@ -9,9 +9,9 @@ extern crate alias_reexport;
|
||||
|
||||
use alias_reexport::Reexported;
|
||||
|
||||
// @has 'foo/fn.foo.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
|
||||
//@ has 'foo/fn.foo.html'
|
||||
//@ has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
|
||||
pub fn foo() -> Reexported { 0 }
|
||||
// @has 'foo/fn.foo2.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
//@ has 'foo/fn.foo2.html'
|
||||
//@ has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
|
||||
|
@ -1,11 +1,11 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/all.html '//a[@href="struct.Struct.html"]' 'Struct'
|
||||
// @has foo/all.html '//a[@href="enum.Enum.html"]' 'Enum'
|
||||
// @has foo/all.html '//a[@href="union.Union.html"]' 'Union'
|
||||
// @has foo/all.html '//a[@href="constant.CONST.html"]' 'CONST'
|
||||
// @has foo/all.html '//a[@href="static.STATIC.html"]' 'STATIC'
|
||||
// @has foo/all.html '//a[@href="fn.function.html"]' 'function'
|
||||
//@ has foo/all.html '//a[@href="struct.Struct.html"]' 'Struct'
|
||||
//@ has foo/all.html '//a[@href="enum.Enum.html"]' 'Enum'
|
||||
//@ has foo/all.html '//a[@href="union.Union.html"]' 'Union'
|
||||
//@ has foo/all.html '//a[@href="constant.CONST.html"]' 'CONST'
|
||||
//@ has foo/all.html '//a[@href="static.STATIC.html"]' 'STATIC'
|
||||
//@ has foo/all.html '//a[@href="fn.function.html"]' 'function'
|
||||
|
||||
pub struct Struct;
|
||||
pub enum Enum {
|
||||
@ -23,6 +23,6 @@ mod private_module {
|
||||
pub struct ReexportedStruct;
|
||||
}
|
||||
|
||||
// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct'
|
||||
// @!hasraw foo/all.html 'private_module'
|
||||
//@ has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct'
|
||||
//@ !hasraw foo/all.html 'private_module'
|
||||
pub use private_module::ReexportedStruct;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// https://github.com/rust-lang/rust/issues/25001
|
||||
#![crate_name="issue_25001"]
|
||||
|
||||
// @has issue_25001/struct.Foo.html
|
||||
//@ has issue_25001/struct.Foo.html
|
||||
pub struct Foo<T>(T);
|
||||
|
||||
pub trait Bar {
|
||||
@ -11,36 +11,36 @@ pub trait Bar {
|
||||
}
|
||||
|
||||
impl Foo<u8> {
|
||||
// @has - '//*[@id="method.pass"]//h4[@class="code-header"]' 'fn pass()'
|
||||
//@ has - '//*[@id="method.pass"]//h4[@class="code-header"]' 'fn pass()'
|
||||
pub fn pass() {}
|
||||
}
|
||||
impl Foo<u16> {
|
||||
// @has - '//*[@id="method.pass-1"]//h4[@class="code-header"]' 'fn pass() -> usize'
|
||||
//@ has - '//*[@id="method.pass-1"]//h4[@class="code-header"]' 'fn pass() -> usize'
|
||||
pub fn pass() -> usize { 42 }
|
||||
}
|
||||
impl Foo<u32> {
|
||||
// @has - '//*[@id="method.pass-2"]//h4[@class="code-header"]' 'fn pass() -> isize'
|
||||
//@ has - '//*[@id="method.pass-2"]//h4[@class="code-header"]' 'fn pass() -> isize'
|
||||
pub fn pass() -> isize { 42 }
|
||||
}
|
||||
|
||||
impl<T> Bar for Foo<T> {
|
||||
// @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' 'type Item = T'
|
||||
//@ has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' 'type Item = T'
|
||||
type Item=T;
|
||||
|
||||
// @has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)'
|
||||
//@ has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)'
|
||||
fn quux(self) {}
|
||||
}
|
||||
impl<'a, T> Bar for &'a Foo<T> {
|
||||
// @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item = &'a T"
|
||||
//@ has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item = &'a T"
|
||||
type Item=&'a T;
|
||||
|
||||
// @has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)'
|
||||
//@ has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)'
|
||||
fn quux(self) {}
|
||||
}
|
||||
impl<'a, T> Bar for &'a mut Foo<T> {
|
||||
// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item = &'a mut T"
|
||||
//@ has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item = &'a mut T"
|
||||
type Item=&'a mut T;
|
||||
|
||||
// @has - '//*[@id="method.quux-2"]//h4[@class="code-header"]' 'fn quux(self)'
|
||||
//@ has - '//*[@id="method.quux-2"]//h4[@class="code-header"]' 'fn quux(self)'
|
||||
fn quux(self) {}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// @has issue_15169/struct.Foo.html '//*[@id="method.eq"]' 'fn eq'
|
||||
//@ has issue_15169/struct.Foo.html '//*[@id="method.eq"]' 'fn eq'
|
||||
|
||||
// https://github.com/rust-lang/rust/issues/15169
|
||||
#![crate_name="issue_15169"]
|
||||
|
@ -3,32 +3,32 @@
|
||||
|
||||
#![feature(associated_type_defaults)]
|
||||
|
||||
// @has issue_28478/trait.Bar.html
|
||||
//@ has issue_28478/trait.Bar.html
|
||||
pub trait Bar {
|
||||
// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()'
|
||||
// @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
|
||||
//@ has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()'
|
||||
//@ has - '//*[@href="#associatedtype.Bar"]' 'Bar'
|
||||
type Bar = ();
|
||||
// @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
|
||||
// @has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
|
||||
//@ has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
|
||||
//@ has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
|
||||
const Baz: usize = 7;
|
||||
// @has - '//*[@id="tymethod.bar"]' 'fn bar'
|
||||
//@ has - '//*[@id="tymethod.bar"]' 'fn bar'
|
||||
fn bar();
|
||||
// @has - '//*[@id="method.baz"]' 'fn baz'
|
||||
//@ has - '//*[@id="method.baz"]' 'fn baz'
|
||||
fn baz() { }
|
||||
}
|
||||
|
||||
// @has issue_28478/struct.Foo.html
|
||||
//@ has issue_28478/struct.Foo.html
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
// @has - '//*[@href="#method.foo"]' 'foo'
|
||||
//@ has - '//*[@href="#method.foo"]' 'foo'
|
||||
pub fn foo() {}
|
||||
}
|
||||
|
||||
impl Bar for Foo {
|
||||
// @has - '//*[@href="trait.Bar.html#associatedtype.Bar"]' 'Bar'
|
||||
// @has - '//*[@href="trait.Bar.html#associatedconstant.Baz"]' 'Baz'
|
||||
// @has - '//*[@href="trait.Bar.html#tymethod.bar"]' 'bar'
|
||||
//@ has - '//*[@href="trait.Bar.html#associatedtype.Bar"]' 'Bar'
|
||||
//@ has - '//*[@href="trait.Bar.html#associatedconstant.Baz"]' 'Baz'
|
||||
//@ has - '//*[@href="trait.Bar.html#tymethod.bar"]' 'bar'
|
||||
fn bar() {}
|
||||
// @has - '//*[@href="trait.Bar.html#method.baz"]' 'baz'
|
||||
//@ has - '//*[@href="trait.Bar.html#method.baz"]' 'baz'
|
||||
}
|
||||
|
@ -6,44 +6,44 @@
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
// @has 'foo/trait.Bar.html'
|
||||
//@ has 'foo/trait.Bar.html'
|
||||
pub trait Bar {
|
||||
// There should be no anchors here.
|
||||
// @snapshot no_type_anchor - '//*[@id="associatedtype.T"]'
|
||||
//@ snapshot no_type_anchor - '//*[@id="associatedtype.T"]'
|
||||
type T;
|
||||
// There should be no anchors here.
|
||||
// @snapshot no_const_anchor - '//*[@id="associatedconstant.YOLO"]'
|
||||
//@ snapshot no_const_anchor - '//*[@id="associatedconstant.YOLO"]'
|
||||
const YOLO: u32;
|
||||
|
||||
// There should be no anchors here.
|
||||
// @snapshot no_tymethod_anchor - '//*[@id="tymethod.foo"]'
|
||||
//@ snapshot no_tymethod_anchor - '//*[@id="tymethod.foo"]'
|
||||
fn foo();
|
||||
// There should be no anchors here.
|
||||
// @snapshot no_trait_method_anchor - '//*[@id="method.bar"]'
|
||||
//@ snapshot no_trait_method_anchor - '//*[@id="method.bar"]'
|
||||
fn bar() {}
|
||||
}
|
||||
|
||||
// @has 'foo/struct.Foo.html'
|
||||
//@ has 'foo/struct.Foo.html'
|
||||
impl Bar for Foo {
|
||||
// @has - '//*[@id="associatedtype.T"]/a[@class="anchor"]' ''
|
||||
//@ has - '//*[@id="associatedtype.T"]/a[@class="anchor"]' ''
|
||||
type T = u32;
|
||||
// @has - '//*[@id="associatedconstant.YOLO"]/a[@class="anchor"]' ''
|
||||
//@ has - '//*[@id="associatedconstant.YOLO"]/a[@class="anchor"]' ''
|
||||
const YOLO: u32 = 0;
|
||||
|
||||
// @has - '//*[@id="method.foo"]/a[@class="anchor"]' ''
|
||||
//@ has - '//*[@id="method.foo"]/a[@class="anchor"]' ''
|
||||
fn foo() {}
|
||||
// Same check for provided "bar" method.
|
||||
// @has - '//*[@id="method.bar"]/a[@class="anchor"]' ''
|
||||
//@ has - '//*[@id="method.bar"]/a[@class="anchor"]' ''
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
// @snapshot no_const_anchor2 - '//*[@id="associatedconstant.X"]'
|
||||
//@ snapshot no_const_anchor2 - '//*[@id="associatedconstant.X"]'
|
||||
// There should be no anchors here.
|
||||
pub const X: i32 = 0;
|
||||
// @snapshot no_type_anchor2 - '//*[@id="associatedtype.Y"]'
|
||||
//@ snapshot no_type_anchor2 - '//*[@id="associatedtype.Y"]'
|
||||
// There should be no anchors here.
|
||||
pub type Y = u32;
|
||||
// @snapshot no_method_anchor - '//*[@id="method.new"]'
|
||||
//@ snapshot no_method_anchor - '//*[@id="method.new"]'
|
||||
// There should be no anchors here.
|
||||
pub fn new() -> Self { Self }
|
||||
}
|
||||
|
@ -11,8 +11,8 @@ pub trait Stream {
|
||||
fn size_hint(&self) -> (usize, Option<usize>);
|
||||
}
|
||||
|
||||
// @has 'foo/trait.Stream.html'
|
||||
// @has - '//*[@class="code-header"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
|
||||
//@ has 'foo/trait.Stream.html'
|
||||
//@ has - '//*[@class="code-header"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
|
||||
impl<S: ?Sized + Stream + Unpin> Stream for &mut S {
|
||||
type Item = S::Item;
|
||||
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
// This test ensures we don't display anonymous (non-inline) re-exports of public items.
|
||||
|
||||
// @has 'foo/index.html'
|
||||
// @has - '//*[@id="main-content"]' ''
|
||||
//@ has 'foo/index.html'
|
||||
//@ has - '//*[@id="main-content"]' ''
|
||||
// We check that the only "h2" present are "Structs" (for "Bla") and "Re-exports".
|
||||
// @count - '//*[@id="main-content"]/h2' 2
|
||||
// @has - '//*[@id="main-content"]/h2' 'Structs'
|
||||
// @has - '//*[@id="main-content"]/h2' 'Re-exports'
|
||||
//@ count - '//*[@id="main-content"]/h2' 2
|
||||
//@ has - '//*[@id="main-content"]/h2' 'Structs'
|
||||
//@ has - '//*[@id="main-content"]/h2' 'Re-exports'
|
||||
// The 3 re-exports.
|
||||
// @count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3
|
||||
//@ count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3
|
||||
// The public struct.
|
||||
// @count - '//*[@id="main-content"]//a[@class="struct"]' 1
|
||||
//@ count - '//*[@id="main-content"]//a[@class="struct"]' 1
|
||||
|
||||
mod ext {
|
||||
pub trait Foo {}
|
||||
|
@ -3,26 +3,26 @@
|
||||
|
||||
pub struct MyBox<T: ?Sized>(*const T);
|
||||
|
||||
// @has 'foo/fn.alpha.html'
|
||||
// @snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code'
|
||||
//@ has 'foo/fn.alpha.html'
|
||||
//@ snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code'
|
||||
pub fn alpha() -> &'static [u32; 1] {
|
||||
loop {}
|
||||
}
|
||||
|
||||
// @has 'foo/fn.beta.html'
|
||||
// @snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code'
|
||||
//@ has 'foo/fn.beta.html'
|
||||
//@ snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code'
|
||||
pub fn beta<T>() -> &'static [T; 1] {
|
||||
loop {}
|
||||
}
|
||||
|
||||
// @has 'foo/fn.gamma.html'
|
||||
// @snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code'
|
||||
//@ has 'foo/fn.gamma.html'
|
||||
//@ snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code'
|
||||
pub fn gamma() -> MyBox<[u32; 1]> {
|
||||
loop {}
|
||||
}
|
||||
|
||||
// @has 'foo/fn.delta.html'
|
||||
// @snapshot link_box_generic - '//pre[@class="rust item-decl"]/code'
|
||||
//@ has 'foo/fn.delta.html'
|
||||
//@ snapshot link_box_generic - '//pre[@class="rust item-decl"]/code'
|
||||
pub fn delta<T>() -> MyBox<[T; 1]> {
|
||||
loop {}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use std::arch::asm;
|
||||
|
||||
// @has asm_foreign/fn.aarch64.html
|
||||
//@ has asm_foreign/fn.aarch64.html
|
||||
pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
|
||||
let c;
|
||||
asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") {
|
||||
@ -12,7 +12,7 @@ pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
|
||||
c
|
||||
}
|
||||
|
||||
// @has asm_foreign/fn.x86.html
|
||||
//@ has asm_foreign/fn.x86.html
|
||||
pub unsafe fn x86(a: f64, b: f64) -> f64 {
|
||||
let c;
|
||||
asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b);
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
use std::arch::asm;
|
||||
|
||||
// @has asm_foreign2/fn.x86.html
|
||||
//@ has asm_foreign2/fn.x86.html
|
||||
pub unsafe fn x86(x: i64) -> i64 {
|
||||
let y;
|
||||
asm!("movq {}, {}", in(reg) x, out(reg) y, options(att_syntax));
|
||||
|
@ -4,14 +4,14 @@
|
||||
use std::convert::AsRef;
|
||||
pub struct Local;
|
||||
|
||||
// @has foo/struct.Local.html '//h3[@class="code-header"]' 'impl AsRef<str> for Local'
|
||||
//@ has foo/struct.Local.html '//h3[@class="code-header"]' 'impl AsRef<str> for Local'
|
||||
impl AsRef<str> for Local {
|
||||
fn as_ref(&self) -> &str {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
// @has - '//h3[@class="code-header"]' 'impl AsRef<Local> for str'
|
||||
//@ has - '//h3[@class="code-header"]' 'impl AsRef<Local> for str'
|
||||
impl AsRef<Local> for str {
|
||||
fn as_ref(&self) -> &Local {
|
||||
todo!()
|
||||
|
@ -8,7 +8,7 @@
|
||||
pub struct SomeStruct;
|
||||
|
||||
impl SomeStruct {
|
||||
// @has 'foo/struct.SomeStruct.html' \
|
||||
//@ has 'foo/struct.SomeStruct.html' \
|
||||
// '//*[@id="associatedconstant.SOME_CONST"]//span[@class="since"]' '1.1.2'
|
||||
#[stable(since="1.1.2", feature="rust2")]
|
||||
pub const SOME_CONST: usize = 0;
|
||||
|
@ -1,11 +1,11 @@
|
||||
pub trait Foo {
|
||||
// @has assoc_consts/trait.Foo.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has assoc_consts/trait.Foo.html '//pre[@class="rust item-decl"]' \
|
||||
// 'const FOO: usize = 13usize;'
|
||||
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
|
||||
//@ has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
|
||||
const FOO: usize = 12 + 1;
|
||||
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
|
||||
//@ has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
|
||||
const FOO_NO_DEFAULT: bool;
|
||||
// @!hasraw - FOO_HIDDEN
|
||||
//@ !hasraw - FOO_HIDDEN
|
||||
#[doc(hidden)]
|
||||
const FOO_HIDDEN: u8 = 0;
|
||||
}
|
||||
@ -13,22 +13,22 @@ pub trait Foo {
|
||||
pub struct Bar;
|
||||
|
||||
impl Foo for Bar {
|
||||
// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar'
|
||||
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
|
||||
//@ has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar'
|
||||
//@ has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
|
||||
const FOO: usize = 12;
|
||||
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
|
||||
//@ has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
|
||||
const FOO_NO_DEFAULT: bool = false;
|
||||
// @!hasraw - FOO_HIDDEN
|
||||
//@ !hasraw - FOO_HIDDEN
|
||||
#[doc(hidden)]
|
||||
const FOO_HIDDEN: u8 = 0;
|
||||
}
|
||||
|
||||
impl Bar {
|
||||
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
|
||||
//@ has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
|
||||
// 'const BAR: usize'
|
||||
pub const BAR: usize = 3;
|
||||
|
||||
// @has - '//*[@id="associatedconstant.BAR_ESCAPED"]' \
|
||||
//@ has - '//*[@id="associatedconstant.BAR_ESCAPED"]' \
|
||||
// "const BAR_ESCAPED: &'static str = \"<em>markup</em>\""
|
||||
pub const BAR_ESCAPED: &'static str = "<em>markup</em>";
|
||||
}
|
||||
@ -36,7 +36,7 @@ impl Bar {
|
||||
pub struct Baz<'a, U: 'a, T>(T, &'a [U]);
|
||||
|
||||
impl Bar {
|
||||
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \
|
||||
//@ has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \
|
||||
// "const BAZ: Baz<'static, u8, u32>"
|
||||
pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]);
|
||||
}
|
||||
@ -44,60 +44,60 @@ impl Bar {
|
||||
pub fn f(_: &(ToString + 'static)) {}
|
||||
|
||||
impl Bar {
|
||||
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
|
||||
//@ has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
|
||||
// "const F: fn(_: &(dyn ToString + 'static))"
|
||||
pub const F: fn(_: &(ToString + 'static)) = f;
|
||||
}
|
||||
|
||||
impl Bar {
|
||||
// @!hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE'
|
||||
//@ !hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE'
|
||||
const BAR_PRIVATE: char = 'a';
|
||||
// @!hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN'
|
||||
//@ !hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN'
|
||||
#[doc(hidden)]
|
||||
pub const BAR_HIDDEN: &'static str = "a";
|
||||
}
|
||||
|
||||
// @has assoc_consts/trait.Qux.html
|
||||
//@ has assoc_consts/trait.Qux.html
|
||||
pub trait Qux {
|
||||
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
|
||||
/// Docs for QUX0 in trait.
|
||||
const QUX0: u8;
|
||||
// @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX1 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX1 in trait."
|
||||
/// Docs for QUX1 in trait.
|
||||
const QUX1: i8;
|
||||
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
|
||||
/// Docs for QUX_DEFAULT12 in trait.
|
||||
const QUX_DEFAULT0: u16 = 1;
|
||||
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait."
|
||||
/// Docs for QUX_DEFAULT1 in trait.
|
||||
const QUX_DEFAULT1: i16 = 2;
|
||||
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
|
||||
/// Docs for QUX_DEFAULT2 in trait.
|
||||
const QUX_DEFAULT2: u32 = 3;
|
||||
}
|
||||
|
||||
// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar'
|
||||
//@ has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar'
|
||||
impl Qux for Bar {
|
||||
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
|
||||
/// Docs for QUX0 in trait.
|
||||
const QUX0: u8 = 4;
|
||||
// @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX1 in impl."
|
||||
//@ has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX1 in impl."
|
||||
/// Docs for QUX1 in impl.
|
||||
const QUX1: i8 = 5;
|
||||
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
|
||||
// @has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
|
||||
//@ has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
|
||||
const QUX_DEFAULT0: u16 = 6;
|
||||
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
|
||||
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl."
|
||||
//@ has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
|
||||
//@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl."
|
||||
/// Docs for QUX_DEFAULT1 in impl.
|
||||
const QUX_DEFAULT1: i16 = 7;
|
||||
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
|
||||
// @has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
|
||||
//@ has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
|
||||
//@ has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
|
||||
}
|
||||
|
@ -9,6 +9,6 @@ pub trait AsExpression<T> {
|
||||
fn as_expression(self) -> Self::Expression;
|
||||
}
|
||||
|
||||
// @has foo/type.AsExprOf.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'type AsExprOf<Item, Type> = <Item as AsExpression<Type>>::Expression;'
|
||||
//@ has foo/type.AsExprOf.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'type AsExprOf<Item, Type> = <Item as AsExpression<Type>>::Expression;'
|
||||
pub type AsExprOf<Item, Type> = <Item as AsExpression<Type>>::Expression;
|
||||
|
@ -7,22 +7,22 @@
|
||||
|
||||
extern crate issue_20646;
|
||||
|
||||
// @has issue_20646/trait.Trait.html \
|
||||
//@ has issue_20646/trait.Trait.html \
|
||||
// '//*[@id="associatedtype.Output"]' \
|
||||
// 'type Output'
|
||||
pub trait Trait {
|
||||
type Output;
|
||||
}
|
||||
|
||||
// @has issue_20646/fn.fun.html \
|
||||
//@ has issue_20646/fn.fun.html \
|
||||
// '//pre[@class="rust item-decl"]' 'where T: Trait<Output = i32>'
|
||||
pub fn fun<T>(_: T) where T: Trait<Output=i32> {}
|
||||
|
||||
pub mod reexport {
|
||||
// @has issue_20646/reexport/trait.Trait.html \
|
||||
//@ has issue_20646/reexport/trait.Trait.html \
|
||||
// '//*[@id="associatedtype.Output"]' \
|
||||
// 'type Output'
|
||||
// @has issue_20646/reexport/fn.fun.html \
|
||||
//@ has issue_20646/reexport/fn.fun.html \
|
||||
// '//pre[@class="rust item-decl"]' 'where T: Trait<Output = i32>'
|
||||
pub use issue_20646::{Trait, fun};
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
#![crate_type="lib"]
|
||||
|
||||
// @has assoc_types/trait.Index.html
|
||||
//@ has assoc_types/trait.Index.html
|
||||
pub trait Index<I: ?Sized> {
|
||||
// @has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized'
|
||||
//@ has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized'
|
||||
type Output: ?Sized;
|
||||
// @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]' \
|
||||
//@ has - '//*[@id="tymethod.index"]//h4[@class="code-header"]' \
|
||||
// "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
|
||||
// @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]//a[@href="trait.Index.html#associatedtype.Output"]' \
|
||||
//@ has - '//*[@id="tymethod.index"]//h4[@class="code-header"]//a[@href="trait.Index.html#associatedtype.Output"]' \
|
||||
// "Output"
|
||||
fn index<'a>(&'a self, index: I) -> &'a Self::Output;
|
||||
}
|
||||
|
||||
// @has assoc_types/fn.use_output.html
|
||||
// @has - '//pre[@class="rust item-decl"]' '-> &T::Output'
|
||||
// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output'
|
||||
//@ has assoc_types/fn.use_output.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' '-> &T::Output'
|
||||
//@ has - '//pre[@class="rust item-decl"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output'
|
||||
pub fn use_output<T: Index<usize>>(obj: &T, index: usize) -> &T::Output {
|
||||
obj.index(index)
|
||||
}
|
||||
@ -22,14 +22,14 @@ pub trait Feed {
|
||||
type Input;
|
||||
}
|
||||
|
||||
// @has assoc_types/fn.use_input.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'T::Input'
|
||||
// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
|
||||
//@ has assoc_types/fn.use_input.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'T::Input'
|
||||
//@ has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
|
||||
pub fn use_input<T: Feed>(_feed: &T, _element: T::Input) { }
|
||||
|
||||
// @has assoc_types/fn.cmp_input.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'where T::Input: PartialEq<U::Input>'
|
||||
// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
|
||||
//@ has assoc_types/fn.cmp_input.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'where T::Input: PartialEq<U::Input>'
|
||||
//@ has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
|
||||
pub fn cmp_input<T: Feed, U: Feed>(a: &T::Input, b: &U::Input) -> bool
|
||||
where T::Input: PartialEq<U::Input>
|
||||
{
|
||||
|
@ -8,9 +8,9 @@ pub trait Trait {
|
||||
|
||||
pub struct Bar;
|
||||
|
||||
// @has 'foo/struct.Bar.html'
|
||||
// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
// @!has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
//@ has 'foo/struct.Bar.html'
|
||||
//@ !has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
//@ !has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
impl Trait for Bar {
|
||||
const FOO: u32 = 1;
|
||||
|
||||
@ -21,9 +21,9 @@ pub enum Foo {
|
||||
A,
|
||||
}
|
||||
|
||||
// @has 'foo/enum.Foo.html'
|
||||
// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
// @!has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
//@ has 'foo/enum.Foo.html'
|
||||
//@ !has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
//@ !has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
impl Trait for Foo {
|
||||
const FOO: u32 = 1;
|
||||
|
||||
@ -32,9 +32,9 @@ impl Trait for Foo {
|
||||
|
||||
pub struct Baz;
|
||||
|
||||
// @has 'foo/struct.Baz.html'
|
||||
// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
// @has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
//@ has 'foo/struct.Baz.html'
|
||||
//@ has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
//@ has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
impl Baz {
|
||||
pub const FOO: u32 = 42;
|
||||
}
|
||||
@ -43,9 +43,9 @@ pub enum Quux {
|
||||
B,
|
||||
}
|
||||
|
||||
// @has 'foo/enum.Quux.html'
|
||||
// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
// @has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
//@ has 'foo/enum.Quux.html'
|
||||
//@ has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
|
||||
//@ has - '//div[@class="sidebar-elems"]//a' 'FOO'
|
||||
impl Quux {
|
||||
pub const FOO: u32 = 42;
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
// that comes from an async fn desugaring.
|
||||
|
||||
// Check that we don't document an unnamed opaque type
|
||||
// @!has async_fn_opaque_item/opaque..html
|
||||
//@ !has async_fn_opaque_item/opaque..html
|
||||
|
||||
// Checking there is only a "Functions" header and no "Opaque types".
|
||||
// @has async_fn_opaque_item/index.html
|
||||
// @count - '//*[@class="section-header"]' 1
|
||||
// @has - '//*[@class="section-header"]' 'Functions'
|
||||
//@ has async_fn_opaque_item/index.html
|
||||
//@ count - '//*[@class="section-header"]' 1
|
||||
//@ has - '//*[@class="section-header"]' 'Functions'
|
||||
|
||||
pub async fn test() {}
|
||||
|
@ -1,43 +1,43 @@
|
||||
//@ edition:2018
|
||||
// @has async_fn/fn.foo.html '//pre[@class="rust item-decl"]' 'pub async fn foo() -> Option<Foo>'
|
||||
//@ has async_fn/fn.foo.html '//pre[@class="rust item-decl"]' 'pub async fn foo() -> Option<Foo>'
|
||||
pub async fn foo() -> Option<Foo> {
|
||||
None
|
||||
}
|
||||
|
||||
// @has async_fn/fn.bar.html '//pre[@class="rust item-decl"]' 'pub async fn bar(a: i32, b: i32) -> i32'
|
||||
//@ has async_fn/fn.bar.html '//pre[@class="rust item-decl"]' 'pub async fn bar(a: i32, b: i32) -> i32'
|
||||
pub async fn bar(a: i32, b: i32) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
// @has async_fn/fn.baz.html '//pre[@class="rust item-decl"]' 'pub async fn baz<T>(a: T) -> T'
|
||||
//@ has async_fn/fn.baz.html '//pre[@class="rust item-decl"]' 'pub async fn baz<T>(a: T) -> T'
|
||||
pub async fn baz<T>(a: T) -> T {
|
||||
a
|
||||
}
|
||||
|
||||
// @has async_fn/fn.qux.html '//pre[@class="rust item-decl"]' 'pub async unsafe fn qux() -> char'
|
||||
//@ has async_fn/fn.qux.html '//pre[@class="rust item-decl"]' 'pub async unsafe fn qux() -> char'
|
||||
pub async unsafe fn qux() -> char {
|
||||
'⚠'
|
||||
}
|
||||
|
||||
// @has async_fn/fn.mut_args.html '//pre[@class="rust item-decl"]' 'pub async fn mut_args(a: usize)'
|
||||
//@ has async_fn/fn.mut_args.html '//pre[@class="rust item-decl"]' 'pub async fn mut_args(a: usize)'
|
||||
pub async fn mut_args(mut a: usize) {}
|
||||
|
||||
// @has async_fn/fn.mut_ref.html '//pre[@class="rust item-decl"]' 'pub async fn mut_ref(x: i32)'
|
||||
//@ has async_fn/fn.mut_ref.html '//pre[@class="rust item-decl"]' 'pub async fn mut_ref(x: i32)'
|
||||
pub async fn mut_ref(ref mut x: i32) {}
|
||||
|
||||
trait Bar {}
|
||||
|
||||
impl Bar for () {}
|
||||
|
||||
// @has async_fn/fn.quux.html '//pre[@class="rust item-decl"]' 'pub async fn quux() -> impl Bar'
|
||||
//@ has async_fn/fn.quux.html '//pre[@class="rust item-decl"]' 'pub async fn quux() -> impl Bar'
|
||||
pub async fn quux() -> impl Bar {
|
||||
()
|
||||
}
|
||||
|
||||
// @has async_fn/struct.Foo.html
|
||||
// @matches - '//h4[@class="code-header"]' 'pub async fn f\(\)$'
|
||||
// @matches - '//h4[@class="code-header"]' 'pub async unsafe fn g\(\)$'
|
||||
// @matches - '//h4[@class="code-header"]' 'pub async fn mut_self\(self, first: usize\)$'
|
||||
//@ has async_fn/struct.Foo.html
|
||||
//@ matches - '//h4[@class="code-header"]' 'pub async fn f\(\)$'
|
||||
//@ matches - '//h4[@class="code-header"]' 'pub async unsafe fn g\(\)$'
|
||||
//@ matches - '//h4[@class="code-header"]' 'pub async fn mut_self\(self, first: usize\)$'
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
@ -51,49 +51,49 @@ pub trait Pattern<'a> {}
|
||||
impl Pattern<'_> for () {}
|
||||
|
||||
pub trait Trait<const N: usize> {}
|
||||
// @has async_fn/fn.const_generics.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics<const N: usize>(_: impl Trait<N>)'
|
||||
//@ has async_fn/fn.const_generics.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics<const N: usize>(_: impl Trait<N>)'
|
||||
pub async fn const_generics<const N: usize>(_: impl Trait<N>) {}
|
||||
|
||||
// test that elided lifetimes are properly elided and not displayed as `'_`
|
||||
// regression test for #63037
|
||||
// @has async_fn/fn.elided.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str'
|
||||
//@ has async_fn/fn.elided.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str'
|
||||
pub async fn elided(foo: &str) -> &str { "" }
|
||||
// This should really be shown as written, but for implementation reasons it's difficult.
|
||||
// See `impl Clean for TyKind::Ref`.
|
||||
// @has async_fn/fn.user_elided.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str'
|
||||
//@ has async_fn/fn.user_elided.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str'
|
||||
pub async fn user_elided(foo: &'_ str) -> &str { "" }
|
||||
// @has async_fn/fn.static_trait.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box<dyn Bar>'
|
||||
//@ has async_fn/fn.static_trait.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box<dyn Bar>'
|
||||
pub async fn static_trait(foo: &str) -> Box<dyn Bar> { Box::new(()) }
|
||||
// @has async_fn/fn.lifetime_for_trait.html
|
||||
// @has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_>"
|
||||
//@ has async_fn/fn.lifetime_for_trait.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_>"
|
||||
pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_> { Box::new(()) }
|
||||
// @has async_fn/fn.elided_in_input_trait.html
|
||||
// @has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
|
||||
//@ has async_fn/fn.elided_in_input_trait.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
|
||||
pub async fn elided_in_input_trait(t: impl Pattern<'_>) {}
|
||||
|
||||
struct AsyncFdReadyGuard<'a, T> { x: &'a T }
|
||||
|
||||
impl Foo {
|
||||
// @has async_fn/struct.Foo.html
|
||||
// @has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar, ) -> impl Iterator<Item = &usize>'
|
||||
//@ has async_fn/struct.Foo.html
|
||||
//@ has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar, ) -> impl Iterator<Item = &usize>'
|
||||
pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> {
|
||||
[0].iter()
|
||||
}
|
||||
// taken from `tokio` as an example of a method that was particularly bad before
|
||||
// @has - '//*[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
|
||||
//@ has - '//*[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
|
||||
pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()> { Err(()) }
|
||||
// @has - '//*[@class="method"]' "pub async fn mut_self(&mut self)"
|
||||
//@ has - '//*[@class="method"]' "pub async fn mut_self(&mut self)"
|
||||
pub async fn mut_self(&mut self) {}
|
||||
}
|
||||
|
||||
// test named lifetimes, just in case
|
||||
// @has async_fn/fn.named.html
|
||||
// @has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
|
||||
//@ has async_fn/fn.named.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
|
||||
pub async fn named<'a, 'b>(foo: &'a str) -> &'b str { "" }
|
||||
// @has async_fn/fn.named_trait.html
|
||||
// @has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
|
||||
//@ has async_fn/fn.named_trait.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
|
||||
pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {}
|
||||
|
@ -3,10 +3,10 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub trait Foo {
|
||||
// @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn bar() -> i32"
|
||||
//@ has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn bar() -> i32"
|
||||
async fn bar() -> i32;
|
||||
|
||||
// @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn baz() -> i32"
|
||||
//@ has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn baz() -> i32"
|
||||
async fn baz() -> i32 {
|
||||
1
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ extern crate async_trait_dep;
|
||||
|
||||
pub struct Oink {}
|
||||
|
||||
// @has 'async_trait/struct.Oink.html' '//h4[@class="code-header"]' "async fn woof()"
|
||||
//@ has 'async_trait/struct.Oink.html' '//h4[@class="code-header"]' "async fn woof()"
|
||||
impl async_trait_dep::Meow for Oink {
|
||||
async fn woof() {
|
||||
todo!()
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'foo/fn.f.html'
|
||||
// @has - //*[@'class="rust item-decl"]' '#[export_name = "f"] pub fn f()'
|
||||
//@ has 'foo/fn.f.html'
|
||||
//@ has - //*[@'class="rust item-decl"]' '#[export_name = "f"] pub fn f()'
|
||||
#[export_name = "\
|
||||
f"]
|
||||
pub fn f() {}
|
||||
|
@ -1,13 +1,13 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[no_mangle]'
|
||||
//@ has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[no_mangle]'
|
||||
#[no_mangle]
|
||||
pub extern "C" fn f() {}
|
||||
|
||||
// @has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[export_name = "bar"]'
|
||||
//@ has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[export_name = "bar"]'
|
||||
#[export_name = "bar"]
|
||||
pub extern "C" fn g() {}
|
||||
|
||||
// @has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]'
|
||||
//@ has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]'
|
||||
#[repr(C, align(8))]
|
||||
pub struct Repr;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
pub use std::fs::File;
|
||||
|
||||
// @has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation'
|
||||
//@ has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation'
|
||||
#[rustc_doc_primitive = "i16"]
|
||||
/// I love poneys!
|
||||
mod prim {}
|
||||
|
@ -16,11 +16,11 @@ where
|
||||
type Item2 = C;
|
||||
}
|
||||
|
||||
// @has foo/struct.Switch.html
|
||||
// @has - '//h3[@class="code-header"]' 'impl<B> Send for Switch<B>where <B as Signal>::Item: Send'
|
||||
// @has - '//h3[@class="code-header"]' 'impl<B> Sync for Switch<B>where <B as Signal>::Item: Sync'
|
||||
// @count - '//*[@id="implementations-list"]//*[@class="impl"]' 0
|
||||
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 6
|
||||
//@ has foo/struct.Switch.html
|
||||
//@ has - '//h3[@class="code-header"]' 'impl<B> Send for Switch<B>where <B as Signal>::Item: Send'
|
||||
//@ has - '//h3[@class="code-header"]' 'impl<B> Sync for Switch<B>where <B as Signal>::Item: Sync'
|
||||
//@ count - '//*[@id="implementations-list"]//*[@class="impl"]' 0
|
||||
//@ count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 6
|
||||
pub struct Switch<B: Signal> {
|
||||
pub inner: <B as Signal2>::Item2,
|
||||
}
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
pub trait ScopeHandle<'scope> {}
|
||||
|
||||
// @has foo/struct.ScopeFutureContents.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has foo/struct.ScopeFutureContents.html
|
||||
//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl<'scope, S> Send for ScopeFutureContents<'scope, S>where S: Sync"
|
||||
//
|
||||
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl<'scope, S> Sync for ScopeFutureContents<'scope, S>where S: Sync"
|
||||
pub struct ScopeFutureContents<'scope, S>
|
||||
where S: ScopeHandle<'scope>,
|
||||
|
@ -9,8 +9,8 @@ pub mod traits {
|
||||
}
|
||||
}
|
||||
|
||||
// @has foo/struct.Owned.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has foo/struct.Owned.html
|
||||
//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl<T> Send for Owned<T>where <T as Owned<'static>>::Reader: Send"
|
||||
pub struct Owned<T> where T: for<'a> ::traits::Owned<'a> {
|
||||
marker: PhantomData<<T as ::traits::Owned<'static>>::Reader>,
|
||||
|
@ -3,19 +3,19 @@
|
||||
|
||||
#![feature(negative_impls)]
|
||||
|
||||
// @has foo/struct.A.html
|
||||
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has foo/struct.A.html
|
||||
//@ has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl !Send for A"
|
||||
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl !Sync for A"
|
||||
pub struct A();
|
||||
|
||||
impl !Send for A {}
|
||||
impl !Sync for A {}
|
||||
|
||||
// @has foo/struct.B.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has foo/struct.B.html
|
||||
//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl<T> !Send for B<T>"
|
||||
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl<T> !Sync for B<T>"
|
||||
pub struct B<T: ?Sized>(A, Box<T>);
|
||||
|
@ -1,8 +1,8 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'foo/struct.Foo.html'
|
||||
// @has - '//*[@id="impl-Send-for-Foo"]' 'impl !Send for Foo'
|
||||
// @has - '//*[@id="impl-Sync-for-Foo"]' 'impl !Sync for Foo'
|
||||
//@ has 'foo/struct.Foo.html'
|
||||
//@ has - '//*[@id="impl-Send-for-Foo"]' 'impl !Send for Foo'
|
||||
//@ has - '//*[@id="impl-Sync-for-Foo"]' 'impl !Sync for Foo'
|
||||
pub struct Foo(*const i8);
|
||||
pub trait Whatever: Send {}
|
||||
impl<T: Send + ?Sized> Whatever for T {}
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
extern crate auto_traits;
|
||||
|
||||
// @has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo'
|
||||
//@ has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo'
|
||||
pub unsafe auto trait Foo {}
|
||||
|
||||
// @has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar'
|
||||
//@ has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar'
|
||||
pub use auto_traits::Bar;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![feature(auto_traits)]
|
||||
|
||||
// @has auto_aliases/trait.Bar.html '//*[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
|
||||
//@ has auto_aliases/trait.Bar.html '//*[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
|
||||
pub struct Foo;
|
||||
|
||||
pub auto trait Bar {}
|
||||
|
@ -4,9 +4,9 @@ extern crate alias_reexport;
|
||||
|
||||
pub use alias_reexport::Reexported;
|
||||
|
||||
// @has 'foo/fn.foo.html'
|
||||
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported'
|
||||
//@ has 'foo/fn.foo.html'
|
||||
//@ has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported'
|
||||
pub fn foo() -> Reexported { 0 }
|
||||
// @has 'foo/fn.foo2.html'
|
||||
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
//@ has 'foo/fn.foo2.html'
|
||||
//@ has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![crate_type="lib"]
|
||||
|
||||
extern "C" {
|
||||
// @has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
|
||||
//@ has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
|
||||
pub fn foreigner(cold_as_ice: u32);
|
||||
}
|
||||
|
@ -1,43 +1,43 @@
|
||||
#![allow(rustdoc::invalid_rust_codeblocks)]
|
||||
|
||||
// @has bad_codeblock_syntax/fn.foo.html
|
||||
// @has - '//*[@class="docblock"]' '\_'
|
||||
//@ has bad_codeblock_syntax/fn.foo.html
|
||||
//@ has - '//*[@class="docblock"]' '\_'
|
||||
/// ```
|
||||
/// \_
|
||||
/// ```
|
||||
pub fn foo() {}
|
||||
|
||||
// @has bad_codeblock_syntax/fn.bar.html
|
||||
// @has - '//*[@class="docblock"]' '`baz::foobar`'
|
||||
//@ has bad_codeblock_syntax/fn.bar.html
|
||||
//@ has - '//*[@class="docblock"]' '`baz::foobar`'
|
||||
/// ```
|
||||
/// `baz::foobar`
|
||||
/// ```
|
||||
pub fn bar() {}
|
||||
|
||||
// @has bad_codeblock_syntax/fn.quux.html
|
||||
// @has - '//*[@class="docblock"]' '\_'
|
||||
//@ has bad_codeblock_syntax/fn.quux.html
|
||||
//@ has - '//*[@class="docblock"]' '\_'
|
||||
/// ```rust
|
||||
/// \_
|
||||
/// ```
|
||||
pub fn quux() {}
|
||||
|
||||
// @has bad_codeblock_syntax/fn.ok.html
|
||||
// @has - '//*[@class="docblock"]' '\_'
|
||||
//@ has bad_codeblock_syntax/fn.ok.html
|
||||
//@ has - '//*[@class="docblock"]' '\_'
|
||||
/// ```text
|
||||
/// \_
|
||||
/// ```
|
||||
pub fn ok() {}
|
||||
|
||||
// @has bad_codeblock_syntax/fn.escape.html
|
||||
// @has - '//*[@class="docblock"]' '\_ <script>alert("not valid Rust");</script>'
|
||||
//@ has bad_codeblock_syntax/fn.escape.html
|
||||
//@ has - '//*[@class="docblock"]' '\_ <script>alert("not valid Rust");</script>'
|
||||
/// ```
|
||||
/// \_
|
||||
/// <script>alert("not valid Rust");</script>
|
||||
/// ```
|
||||
pub fn escape() {}
|
||||
|
||||
// @has bad_codeblock_syntax/fn.unterminated.html
|
||||
// @has - '//*[@class="docblock"]' '"unterminated'
|
||||
//@ has bad_codeblock_syntax/fn.unterminated.html
|
||||
//@ has - '//*[@class="docblock"]' '"unterminated'
|
||||
/// ```
|
||||
/// "unterminated
|
||||
/// ```
|
||||
|
@ -1,7 +1,7 @@
|
||||
// https://github.com/rust-lang/rust/issues/47197
|
||||
#![crate_name="foo"]
|
||||
|
||||
// @has foo/fn.whose_woods_these_are_i_think_i_know.html
|
||||
//@ has foo/fn.whose_woods_these_are_i_think_i_know.html
|
||||
|
||||
/**
|
||||
* snow
|
||||
|
@ -3,12 +3,12 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
// @has issue_29503/trait.MyTrait.html
|
||||
//@ has issue_29503/trait.MyTrait.html
|
||||
pub trait MyTrait {
|
||||
fn my_string(&self) -> String;
|
||||
}
|
||||
|
||||
// @has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header']" "impl<T> MyTrait for Twhere T: Debug"
|
||||
//@ has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header']" "impl<T> MyTrait for Twhere T: Debug"
|
||||
impl<T> MyTrait for T
|
||||
where
|
||||
T: fmt::Debug,
|
||||
|
@ -7,18 +7,18 @@ pub trait AnAmazingTrait {}
|
||||
|
||||
impl<T: Something> AnAmazingTrait for T {}
|
||||
|
||||
// @has 'issue_78673/struct.MyStruct.html'
|
||||
// @has - '//*[@class="impl"]' 'AnAmazingTrait for MyStruct'
|
||||
// @!has - '//*[@class="impl"]' 'AnAmazingTrait for T'
|
||||
//@ has 'issue_78673/struct.MyStruct.html'
|
||||
//@ has - '//*[@class="impl"]' 'AnAmazingTrait for MyStruct'
|
||||
//@ !has - '//*[@class="impl"]' 'AnAmazingTrait for T'
|
||||
pub struct MyStruct;
|
||||
|
||||
impl AnAmazingTrait for MyStruct {}
|
||||
|
||||
// generic structs may have _both_ specific and blanket impls that apply
|
||||
|
||||
// @has 'issue_78673/struct.AnotherStruct.html'
|
||||
// @has - '//*[@class="impl"]' 'AnAmazingTrait for AnotherStruct<()>'
|
||||
// @has - '//*[@class="impl"]' 'AnAmazingTrait for T'
|
||||
//@ has 'issue_78673/struct.AnotherStruct.html'
|
||||
//@ has - '//*[@class="impl"]' 'AnAmazingTrait for AnotherStruct<()>'
|
||||
//@ has - '//*[@class="impl"]' 'AnAmazingTrait for T'
|
||||
pub struct AnotherStruct<T>(T);
|
||||
|
||||
impl<T: Something> Something for AnotherStruct<T> {}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-T"]//h3[@class="code-header"]' 'impl<T, U> Into<U> for T'
|
||||
//@ has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-T"]//h3[@class="code-header"]' 'impl<T, U> Into<U> for T'
|
||||
pub struct S2 {}
|
||||
mod m {
|
||||
pub struct S {}
|
||||
|
@ -4,16 +4,16 @@ pub trait Eq {}
|
||||
pub trait Eq2 {}
|
||||
|
||||
// Checking that "where predicates" and "generics params" are merged.
|
||||
// @has 'foo/trait.T.html'
|
||||
// @has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a,"
|
||||
//@ has 'foo/trait.T.html'
|
||||
//@ has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a,"
|
||||
pub trait T {
|
||||
fn f<'a, 'b, 'c: 'a, T: Eq + 'a>()
|
||||
where Self: Eq, Self: Eq, T: Eq, 'c: 'b;
|
||||
}
|
||||
|
||||
// Checking that a duplicated "where predicate" is removed.
|
||||
// @has 'foo/trait.T2.html'
|
||||
// @has - "//*[@id='tymethod.f']/h4" "fn f<T>()where Self: Eq + Eq2, T: Eq2 + Eq,"
|
||||
//@ has 'foo/trait.T2.html'
|
||||
//@ has - "//*[@id='tymethod.f']/h4" "fn f<T>()where Self: Eq + Eq2, T: Eq2 + Eq,"
|
||||
pub trait T2 {
|
||||
fn f<T: Eq>()
|
||||
where Self: Eq, Self: Eq2, T: Eq2;
|
||||
@ -23,8 +23,8 @@ pub trait T2 {
|
||||
// Note that we don't want to hide them since they have a semantic effect.
|
||||
// For outlives-bounds, they force the lifetime param to be early-bound instead of late-bound.
|
||||
// For trait bounds, it can affect well-formedness (see `ClauseKind::WellFormed`).
|
||||
// @has 'foo/fn.empty.html'
|
||||
// @has - '//pre[@class="rust item-decl"]' "empty<'a, T>()where T:, 'a:,"
|
||||
//@ has 'foo/fn.empty.html'
|
||||
//@ has - '//pre[@class="rust item-decl"]' "empty<'a, T>()where T:, 'a:,"
|
||||
pub fn empty<'a, T>()
|
||||
where
|
||||
T:,
|
||||
|
@ -3,7 +3,7 @@
|
||||
// therefore should not concern itself with the lints.
|
||||
#[deny(warnings)]
|
||||
|
||||
// @has cap_lints/struct.Foo.html //* 'Foo'
|
||||
//@ has cap_lints/struct.Foo.html //* 'Foo'
|
||||
pub struct Foo {
|
||||
field: i32,
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// @!has cfg_doctest/struct.SomeStruct.html
|
||||
// @!has cfg_doctest/index.html '//a/@href' 'struct.SomeStruct.html'
|
||||
//@ !has cfg_doctest/struct.SomeStruct.html
|
||||
//@ !has cfg_doctest/index.html '//a/@href' 'struct.SomeStruct.html'
|
||||
|
||||
/// Sneaky, this isn't actually part of docs.
|
||||
#[cfg(doctest)]
|
||||
|
@ -4,14 +4,14 @@
|
||||
#![crate_name = "foo"]
|
||||
#![no_core]
|
||||
|
||||
// @has 'foo/index.html'
|
||||
// @has - '//*[@class="item-name"]/*[@class="stab portability"]' 'foobar'
|
||||
// @has - '//*[@class="item-name"]/*[@class="stab portability"]' 'bar'
|
||||
//@ has 'foo/index.html'
|
||||
//@ has - '//*[@class="item-name"]/*[@class="stab portability"]' 'foobar'
|
||||
//@ has - '//*[@class="item-name"]/*[@class="stab portability"]' 'bar'
|
||||
|
||||
#[doc(cfg(feature = "foobar"))]
|
||||
mod imp_priv {
|
||||
// @has 'foo/struct.BarPriv.html'
|
||||
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
//@ has 'foo/struct.BarPriv.html'
|
||||
//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
// 'Available on crate feature foobar only.'
|
||||
pub struct BarPriv {}
|
||||
impl BarPriv {
|
||||
@ -22,8 +22,8 @@ mod imp_priv {
|
||||
pub use crate::imp_priv::*;
|
||||
|
||||
pub mod bar {
|
||||
// @has 'foo/bar/struct.Bar.html'
|
||||
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
//@ has 'foo/bar/struct.Bar.html'
|
||||
//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
// 'Available on crate feature bar only.'
|
||||
#[doc(cfg(feature = "bar"))]
|
||||
pub struct Bar;
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'src/foo/check-source-code-urls-to-def-std.rs.html'
|
||||
//@ has 'src/foo/check-source-code-urls-to-def-std.rs.html'
|
||||
|
||||
fn babar() {}
|
||||
|
||||
// @has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32'
|
||||
// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str'
|
||||
// @has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool'
|
||||
// @has - '//a[@href="#7"]' 'babar'
|
||||
//@ has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32'
|
||||
//@ has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str'
|
||||
//@ has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool'
|
||||
//@ has - '//a[@href="#7"]' 'babar'
|
||||
pub fn foo(a: u32, b: &str, c: String) {
|
||||
let x = 12;
|
||||
let y: bool = true;
|
||||
@ -31,12 +31,12 @@ macro_rules! data {
|
||||
pub fn another_foo() {
|
||||
// This is known limitation: if the macro doesn't generate anything, the visitor
|
||||
// can't find any item or anything that could tell us that it comes from expansion.
|
||||
// @!has - '//a[@href="#19"]' 'yolo!'
|
||||
//@ !has - '//a[@href="#19"]' 'yolo!'
|
||||
yolo!();
|
||||
// @has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!'
|
||||
//@ has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!'
|
||||
eprintln!();
|
||||
// @has - '//a[@href="#27-29"]' 'data!'
|
||||
//@ has - '//a[@href="#27-29"]' 'data!'
|
||||
let x = data!(4);
|
||||
// @has - '//a[@href="#23-25"]' 'bar!'
|
||||
//@ has - '//a[@href="#23-25"]' 'bar!'
|
||||
bar!(x);
|
||||
}
|
||||
|
@ -8,16 +8,16 @@
|
||||
|
||||
extern crate source_code;
|
||||
|
||||
// @has 'src/foo/check-source-code-urls-to-def.rs.html'
|
||||
//@ has 'src/foo/check-source-code-urls-to-def.rs.html'
|
||||
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
|
||||
#[path = "auxiliary/source-code-bar.rs"]
|
||||
pub mod bar;
|
||||
|
||||
// @count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5-7"]' 4
|
||||
//@ count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5-7"]' 4
|
||||
use bar::Bar;
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13-17"]' 'self'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13-17"]' 'self'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
|
||||
use bar::sub::{self, Trait};
|
||||
|
||||
pub struct Foo;
|
||||
@ -28,30 +28,30 @@ impl Foo {
|
||||
|
||||
fn babar() {}
|
||||
|
||||
// @has - '//pre[@class="rust"]//a/@href' '/struct.String.html'
|
||||
// @has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html'
|
||||
// @has - '//pre[@class="rust"]//a/@href' '/primitive.str.html'
|
||||
// @count - '//pre[@class="rust"]//a[@href="#23"]' 5
|
||||
// @has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' \
|
||||
//@ has - '//pre[@class="rust"]//a/@href' '/struct.String.html'
|
||||
//@ has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html'
|
||||
//@ has - '//pre[@class="rust"]//a/@href' '/primitive.str.html'
|
||||
//@ count - '//pre[@class="rust"]//a[@href="#23"]' 5
|
||||
//@ has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' \
|
||||
// 'source_code::SourceCode'
|
||||
pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
|
||||
let x = 12;
|
||||
let y: Foo = Foo;
|
||||
let z: Bar = bar::Bar { field: Foo };
|
||||
babar();
|
||||
// @has - '//pre[@class="rust"]//a[@href="#26"]' 'hello'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="#26"]' 'hello'
|
||||
y.hello();
|
||||
}
|
||||
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
|
||||
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
|
||||
|
||||
pub trait AnotherTrait {}
|
||||
pub trait WhyNot {}
|
||||
|
||||
// @has - '//pre[@class="rust"]//a[@href="#50"]' 'AnotherTrait'
|
||||
// @has - '//pre[@class="rust"]//a[@href="#51"]' 'WhyNot'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="#50"]' 'AnotherTrait'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="#51"]' 'WhyNot'
|
||||
pub fn foo3<T, V>(t: &T, v: &V)
|
||||
where
|
||||
T: AnotherTrait,
|
||||
@ -60,11 +60,11 @@ where
|
||||
|
||||
pub trait AnotherTrait2 {}
|
||||
|
||||
// @has - '//pre[@class="rust"]//a[@href="#61"]' 'AnotherTrait2'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="#61"]' 'AnotherTrait2'
|
||||
pub fn foo4() {
|
||||
let x: Vec<&dyn AnotherTrait2> = Vec::new();
|
||||
}
|
||||
|
||||
// @has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool'
|
||||
//@ has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool'
|
||||
#[rustc_doc_primitive = "bool"]
|
||||
mod whatever {}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
// @has foo/struct.Bar.html '//a[@href="struct.Foo.html"]' 'Foo'
|
||||
//@ has foo/struct.Bar.html '//a[@href="struct.Foo.html"]' 'Foo'
|
||||
|
||||
/// Code-styled reference to [`Foo`].
|
||||
pub struct Bar;
|
||||
|
@ -1,5 +1,5 @@
|
||||
//@ compile-flags: -Z unstable-options --check
|
||||
|
||||
// @!has check/fn.foo.html
|
||||
// @!has check/index.html
|
||||
//@ !has check/fn.foo.html
|
||||
//@ !has check/index.html
|
||||
pub fn foo() {}
|
||||
|
@ -1,9 +1,9 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/fn.bar.html '//*[@class="example-wrap compile_fail"]/*[@class="tooltip"]' "ⓘ"
|
||||
// @has foo/fn.bar.html '//*[@class="example-wrap ignore"]/*[@class="tooltip"]' "ⓘ"
|
||||
// @has foo/fn.bar.html '//*[@class="example-wrap should_panic"]/*[@class="tooltip"]' "ⓘ"
|
||||
// @has foo/fn.bar.html '//*[@title="This example runs with edition 2018"]' "ⓘ"
|
||||
//@ has foo/fn.bar.html '//*[@class="example-wrap compile_fail"]/*[@class="tooltip"]' "ⓘ"
|
||||
//@ has foo/fn.bar.html '//*[@class="example-wrap ignore"]/*[@class="tooltip"]' "ⓘ"
|
||||
//@ has foo/fn.bar.html '//*[@class="example-wrap should_panic"]/*[@class="tooltip"]' "ⓘ"
|
||||
//@ has foo/fn.bar.html '//*[@title="This example runs with edition 2018"]' "ⓘ"
|
||||
|
||||
/// foo
|
||||
///
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'foo/index.html'
|
||||
//@ has 'foo/index.html'
|
||||
// Each compiler builtin proc-macro has a trait equivalent so we should have
|
||||
// a trait section as well.
|
||||
// @count - '//*[@id="main-content"]//*[@class="section-header"]' 2
|
||||
// @has - '//*[@id="main-content"]//*[@class="section-header"]' 'Traits'
|
||||
// @has - '//*[@id="main-content"]//*[@class="section-header"]' 'Derive Macros'
|
||||
//@ count - '//*[@id="main-content"]//*[@class="section-header"]' 2
|
||||
//@ has - '//*[@id="main-content"]//*[@class="section-header"]' 'Traits'
|
||||
//@ has - '//*[@id="main-content"]//*[@class="section-header"]' 'Derive Macros'
|
||||
|
||||
// Now checking the correct file is generated as well.
|
||||
// @has 'foo/derive.Clone.html'
|
||||
// @!has 'foo/macro.Clone.html'
|
||||
//@ has 'foo/derive.Clone.html'
|
||||
//@ !has 'foo/macro.Clone.html'
|
||||
pub use std::clone::Clone;
|
||||
|
@ -7,68 +7,68 @@
|
||||
#![feature(foo, foo2)]
|
||||
#![feature(staged_api)]
|
||||
|
||||
// @has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> u32'
|
||||
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
|
||||
//@ has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> 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 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)'
|
||||
//@ 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'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
//@ has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32'
|
||||
//@ !hasraw - '//span[@class="since"]'
|
||||
#[unstable(feature = "humans", issue = "none")]
|
||||
pub const fn foo2() -> u32 { 42 }
|
||||
|
||||
// @has 'foo/fn.foo3.html' '//pre' 'pub const fn foo3() -> u32'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
//@ has 'foo/fn.foo3.html' '//pre' 'pub const fn foo3() -> u32'
|
||||
//@ !hasraw - '//span[@class="since"]'
|
||||
#[unstable(feature = "humans", issue = "none")]
|
||||
#[rustc_const_unstable(feature = "humans", issue = "none")]
|
||||
pub const fn foo3() -> u32 { 42 }
|
||||
|
||||
// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32'
|
||||
// @has - //span '1.0.0 (const: 1.0.0)'
|
||||
//@ 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'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
//@ has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
|
||||
//@ !hasraw - '//span[@class="since"]'
|
||||
#[unstable(feature = "foo2", issue = "none")]
|
||||
pub const unsafe fn foo2_gated() -> u32 { 42 }
|
||||
|
||||
// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32'
|
||||
// @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)'
|
||||
//@ has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe 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 }
|
||||
|
||||
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
//@ has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
|
||||
//@ !hasraw - '//span[@class="since"]'
|
||||
pub const unsafe fn bar_not_gated() -> u32 { 42 }
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
// @has 'foo/struct.Foo.html' '//*[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> u32'
|
||||
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
|
||||
//@ has 'foo/struct.Foo.html' '//*[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> 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 fn gated() -> u32 { 42 }
|
||||
|
||||
// @has 'foo/struct.Foo.html' '//*[@id="method.gated_unsafe"]/h4[@class="code-header"]' 'pub unsafe fn gated_unsafe() -> u32'
|
||||
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
|
||||
//@ has 'foo/struct.Foo.html' '//*[@id="method.gated_unsafe"]/h4[@class="code-header"]' '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' '//*[@id="method.stable_impl"]/h4[@class="code-header"]' 'pub const fn stable_impl() -> u32'
|
||||
// @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
|
||||
//@ has 'foo/struct.Foo.html' '//*[@id="method.stable_impl"]/h4[@class="code-header"]' '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 = "const2", since = "1.2.0")]
|
||||
pub const fn stable_impl() -> u32 { 42 }
|
||||
@ -79,13 +79,13 @@ pub struct Bar;
|
||||
|
||||
impl Bar {
|
||||
// Show non-const stabilities that are the same as the enclosing item.
|
||||
// @has 'foo/struct.Bar.html' '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
|
||||
//@ has 'foo/struct.Bar.html' '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "const2", since = "1.2.0")]
|
||||
pub const fn stable_impl() -> u32 { 42 }
|
||||
|
||||
// Show const-stability even for unstable functions.
|
||||
// @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$'
|
||||
//@ matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$'
|
||||
#[unstable(feature = "foo2", issue = "none")]
|
||||
#[rustc_const_stable(feature = "const3", since = "1.3.0")]
|
||||
pub const fn const_stable_unstable() -> u32 { 42 }
|
||||
|
@ -11,8 +11,8 @@ pub struct ContentType {
|
||||
}
|
||||
|
||||
impl ContentType {
|
||||
// @has const_doc/struct.ContentType.html
|
||||
// @has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType'
|
||||
//@ has const_doc/struct.ContentType.html
|
||||
//@ has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType'
|
||||
pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, },
|
||||
subtype: Foo { f: PhantomData, },
|
||||
params: None, };
|
||||
|
@ -9,7 +9,7 @@ pub trait Tr {
|
||||
fn f();
|
||||
}
|
||||
|
||||
// @has foo/fn.g.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub const fn g<T: Tr>()'
|
||||
//@ has foo/fn.g.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub const fn g<T: Tr>()'
|
||||
/// foo
|
||||
pub const fn g<T: ~const Tr>() {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// https://github.com/rust-lang/rust/issues/76501
|
||||
#![crate_name="foo"]
|
||||
|
||||
// @has 'foo/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
|
||||
//@ has 'foo/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
|
||||
/// A useless function that always returns 1.
|
||||
pub const fn bloop() -> i32 {
|
||||
1
|
||||
@ -11,7 +11,7 @@ pub const fn bloop() -> i32 {
|
||||
pub struct Struct {}
|
||||
|
||||
impl Struct {
|
||||
// @has 'foo/struct.Struct.html' '//*[@class="method"]' \
|
||||
//@ has 'foo/struct.Struct.html' '//*[@class="method"]' \
|
||||
// 'pub const fn blurp() -> i32'
|
||||
/// A useless function that always returns 1.
|
||||
pub const fn blurp() -> i32 {
|
||||
|
@ -2,15 +2,15 @@
|
||||
#![feature(effects)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
// @has foo/fn.bar.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
|
||||
//@ has foo/fn.bar.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
|
||||
/// foo
|
||||
pub const fn bar() -> usize {
|
||||
2
|
||||
}
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @has - '//*[@class="method"]' 'const fn new()'
|
||||
//@ has foo/struct.Foo.html
|
||||
//@ has - '//*[@class="method"]' 'const fn new()'
|
||||
pub struct Foo(usize);
|
||||
|
||||
impl Foo {
|
||||
|
@ -1,14 +1,14 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/fn.bar.html
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
|
||||
//@ has foo/fn.bar.html
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
|
||||
/// foo
|
||||
pub const fn bar() -> usize {
|
||||
2
|
||||
}
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @has - '//*[@class="method"]' 'const fn new()'
|
||||
//@ has foo/struct.Foo.html
|
||||
//@ has - '//*[@class="method"]' 'const fn new()'
|
||||
pub struct Foo(usize);
|
||||
|
||||
impl Foo {
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
use std::ops::Add;
|
||||
|
||||
// @has foo/struct.Simd.html '//pre[@class="rust item-decl"]' 'pub struct Simd<T, const WIDTH: usize>'
|
||||
//@ has foo/struct.Simd.html '//pre[@class="rust item-decl"]' 'pub struct Simd<T, const WIDTH: usize>'
|
||||
pub struct Simd<T, const WIDTH: usize> {
|
||||
inner: T,
|
||||
}
|
||||
|
||||
// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl Add for Simd<u8, 16>'
|
||||
//@ has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl Add for Simd<u8, 16>'
|
||||
impl Add for Simd<u8, 16> {
|
||||
type Output = Self;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub struct Foo<const M: usize = 10, const N: usize = M, T = i32>('
|
||||
pub struct Foo<const M: usize = 10, const N: usize = M, T = i32>(T);
|
||||
|
@ -4,8 +4,8 @@ pub trait Array {
|
||||
type Item;
|
||||
}
|
||||
|
||||
// @has foo/trait.Array.html
|
||||
// @has - '//*[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]'
|
||||
//@ has foo/trait.Array.html
|
||||
//@ has - '//*[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]'
|
||||
impl<T, const N: usize> Array for [T; N] {
|
||||
type Item = T;
|
||||
}
|
||||
|
@ -3,26 +3,26 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
extern crate extern_crate;
|
||||
// @has foo/fn.extern_fn.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/fn.extern_fn.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]>'
|
||||
pub use extern_crate::extern_fn;
|
||||
// @has foo/struct.ExternTy.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/struct.ExternTy.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub struct ExternTy<const N: usize> {'
|
||||
pub use extern_crate::ExternTy;
|
||||
// @has foo/type.TyAlias.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/type.TyAlias.html '//pre[@class="rust item-decl"]' \
|
||||
// 'type TyAlias<const N: usize> = ExternTy<N>;'
|
||||
pub use extern_crate::TyAlias;
|
||||
// @has foo/trait.WTrait.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/trait.WTrait.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub trait WTrait<const N: usize, const M: usize>'
|
||||
// @has - '//pre[@class="rust item-decl"]' 'fn hey<const P: usize>() -> usize'
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'fn hey<const P: usize>() -> usize'
|
||||
pub use extern_crate::WTrait;
|
||||
|
||||
// @has foo/trait.Trait.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/trait.Trait.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub trait Trait<const N: usize>'
|
||||
// @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3C%7B1+%2B+2%7D%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8'
|
||||
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8;+N%5D"]//h3[@class="code-header"]' \
|
||||
//@ has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8'
|
||||
//@ has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8'
|
||||
//@ has - '//*[@id="impl-Trait%3C%7B1+%2B+2%7D%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8'
|
||||
//@ has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8;+N%5D"]//h3[@class="code-header"]' \
|
||||
// 'impl<const N: usize> Trait<N> for [u8; N]'
|
||||
pub trait Trait<const N: usize> {}
|
||||
impl Trait<1> for u8 {}
|
||||
@ -30,58 +30,58 @@ impl Trait<2> for u8 {}
|
||||
impl Trait<{1 + 2}> for u8 {}
|
||||
impl<const N: usize> Trait<N> for [u8; N] {}
|
||||
|
||||
// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub struct Foo<const N: usize> where u8: Trait<N>'
|
||||
pub struct Foo<const N: usize> where u8: Trait<N>;
|
||||
// @has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar<T, const N: usize>('
|
||||
//@ has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar<T, const N: usize>('
|
||||
pub struct Bar<T, const N: usize>([T; N]);
|
||||
|
||||
// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Foo<M>where u8: Trait<M>'
|
||||
//@ has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Foo<M>where u8: Trait<M>'
|
||||
impl<const M: usize> Foo<M> where u8: Trait<M> {
|
||||
// @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
|
||||
//@ has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
|
||||
pub const FOO_ASSOC: usize = M + 13;
|
||||
|
||||
// @has - '//*[@id="method.hey"]' 'pub fn hey<const N: usize>(&self) -> Bar<u8, N>'
|
||||
//@ has - '//*[@id="method.hey"]' 'pub fn hey<const N: usize>(&self) -> Bar<u8, N>'
|
||||
pub fn hey<const N: usize>(&self) -> Bar<u8, N> {
|
||||
Bar([0; N])
|
||||
}
|
||||
}
|
||||
|
||||
// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8,+M%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Bar<u8, M>'
|
||||
//@ has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8,+M%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Bar<u8, M>'
|
||||
impl<const M: usize> Bar<u8, M> {
|
||||
// @has - '//*[@id="method.hey"]' \
|
||||
//@ has - '//*[@id="method.hey"]' \
|
||||
// 'pub fn hey<const N: usize>(&self) -> Foo<N>where u8: Trait<N>'
|
||||
pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N> {
|
||||
Foo
|
||||
}
|
||||
}
|
||||
|
||||
// @has foo/fn.test.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/fn.test.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub fn test<const N: usize>() -> impl Trait<N>where u8: Trait<N>'
|
||||
pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
|
||||
2u8
|
||||
}
|
||||
|
||||
// @has foo/fn.a_sink.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/fn.a_sink.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N>'
|
||||
pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N> {
|
||||
v
|
||||
}
|
||||
|
||||
// @has foo/fn.b_sink.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/fn.b_sink.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub async fn b_sink<const N: usize>(_: impl Trait<N>)'
|
||||
pub async fn b_sink<const N: usize>(_: impl Trait<N>) {}
|
||||
|
||||
// @has foo/fn.concrete.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/fn.concrete.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub fn concrete() -> [u8; 22]'
|
||||
pub fn concrete() -> [u8; 3 + std::mem::size_of::<u64>() << 1] {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
// @has foo/type.Faz.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/type.Faz.html '//pre[@class="rust item-decl"]' \
|
||||
// 'type Faz<const N: usize> = [u8; N];'
|
||||
pub type Faz<const N: usize> = [u8; N];
|
||||
// @has foo/type.Fiz.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/type.Fiz.html '//pre[@class="rust item-decl"]' \
|
||||
// 'type Fiz<const N: usize> = [[u8; N]; 48];'
|
||||
pub type Fiz<const N: usize> = [[u8; N]; 3 << 4];
|
||||
|
||||
@ -91,7 +91,7 @@ macro_rules! define_me {
|
||||
}
|
||||
}
|
||||
|
||||
// @has foo/struct.Foz.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/struct.Foz.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub struct Foz<const N: usize>(/* private fields */);'
|
||||
define_me!(Foz<N>);
|
||||
|
||||
@ -103,26 +103,26 @@ impl<const N: usize> Q for [u8; N] {
|
||||
const ASSOC: usize = N;
|
||||
}
|
||||
|
||||
// @has foo/fn.q_user.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/fn.q_user.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub fn q_user() -> [u8; 13]'
|
||||
pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {
|
||||
[0; <[u8; 13] as Q>::ASSOC]
|
||||
}
|
||||
|
||||
// @has foo/union.Union.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/union.Union.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub union Union<const N: usize>'
|
||||
pub union Union<const N: usize> {
|
||||
// @has - //pre "pub arr: [u8; N]"
|
||||
//@ has - //pre "pub arr: [u8; N]"
|
||||
pub arr: [u8; N],
|
||||
// @has - //pre "pub another_arr: [(); N]"
|
||||
//@ has - //pre "pub another_arr: [(); N]"
|
||||
pub another_arr: [(); N],
|
||||
}
|
||||
|
||||
// @has foo/enum.Enum.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/enum.Enum.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub enum Enum<const N: usize>'
|
||||
pub enum Enum<const N: usize> {
|
||||
// @has - //pre "Variant([u8; N])"
|
||||
//@ has - //pre "Variant([u8; N])"
|
||||
Variant([u8; N]),
|
||||
// @has - //pre "EmptyVariant"
|
||||
//@ has - //pre "EmptyVariant"
|
||||
EmptyVariant,
|
||||
}
|
||||
|
@ -10,21 +10,21 @@ pub enum Order {
|
||||
Unsorted,
|
||||
}
|
||||
|
||||
// @has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet<T, const ORDER: Order>'
|
||||
// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
|
||||
// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
|
||||
//@ has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet<T, const ORDER: Order>'
|
||||
//@ has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
|
||||
//@ has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
|
||||
pub struct VSet<T, const ORDER: Order> {
|
||||
inner: Vec<T>,
|
||||
}
|
||||
|
||||
// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Sorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>'
|
||||
//@ has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Sorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>'
|
||||
impl<T> VSet<T, { Order::Sorted }> {
|
||||
pub fn new() -> Self {
|
||||
Self { inner: Vec::new() }
|
||||
}
|
||||
}
|
||||
|
||||
// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Unsorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>'
|
||||
//@ has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Unsorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>'
|
||||
impl<T> VSet<T, { Order::Unsorted }> {
|
||||
pub fn new() -> Self {
|
||||
Self { inner: Vec::new() }
|
||||
@ -33,7 +33,7 @@ impl<T> VSet<T, { Order::Unsorted }> {
|
||||
|
||||
pub struct Escape<const S: &'static str>;
|
||||
|
||||
// @has foo/struct.Escape.html '//*[@id="impl-Escape%3C%22%3Cscript%3Ealert(%5C%22Escape%5C%22);%3C/script%3E%22%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
|
||||
//@ has foo/struct.Escape.html '//*[@id="impl-Escape%3C%22%3Cscript%3Ealert(%5C%22Escape%5C%22);%3C/script%3E%22%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
|
||||
impl Escape<r#"<script>alert("Escape");</script>"#> {
|
||||
pub fn f() {}
|
||||
}
|
||||
|
@ -2,6 +2,6 @@
|
||||
#![feature(generic_const_exprs)]
|
||||
#![allow(incomplete_features)]
|
||||
// make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647
|
||||
// @has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \
|
||||
//@ has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \
|
||||
// 'pub struct Ice<const N: usize> where [(); { _ }]:;'
|
||||
pub struct Ice<const N: usize> where [(); N + 1]:;
|
||||
|
@ -11,8 +11,8 @@ pub struct Hasher<T> {
|
||||
|
||||
unsafe impl<T: Default> Send for Hasher<T> {}
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @has - '//h3[@class="code-header"]' 'impl Send for Foo'
|
||||
//@ has foo/struct.Foo.html
|
||||
//@ has - '//h3[@class="code-header"]' 'impl Send for Foo'
|
||||
pub struct Foo {
|
||||
hasher: Hasher<[u8; 3]>,
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/type.CellIndex.html '//pre[@class="rust item-decl"]' 'type CellIndex<const D: usize> = [i64; D];'
|
||||
//@ has foo/type.CellIndex.html '//pre[@class="rust item-decl"]' 'type CellIndex<const D: usize> = [i64; D];'
|
||||
pub type CellIndex<const D: usize> = [i64; D];
|
||||
|
@ -5,21 +5,21 @@
|
||||
#![stable(since="1.0.0", feature="rust1")]
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
// @has 'foo/fn.transmute.html'
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub const unsafe extern "rust-intrinsic" fn transmute<T, U>(_: T) -> U'
|
||||
//@ has 'foo/fn.transmute.html'
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub const unsafe extern "rust-intrinsic" fn transmute<T, U>(_: T) -> U'
|
||||
#[stable(since="1.0.0", feature="rust1")]
|
||||
#[rustc_const_stable(feature = "const_transmute", since = "1.56.0")]
|
||||
pub fn transmute<T, U>(_: T) -> U;
|
||||
|
||||
// @has 'foo/fn.unreachable.html'
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
|
||||
//@ has 'foo/fn.unreachable.html'
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
|
||||
#[stable(since="1.0.0", feature="rust1")]
|
||||
pub fn unreachable() -> !;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
// @has 'foo/fn.needs_drop.html'
|
||||
// @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !'
|
||||
//@ has 'foo/fn.needs_drop.html'
|
||||
//@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !'
|
||||
#[stable(since="1.0.0", feature="rust1")]
|
||||
pub fn needs_drop() -> !;
|
||||
}
|
||||
|
@ -8,42 +8,42 @@ macro_rules! make {
|
||||
($n:expr) => {
|
||||
pub struct S;
|
||||
|
||||
// @has issue_33302/constant.CST.html \
|
||||
//@ has issue_33302/constant.CST.html \
|
||||
// '//pre[@class="rust item-decl"]' 'pub const CST: i32'
|
||||
pub const CST: i32 = ($n * $n);
|
||||
// @has issue_33302/static.ST.html \
|
||||
//@ has issue_33302/static.ST.html \
|
||||
// '//pre[@class="rust item-decl"]' 'pub static ST: i32'
|
||||
pub static ST: i32 = ($n * $n);
|
||||
|
||||
pub trait T<X> {
|
||||
fn ignore(_: &X) {}
|
||||
const C: X;
|
||||
// @has issue_33302/trait.T.html \
|
||||
//@ has issue_33302/trait.T.html \
|
||||
// '//pre[@class="rust item-decl"]' 'const D: i32'
|
||||
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
|
||||
//@ has - '//*[@id="associatedconstant.D"]' 'const D: i32'
|
||||
const D: i32 = ($n * $n);
|
||||
}
|
||||
|
||||
// @has issue_33302/struct.S.html \
|
||||
//@ has issue_33302/struct.S.html \
|
||||
// '//*[@class="impl"]' 'impl T<[i32; 16]> for S'
|
||||
// @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]'
|
||||
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
|
||||
//@ has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]'
|
||||
//@ has - '//*[@id="associatedconstant.D"]' 'const D: i32'
|
||||
impl T<[i32; ($n * $n)]> for S {
|
||||
const C: [i32; ($n * $n)] = [0; ($n * $n)];
|
||||
}
|
||||
|
||||
// @has issue_33302/struct.S.html \
|
||||
//@ has issue_33302/struct.S.html \
|
||||
// '//*[@class="impl"]' 'impl T<[i32; 16]> for S'
|
||||
// @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)'
|
||||
// @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32'
|
||||
//@ has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)'
|
||||
//@ has - '//*[@id="associatedconstant.D-1"]' 'const D: i32'
|
||||
impl T<(i32,)> for S {
|
||||
const C: (i32,) = ($n,);
|
||||
}
|
||||
|
||||
// @has issue_33302/struct.S.html \
|
||||
//@ has issue_33302/struct.S.html \
|
||||
// '//*[@class="impl"]' 'impl T<(i32, i32)> for S'
|
||||
// @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)'
|
||||
// @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32'
|
||||
//@ has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)'
|
||||
//@ has - '//*[@id="associatedconstant.D-2"]' 'const D: i32'
|
||||
impl T<(i32, i32)> for S {
|
||||
const C: (i32, i32) = ($n, $n);
|
||||
const D: i32 = ($n / $n);
|
||||
|
@ -1,6 +1,6 @@
|
||||
//@ compile-flags: --document-private-items
|
||||
|
||||
// @!has const_underscore/constant._.html
|
||||
//@ !has const_underscore/constant._.html
|
||||
const _: () = {
|
||||
#[no_mangle]
|
||||
extern "C" fn implementation_detail() {}
|
||||
|
@ -1,9 +1,9 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'foo/constant.HOUR_IN_SECONDS.html'
|
||||
// @has - '//*[@class="rust item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
|
||||
//@ has 'foo/constant.HOUR_IN_SECONDS.html'
|
||||
//@ has - '//*[@class="rust item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
|
||||
pub const HOUR_IN_SECONDS: u64 = 60 * 60;
|
||||
|
||||
// @has 'foo/constant.NEGATIVE.html'
|
||||
// @has - '//*[@class="rust item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
|
||||
//@ has 'foo/constant.NEGATIVE.html'
|
||||
//@ has - '//*[@class="rust item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
|
||||
pub const NEGATIVE: i64 = -60 * 60;
|
||||
|
@ -3,7 +3,7 @@
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
// @has const/struct.Foo.html '//*[@id="method.new"]//h4[@class="code-header"]' 'const unsafe fn new'
|
||||
//@ has const/struct.Foo.html '//*[@id="method.new"]//h4[@class="code-header"]' 'const unsafe fn new'
|
||||
pub const unsafe fn new() -> Foo {
|
||||
Foo
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ pub mod a {
|
||||
}
|
||||
}
|
||||
|
||||
// @count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1
|
||||
//@ count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1
|
||||
#[doc(no_inline)]
|
||||
pub use a::Foo;
|
||||
// @count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1
|
||||
//@ count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1
|
||||
#[doc(no_inline)]
|
||||
pub use a::Bar::Baz;
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'foo/index.html' '//*[@class="version"]' '<script>alert("hi")</script>'
|
||||
//@ has 'foo/index.html' '//*[@class="version"]' '<script>alert("hi")</script>'
|
||||
|
@ -3,5 +3,5 @@
|
||||
#![crate_name="foo"]
|
||||
|
||||
// main version next to logo, extra version data below it
|
||||
// @has 'foo/index.html' '//h2/span[@class="version"]' '1.3.37-nightly'
|
||||
// @has 'foo/index.html' '//nav[@class="sidebar"]/div[@class="version"]' '(203c57dbe 2023-09-17)'
|
||||
//@ has 'foo/index.html' '//h2/span[@class="version"]' '1.3.37-nightly'
|
||||
//@ has 'foo/index.html' '//nav[@class="sidebar"]/div[@class="version"]' '(203c57dbe 2023-09-17)'
|
||||
|
@ -1,3 +1,3 @@
|
||||
//@ compile-flags: --crate-version=1.3.37
|
||||
|
||||
// @has 'crate_version/index.html' '//*[@class="version"]' '1.3.37'
|
||||
//@ has 'crate_version/index.html' '//*[@class="version"]' '1.3.37'
|
||||
|
@ -10,14 +10,14 @@
|
||||
// visible items instead and assert that there are *exactly two* associated items
|
||||
// (by counting the number of `section`s). This is more robust and future-proof.
|
||||
|
||||
// @has dependent/struct.Ty.html
|
||||
// @has - '//*[@id="associatedtype.VisibleAssoc"]' 'type VisibleAssoc = ()'
|
||||
// @has - '//*[@id="associatedconstant.VISIBLE_ASSOC"]' 'const VISIBLE_ASSOC: ()'
|
||||
// @count - '//*[@class="impl-items"]/section' 2
|
||||
//@ has dependent/struct.Ty.html
|
||||
//@ has - '//*[@id="associatedtype.VisibleAssoc"]' 'type VisibleAssoc = ()'
|
||||
//@ has - '//*[@id="associatedconstant.VISIBLE_ASSOC"]' 'const VISIBLE_ASSOC: ()'
|
||||
//@ count - '//*[@class="impl-items"]/section' 2
|
||||
|
||||
// @has dependent/trait.Tr.html
|
||||
// @has - '//*[@id="associatedtype.VisibleAssoc-1"]' 'type VisibleAssoc = ()'
|
||||
// @has - '//*[@id="associatedconstant.VISIBLE_ASSOC-1"]' 'const VISIBLE_ASSOC: ()'
|
||||
// @count - '//*[@class="impl-items"]/section' 2
|
||||
//@ has dependent/trait.Tr.html
|
||||
//@ has - '//*[@id="associatedtype.VisibleAssoc-1"]' 'type VisibleAssoc = ()'
|
||||
//@ has - '//*[@id="associatedconstant.VISIBLE_ASSOC-1"]' 'const VISIBLE_ASSOC: ()'
|
||||
//@ count - '//*[@class="impl-items"]/section' 2
|
||||
|
||||
pub use dependency::{Tr, Ty};
|
||||
|
@ -8,7 +8,7 @@ pub use ::cross_crate_hidden_impl_parameter::{HiddenType, HiddenTrait}; // OK, n
|
||||
|
||||
pub enum MyLibType {}
|
||||
|
||||
// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From<HiddenType> for MyLibType'
|
||||
//@ !has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From<HiddenType> for MyLibType'
|
||||
impl From<HiddenType> for MyLibType {
|
||||
fn from(it: HiddenType) -> MyLibType {
|
||||
match it {}
|
||||
@ -17,17 +17,17 @@ impl From<HiddenType> for MyLibType {
|
||||
|
||||
pub struct T<T>(T);
|
||||
|
||||
// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<T<T<T<T<HiddenType>>>>> for MyLibType'
|
||||
//@ !has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<T<T<T<T<HiddenType>>>>> for MyLibType'
|
||||
impl From<T<T<T<T<HiddenType>>>>> for MyLibType {
|
||||
fn from(it: T<T<T<T<HiddenType>>>>) -> MyLibType {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
// @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType'
|
||||
//@ !has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType'
|
||||
impl HiddenTrait for MyLibType {}
|
||||
|
||||
// @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From<MyLibType> for T<T<T<T<HiddenType>>>>'
|
||||
//@ !has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From<MyLibType> for T<T<T<T<HiddenType>>>>'
|
||||
impl From<MyLibType> for T<T<T<T<HiddenType>>>> {
|
||||
fn from(it: MyLibType) -> T<T<T<T<HiddenType>>>> {
|
||||
match it {}
|
||||
|
@ -6,54 +6,54 @@
|
||||
#[macro_use]
|
||||
extern crate all_item_types;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/foo_mod/index.html"]' 'foo_mod'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/foo_mod/index.html"]' 'foo_mod'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::foo_mod;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_ffn.html"]' 'foo_ffn'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_ffn.html"]' 'foo_ffn'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::foo_ffn;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_FSTATIC.html"]' 'FOO_FSTATIC'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_FSTATIC.html"]' 'FOO_FSTATIC'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FOO_FSTATIC;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/foreigntype.FooFType.html"]' 'FooFType'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/foreigntype.FooFType.html"]' 'FooFType'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FooFType;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_fn.html"]' 'foo_fn'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_fn.html"]' 'foo_fn'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::foo_fn;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/trait.FooTrait.html"]' 'FooTrait'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/trait.FooTrait.html"]' 'FooTrait'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FooTrait;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/struct.FooStruct.html"]' 'FooStruct'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/struct.FooStruct.html"]' 'FooStruct'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FooStruct;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/enum.FooEnum.html"]' 'FooEnum'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/enum.FooEnum.html"]' 'FooEnum'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FooEnum;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/union.FooUnion.html"]' 'FooUnion'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/union.FooUnion.html"]' 'FooUnion'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FooUnion;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/type.FooType.html"]' 'FooType'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/type.FooType.html"]' 'FooType'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FooType;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_STATIC.html"]' 'FOO_STATIC'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_STATIC.html"]' 'FOO_STATIC'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FOO_STATIC;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/constant.FOO_CONSTANT.html"]' 'FOO_CONSTANT'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/constant.FOO_CONSTANT.html"]' 'FOO_CONSTANT'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::FOO_CONSTANT;
|
||||
|
||||
// @has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro'
|
||||
//@ has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro'
|
||||
#[doc(no_inline)]
|
||||
pub use all_item_types::foo_macro;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
extern crate primitive_doc;
|
||||
|
||||
// @has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'usize'
|
||||
// @has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'link'
|
||||
//@ has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'usize'
|
||||
//@ has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'link'
|
||||
/// [link](usize)
|
||||
pub fn foo() -> usize { 0 }
|
||||
|
@ -4,10 +4,10 @@
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
|
||||
// @has 'foo/struct.Bar.html'
|
||||
// @has - '//*[@id="main-content"]//pre[@class="language-whatever hoho-c"]' 'main;'
|
||||
// @has - '//*[@id="main-content"]//pre[@class="language-whatever2 haha-c"]' 'main;'
|
||||
// @has - '//*[@id="main-content"]//pre[@class="language-whatever4 huhu-c"]' 'main;'
|
||||
//@ has 'foo/struct.Bar.html'
|
||||
//@ has - '//*[@id="main-content"]//pre[@class="language-whatever hoho-c"]' 'main;'
|
||||
//@ has - '//*[@id="main-content"]//pre[@class="language-whatever2 haha-c"]' 'main;'
|
||||
//@ has - '//*[@id="main-content"]//pre[@class="language-whatever4 huhu-c"]' 'main;'
|
||||
|
||||
/// ```{class=hoho-c},whatever
|
||||
/// main;
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
pub struct Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
// @has 'decl_line_wrapping_empty_arg_list/fn.create.html'
|
||||
// @snapshot decl - '//pre[@class="rust item-decl"]'
|
||||
//@ has 'decl_line_wrapping_empty_arg_list/fn.create.html'
|
||||
//@ snapshot decl - '//pre[@class="rust item-decl"]'
|
||||
pub fn create() -> Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000 {
|
||||
loop {}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
pub struct Error;
|
||||
|
||||
// @has 'foo/trait.Write.html'
|
||||
//@ has 'foo/trait.Write.html'
|
||||
|
||||
pub trait Write {
|
||||
// @snapshot 'declaration' - '//*[@class="rust item-decl"]//code'
|
||||
//@ snapshot 'declaration' - '//*[@class="rust item-decl"]//code'
|
||||
fn poll_write(
|
||||
self,
|
||||
cx: &mut Option<String>,
|
||||
|
@ -2,25 +2,25 @@
|
||||
|
||||
#![feature(decl_macro)]
|
||||
|
||||
// @has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {'
|
||||
// @has - //pre '...'
|
||||
// @has - //pre '}'
|
||||
//@ has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {'
|
||||
//@ has - //pre '...'
|
||||
//@ has - //pre '}'
|
||||
pub macro my_macro() {
|
||||
|
||||
}
|
||||
|
||||
// @has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'
|
||||
// @has - //pre '...'
|
||||
// @has - //pre '}'
|
||||
//@ has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'
|
||||
//@ has - //pre '...'
|
||||
//@ has - //pre '}'
|
||||
pub macro my_macro_2($($tok:tt)*) {
|
||||
|
||||
}
|
||||
|
||||
// @has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {'
|
||||
// @has - //pre '(_) => { ... },'
|
||||
// @has - //pre '($foo:ident . $bar:expr) => { ... },'
|
||||
// @has - //pre '($($foo:literal),+) => { ... },'
|
||||
// @has - //pre '}'
|
||||
//@ has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {'
|
||||
//@ has - //pre '(_) => { ... },'
|
||||
//@ has - //pre '($foo:ident . $bar:expr) => { ... },'
|
||||
//@ has - //pre '($($foo:literal),+) => { ... },'
|
||||
//@ has - //pre '}'
|
||||
pub macro my_macro_multi {
|
||||
(_) => {
|
||||
|
||||
@ -33,21 +33,21 @@ pub macro my_macro_multi {
|
||||
}
|
||||
}
|
||||
|
||||
// @has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {'
|
||||
// @has - //pre '...'
|
||||
// @has - //pre '}'
|
||||
//@ has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {'
|
||||
//@ has - //pre '...'
|
||||
//@ has - //pre '}'
|
||||
pub macro by_example_single {
|
||||
($foo:expr) => {}
|
||||
}
|
||||
|
||||
mod a {
|
||||
mod b {
|
||||
// @has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {'
|
||||
//@ has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {'
|
||||
pub(in super) macro by_example_vis {
|
||||
($foo:expr) => {}
|
||||
}
|
||||
mod c {
|
||||
// @has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {'
|
||||
//@ has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {'
|
||||
pub(in a) macro by_example_vis_named {
|
||||
($foo:expr) => {}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
#![feature(decl_macro)]
|
||||
|
||||
// @has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {'
|
||||
// @has - //pre '...'
|
||||
// @has - //pre '}'
|
||||
//@ has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {'
|
||||
//@ has - //pre '...'
|
||||
//@ has - //pre '}'
|
||||
pub(crate) macro crate_macro() {}
|
||||
|
||||
// @has decl_macro_priv/macro.priv_macro.html //pre 'macro priv_macro() {'
|
||||
// @!has - //pre 'pub macro priv_macro() {'
|
||||
// @has - //pre '...'
|
||||
// @has - //pre '}'
|
||||
//@ has decl_macro_priv/macro.priv_macro.html //pre 'macro priv_macro() {'
|
||||
//@ !has - //pre 'pub macro priv_macro() {'
|
||||
//@ has - //pre '...'
|
||||
//@ has - //pre '}'
|
||||
macro priv_macro() {}
|
||||
|
@ -9,6 +9,6 @@ mod inner {
|
||||
|
||||
pub trait Blah { }
|
||||
|
||||
// @count issue_21474/struct.What.html \
|
||||
//@ count issue_21474/struct.What.html \
|
||||
// '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
|
||||
pub struct What;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//@ compile-flags: --default-theme ayu
|
||||
|
||||
// @has default_theme/index.html
|
||||
// @has - '//script[@id="default-settings"]/@data-theme' 'ayu'
|
||||
// @has - '//script[@id="default-settings"]/@data-use_system_theme' 'false'
|
||||
//@ has default_theme/index.html
|
||||
//@ has - '//script[@id="default-settings"]/@data-theme' 'ayu'
|
||||
//@ has - '//script[@id="default-settings"]/@data-use_system_theme' 'false'
|
||||
|
||||
pub fn whatever() {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/trait.Foo.html '//a[@href="trait.Foo.html#tymethod.req"]' 'req'
|
||||
// @has foo/trait.Foo.html '//a[@href="trait.Foo.html#method.prov"]' 'prov'
|
||||
//@ has foo/trait.Foo.html '//a[@href="trait.Foo.html#tymethod.req"]' 'req'
|
||||
//@ has foo/trait.Foo.html '//a[@href="trait.Foo.html#method.prov"]' 'prov'
|
||||
|
||||
/// Always make sure to implement [`req`], but you don't have to implement [`prov`].
|
||||
///
|
||||
|
@ -1,45 +1,45 @@
|
||||
#![feature(min_specialization)]
|
||||
|
||||
// @has default_trait_method/trait.Item.html
|
||||
//@ has default_trait_method/trait.Item.html
|
||||
pub trait Item {
|
||||
// @has - '//*[@id="tymethod.foo"]' 'fn foo()'
|
||||
// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()'
|
||||
//@ has - '//*[@id="tymethod.foo"]' 'fn foo()'
|
||||
//@ !has - '//*[@id="tymethod.foo"]' 'default fn foo()'
|
||||
fn foo();
|
||||
|
||||
// @has - '//*[@id="tymethod.bar"]' 'fn bar()'
|
||||
// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()'
|
||||
//@ has - '//*[@id="tymethod.bar"]' 'fn bar()'
|
||||
//@ !has - '//*[@id="tymethod.bar"]' 'default fn bar()'
|
||||
fn bar();
|
||||
|
||||
// @has - '//*[@id="tymethod.baz"]' 'unsafe fn baz()'
|
||||
// @!has - '//*[@id="tymethod.baz"]' 'default unsafe fn baz()'
|
||||
//@ has - '//*[@id="tymethod.baz"]' 'unsafe fn baz()'
|
||||
//@ !has - '//*[@id="tymethod.baz"]' 'default unsafe fn baz()'
|
||||
unsafe fn baz();
|
||||
|
||||
// @has - '//*[@id="tymethod.quux"]' 'unsafe fn quux()'
|
||||
// @!has - '//*[@id="tymethod.quux"]' 'default unsafe fn quux()'
|
||||
//@ has - '//*[@id="tymethod.quux"]' 'unsafe fn quux()'
|
||||
//@ !has - '//*[@id="tymethod.quux"]' 'default unsafe fn quux()'
|
||||
unsafe fn quux();
|
||||
|
||||
// @has - '//*[@id="method.xyzzy"]' 'fn xyzzy()'
|
||||
// @!has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()'
|
||||
//@ has - '//*[@id="method.xyzzy"]' 'fn xyzzy()'
|
||||
//@ !has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()'
|
||||
fn xyzzy() {}
|
||||
}
|
||||
|
||||
// @has default_trait_method/struct.Foo.html
|
||||
//@ has default_trait_method/struct.Foo.html
|
||||
pub struct Foo;
|
||||
impl Item for Foo {
|
||||
// @has - '//*[@id="method.foo"]' 'default fn foo()'
|
||||
//@ has - '//*[@id="method.foo"]' 'default fn foo()'
|
||||
default fn foo() {}
|
||||
|
||||
// @has - '//*[@id="method.bar"]' 'fn bar()'
|
||||
// @!has - '//*[@id="method.bar"]' 'default fn bar()'
|
||||
//@ has - '//*[@id="method.bar"]' 'fn bar()'
|
||||
//@ !has - '//*[@id="method.bar"]' 'default fn bar()'
|
||||
fn bar() {}
|
||||
|
||||
// @has - '//*[@id="method.baz"]' 'default unsafe fn baz()'
|
||||
//@ has - '//*[@id="method.baz"]' 'default unsafe fn baz()'
|
||||
default unsafe fn baz() {}
|
||||
|
||||
// @has - '//*[@id="method.quux"]' 'unsafe fn quux()'
|
||||
// @!has - '//*[@id="method.quux"]' 'default unsafe fn quux()'
|
||||
//@ has - '//*[@id="method.quux"]' 'unsafe fn quux()'
|
||||
//@ !has - '//*[@id="method.quux"]' 'default unsafe fn quux()'
|
||||
unsafe fn quux() {}
|
||||
|
||||
// @has - '//*[@id="method.xyzzy"]' 'fn xyzzy()'
|
||||
// @!has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()'
|
||||
//@ has - '//*[@id="method.xyzzy"]' 'fn xyzzy()'
|
||||
//@ !has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()'
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
#![feature(staged_api)]
|
||||
#![stable(feature = "deprecated_future_staged_api", since = "1.0.0")]
|
||||
|
||||
// @has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecation planned'
|
||||
// @has deprecated_future_staged_api/struct.S1.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated_future_staged_api/struct.S1.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecating in 99.99.99: effectively never'
|
||||
#[deprecated(since = "99.99.99", note = "effectively never")]
|
||||
#[stable(feature = "deprecated_future_staged_api", since = "1.0.0")]
|
||||
pub struct S1;
|
||||
|
||||
// @has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecation planned'
|
||||
// @has deprecated_future_staged_api/struct.S2.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated_future_staged_api/struct.S2.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecating in a future version: literally never'
|
||||
#[deprecated(since = "TBD", note = "literally never")]
|
||||
#[stable(feature = "deprecated_future_staged_api", since = "1.0.0")]
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated_future/index.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated'
|
||||
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated since 99.99.99: effectively never'
|
||||
#[deprecated(since = "99.99.99", note = "effectively never")]
|
||||
pub struct S;
|
||||
|
@ -1,19 +1,19 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/struct.Foo0.html
|
||||
//@ has foo/struct.Foo0.html
|
||||
pub struct Foo0;
|
||||
|
||||
impl Foo0 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
|
||||
// @hasraw - 'fn_with_doc short'
|
||||
// @hasraw - 'fn_with_doc full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
|
||||
//@ hasraw - 'fn_with_doc short'
|
||||
//@ hasraw - 'fn_with_doc full'
|
||||
/// fn_with_doc short
|
||||
///
|
||||
/// fn_with_doc full
|
||||
#[deprecated(since = "1.0.1", note = "fn_with_doc")]
|
||||
pub fn fn_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc'
|
||||
#[deprecated(since = "1.0.2", note = "fn_without_doc")]
|
||||
pub fn fn_without_doc() {}
|
||||
}
|
||||
@ -47,72 +47,72 @@ pub trait Bar {
|
||||
fn fn_def_def_without_doc() {}
|
||||
}
|
||||
|
||||
// @has foo/struct.Foo1.html
|
||||
//@ has foo/struct.Foo1.html
|
||||
pub struct Foo1;
|
||||
|
||||
impl Bar for Foo1 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
// @hasraw - 'fn_empty_with_doc_impl short'
|
||||
// @hasraw - 'fn_empty_with_doc_impl full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
//@ hasraw - 'fn_empty_with_doc_impl short'
|
||||
//@ hasraw - 'fn_empty_with_doc_impl full'
|
||||
/// fn_empty_with_doc_impl short
|
||||
///
|
||||
/// fn_empty_with_doc_impl full
|
||||
fn fn_empty_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
|
||||
fn fn_empty_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
// @hasraw - 'fn_def_with_doc_impl short'
|
||||
// @hasraw - 'fn_def_with_doc_impl full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
//@ hasraw - 'fn_def_with_doc_impl short'
|
||||
//@ hasraw - 'fn_def_with_doc_impl full'
|
||||
/// fn_def_with_doc_impl short
|
||||
///
|
||||
/// fn_def_with_doc_impl full
|
||||
fn fn_def_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
|
||||
fn fn_def_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
// @hasraw - 'fn_def_def_with_doc short'
|
||||
// @!hasraw - 'fn_def_def_with_doc full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
//@ hasraw - 'fn_def_def_with_doc short'
|
||||
//@ !hasraw - 'fn_def_def_with_doc full'
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
}
|
||||
|
||||
// @has foo/struct.Foo2.html
|
||||
//@ has foo/struct.Foo2.html
|
||||
pub struct Foo2;
|
||||
|
||||
impl Bar for Foo2 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
// @hasraw - 'fn_empty_with_doc short'
|
||||
// @!hasraw - 'fn_empty_with_doc full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
//@ hasraw - 'fn_empty_with_doc short'
|
||||
//@ !hasraw - 'fn_empty_with_doc full'
|
||||
fn fn_empty_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
|
||||
// @hasraw - 'fn_empty_without_doc_impl short'
|
||||
// @hasraw - 'fn_empty_without_doc_impl full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
|
||||
//@ hasraw - 'fn_empty_without_doc_impl short'
|
||||
//@ hasraw - 'fn_empty_without_doc_impl full'
|
||||
/// fn_empty_without_doc_impl short
|
||||
///
|
||||
/// fn_empty_without_doc_impl full
|
||||
fn fn_empty_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
// @hasraw - 'fn_def_with_doc short'
|
||||
// @!hasraw - 'fn_def_with_doc full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
//@ hasraw - 'fn_def_with_doc short'
|
||||
//@ !hasraw - 'fn_def_with_doc full'
|
||||
fn fn_def_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
|
||||
// @hasraw - 'fn_def_without_doc_impl short'
|
||||
// @hasraw - 'fn_def_without_doc_impl full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
|
||||
//@ hasraw - 'fn_def_without_doc_impl short'
|
||||
//@ hasraw - 'fn_def_without_doc_impl full'
|
||||
/// fn_def_without_doc_impl short
|
||||
///
|
||||
/// fn_def_without_doc_impl full
|
||||
fn fn_def_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
// @hasraw - 'fn_def_def_with_doc short'
|
||||
// @!hasraw - 'fn_def_def_with_doc full'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
//@ hasraw - 'fn_def_def_with_doc short'
|
||||
//@ !hasraw - 'fn_def_def_with_doc full'
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
}
|
||||
|
@ -1,33 +1,33 @@
|
||||
// @has deprecated/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \
|
||||
//@ has deprecated/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \
|
||||
// 'Deprecated'
|
||||
// @has - '//*[@class="desc docblock-short"]' 'Deprecated docs'
|
||||
//@ has - '//*[@class="desc docblock-short"]' 'Deprecated docs'
|
||||
|
||||
// @has deprecated/struct.S.html '//*[@class="stab deprecated"]' \
|
||||
//@ has deprecated/struct.S.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated since 1.0.0: text'
|
||||
/// Deprecated docs
|
||||
#[deprecated(since = "1.0.0", note = "text")]
|
||||
pub struct S;
|
||||
|
||||
// @matches deprecated/index.html '//*[@class="desc docblock-short"]' '^Docs'
|
||||
//@ matches deprecated/index.html '//*[@class="desc docblock-short"]' '^Docs'
|
||||
/// Docs
|
||||
pub struct T;
|
||||
|
||||
// @matches deprecated/struct.U.html '//*[@class="stab deprecated"]' \
|
||||
//@ matches deprecated/struct.U.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated since 1.0.0$'
|
||||
#[deprecated(since = "1.0.0")]
|
||||
pub struct U;
|
||||
|
||||
// @matches deprecated/struct.V.html '//*[@class="stab deprecated"]' \
|
||||
//@ matches deprecated/struct.V.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated: text$'
|
||||
#[deprecated(note = "text")]
|
||||
pub struct V;
|
||||
|
||||
// @matches deprecated/struct.W.html '//*[@class="stab deprecated"]' \
|
||||
//@ matches deprecated/struct.W.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated$'
|
||||
#[deprecated]
|
||||
pub struct W;
|
||||
|
||||
// @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \
|
||||
//@ matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \
|
||||
// 'Deprecated: shorthand reason: code$'
|
||||
#[deprecated = "shorthand reason: `code`"]
|
||||
pub struct X;
|
||||
|
@ -11,6 +11,6 @@ impl Deref for Bar {
|
||||
fn deref(&self) -> &String { loop {} }
|
||||
}
|
||||
|
||||
// @has issue_19190_2/struct.Bar.html
|
||||
// @!has - '//*[@id="method.new"]' 'fn new() -> String'
|
||||
// @has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str'
|
||||
//@ has issue_19190_2/struct.Bar.html
|
||||
//@ !has - '//*[@id="method.new"]' 'fn new() -> String'
|
||||
//@ has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str'
|
||||
|
@ -9,19 +9,19 @@ extern crate issue_19190_3;
|
||||
use std::ops::Deref;
|
||||
use issue_19190_3::Baz;
|
||||
|
||||
// @has issue_19190_3/struct.Foo.html
|
||||
// @has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str'
|
||||
// @!has - '//*[@id="method.new"]' 'fn new() -> String'
|
||||
//@ has issue_19190_3/struct.Foo.html
|
||||
//@ has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str'
|
||||
//@ !has - '//*[@id="method.new"]' 'fn new() -> String'
|
||||
pub use issue_19190_3::Foo;
|
||||
|
||||
// @has issue_19190_3/struct.Bar.html
|
||||
// @has - '//*[@id="method.baz"]' 'fn baz(&self)'
|
||||
// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()'
|
||||
//@ has issue_19190_3/struct.Bar.html
|
||||
//@ has - '//*[@id="method.baz"]' 'fn baz(&self)'
|
||||
//@ !has - '//*[@id="method.static_baz"]' 'fn static_baz()'
|
||||
pub use issue_19190_3::Bar;
|
||||
|
||||
// @has issue_19190_3/struct.MyBar.html
|
||||
// @has - '//*[@id="method.baz"]' 'fn baz(&self)'
|
||||
// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()'
|
||||
//@ has issue_19190_3/struct.MyBar.html
|
||||
//@ has - '//*[@id="method.baz"]' 'fn baz(&self)'
|
||||
//@ !has - '//*[@id="method.static_baz"]' 'fn static_baz()'
|
||||
pub struct MyBar;
|
||||
|
||||
impl Deref for MyBar {
|
||||
|
@ -16,8 +16,8 @@ impl Deref for Bar {
|
||||
fn deref(&self) -> &Foo { loop {} }
|
||||
}
|
||||
|
||||
// @has issue_19190/struct.Bar.html
|
||||
// @has - '//*[@id="method.foo"]//h4[@class="code-header"]' 'fn foo(&self)'
|
||||
// @has - '//*[@id="method.foo"]' 'fn foo(&self)'
|
||||
// @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
|
||||
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
|
||||
//@ has issue_19190/struct.Bar.html
|
||||
//@ has - '//*[@id="method.foo"]//h4[@class="code-header"]' 'fn foo(&self)'
|
||||
//@ has - '//*[@id="method.foo"]' 'fn foo(&self)'
|
||||
//@ !has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
|
||||
//@ !has - '//*[@id="method.static_foo"]' 'fn static_foo()'
|
||||
|
@ -26,18 +26,18 @@ impl DerefMut for Bar {
|
||||
fn deref_mut(&mut self) -> &mut Foo { loop {} }
|
||||
}
|
||||
|
||||
// @has foo/struct.Bar.html
|
||||
// @has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)'
|
||||
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
|
||||
// @has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
// @has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)'
|
||||
// @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
|
||||
// @has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
// @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
// @!has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
// @!has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
// @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
|
||||
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
|
||||
//@ has foo/struct.Bar.html
|
||||
//@ has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)'
|
||||
//@ has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
|
||||
//@ has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
//@ has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
//@ has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)'
|
||||
//@ has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
|
||||
//@ has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
//@ has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
//@ !has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
//@ !has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
//@ !has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
//@ !has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
//@ !has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
|
||||
//@ !has - '//*[@id="method.static_foo"]' 'fn static_foo()'
|
||||
|
@ -21,18 +21,18 @@ impl Deref for Bar {
|
||||
fn deref(&self) -> &Foo { loop {} }
|
||||
}
|
||||
|
||||
// @has foo/struct.Bar.html
|
||||
// @has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)'
|
||||
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
|
||||
// @has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
// @!has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)'
|
||||
// @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
|
||||
// @!has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
// @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
// @!has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
// @!has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
// @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
|
||||
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
|
||||
//@ has foo/struct.Bar.html
|
||||
//@ has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)'
|
||||
//@ has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
|
||||
//@ has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
//@ has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
|
||||
//@ !has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)'
|
||||
//@ !has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
|
||||
//@ !has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
//@ !has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
|
||||
//@ !has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
//@ !has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
|
||||
//@ !has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
//@ !has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
|
||||
//@ !has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
|
||||
//@ !has - '//*[@id="method.static_foo"]' 'fn static_foo()'
|
||||
|
@ -7,13 +7,13 @@
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
// @has 'foo/struct.Bar.html'
|
||||
//@ has 'foo/struct.Bar.html'
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct Bar;
|
||||
|
||||
impl Bar {
|
||||
// @has - '//*[@id="method.len"]' 'pub const fn len(&self) -> usize'
|
||||
// @has - '//*[@id="method.len"]//span[@class="since"]' 'const: 1.0.0'
|
||||
//@ has - '//*[@id="method.len"]' 'pub const fn len(&self) -> usize'
|
||||
//@ has - '//*[@id="method.len"]//span[@class="since"]' 'const: 1.0.0'
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn len(&self) -> usize { 0 }
|
||||
@ -24,10 +24,10 @@ pub struct Foo {
|
||||
value: Bar,
|
||||
}
|
||||
|
||||
// @has 'foo/struct.Foo.html'
|
||||
// @has - '//*[@id="method.len"]' 'pub fn len(&self) -> usize'
|
||||
// @has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0'
|
||||
// @!has - '//*[@id="method.len"]//span[@class="since"]' '(const: 1.0.0)'
|
||||
//@ has 'foo/struct.Foo.html'
|
||||
//@ has - '//*[@id="method.len"]' 'pub fn len(&self) -> usize'
|
||||
//@ has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0'
|
||||
//@ !has - '//*[@id="method.len"]//span[@class="since"]' '(const: 1.0.0)'
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl std::ops::Deref for Foo {
|
||||
type Target = Bar;
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
// @has foo/struct.Vec.html
|
||||
// @count - '//h2[@id="deref-methods-Slice"]' 1
|
||||
// @count - '//div[@id="deref-methods-Slice-1"]' 1
|
||||
// @count - '//div[@id="deref-methods-Slice-1"][@class="impl-items"]' 1
|
||||
// @count - '//div[@id="deref-methods-Slice-1"]/div[@class="impl-items"]' 0
|
||||
//@ has foo/struct.Vec.html
|
||||
//@ count - '//h2[@id="deref-methods-Slice"]' 1
|
||||
//@ count - '//div[@id="deref-methods-Slice-1"]' 1
|
||||
//@ count - '//div[@id="deref-methods-Slice-1"][@class="impl-items"]' 1
|
||||
//@ count - '//div[@id="deref-methods-Slice-1"]/div[@class="impl-items"]' 0
|
||||
pub struct Vec;
|
||||
|
||||
pub struct Slice;
|
||||
|
@ -8,8 +8,8 @@ impl Foo {
|
||||
pub fn foo(&mut self) {}
|
||||
}
|
||||
|
||||
// @has foo/struct.Bar.html
|
||||
// @has - '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.foo"]' 'foo'
|
||||
//@ has foo/struct.Bar.html
|
||||
//@ has - '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.foo"]' 'foo'
|
||||
pub struct Bar {
|
||||
foo: Foo,
|
||||
}
|
||||
|
@ -2,15 +2,15 @@
|
||||
// levels and across multiple crates.
|
||||
// For `Deref` on non-foreign types, look at `deref-recursive.rs`.
|
||||
|
||||
// @has 'foo/struct.Foo.html'
|
||||
// @has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref<Target = PathBuf>'
|
||||
// @has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)'
|
||||
// @has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref<Target = Path>'
|
||||
// @has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)'
|
||||
// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref<Target=PathBuf>'
|
||||
// @has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.as_path"]' 'as_path'
|
||||
// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Path"]' 'Methods from Deref<Target=Path>'
|
||||
// @has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.exists"]' 'exists'
|
||||
//@ has 'foo/struct.Foo.html'
|
||||
//@ has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref<Target = PathBuf>'
|
||||
//@ has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)'
|
||||
//@ has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref<Target = Path>'
|
||||
//@ has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)'
|
||||
//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref<Target=PathBuf>'
|
||||
//@ has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.as_path"]' 'as_path'
|
||||
//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Path"]' 'Methods from Deref<Target=Path>'
|
||||
//@ has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.exists"]' 'exists'
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
|
@ -2,15 +2,15 @@
|
||||
// levels if needed.
|
||||
// For `Deref` on foreign types, look at `deref-recursive-pathbuf.rs`.
|
||||
|
||||
// @has 'foo/struct.Foo.html'
|
||||
// @has '-' '//*[@id="deref-methods-Bar"]' 'Methods from Deref<Target = Bar>'
|
||||
// @has '-' '//*[@class="impl-items"]//*[@id="method.bar"]' 'pub fn bar(&self)'
|
||||
// @has '-' '//*[@id="deref-methods-Baz"]' 'Methods from Deref<Target = Baz>'
|
||||
// @has '-' '//*[@class="impl-items"]//*[@id="method.baz"]' 'pub fn baz(&self)'
|
||||
// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Bar"]' 'Methods from Deref<Target=Bar>'
|
||||
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.bar"]' 'bar'
|
||||
// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Baz"]' 'Methods from Deref<Target=Baz>'
|
||||
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz'
|
||||
//@ has 'foo/struct.Foo.html'
|
||||
//@ has '-' '//*[@id="deref-methods-Bar"]' 'Methods from Deref<Target = Bar>'
|
||||
//@ has '-' '//*[@class="impl-items"]//*[@id="method.bar"]' 'pub fn bar(&self)'
|
||||
//@ has '-' '//*[@id="deref-methods-Baz"]' 'Methods from Deref<Target = Baz>'
|
||||
//@ has '-' '//*[@class="impl-items"]//*[@id="method.baz"]' 'pub fn baz(&self)'
|
||||
//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Bar"]' 'Methods from Deref<Target=Bar>'
|
||||
//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.bar"]' 'bar'
|
||||
//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Baz"]' 'Methods from Deref<Target=Baz>'
|
||||
//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz'
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user