1
Fork 0

Update tests/rustdoc to new test syntax

This commit is contained in:
Guillaume Gomez 2024-06-21 14:03:08 +02:00
parent d3ec92e16e
commit 1b67035579
627 changed files with 4376 additions and 4376 deletions

View file

@ -9,7 +9,7 @@
use std::marker::ConstParamTy;
// @has hide_complex_unevaluated_const_arguments/trait.Stage.html
//@ has hide_complex_unevaluated_const_arguments/trait.Stage.html
pub trait Stage {
// A helper constant that prevents const expressions containing it
// from getting fully evaluated since it doesn't have a body and
@ -29,12 +29,12 @@ pub trait Stage {
// This assoc. const could leak the private assoc. function `Struct::new`.
// Ensure that this does not happen.
//
// @has - '//*[@id="associatedconstant.ARRAY1"]' \
//@ has - '//*[@id="associatedconstant.ARRAY1"]' \
// 'const ARRAY1: [u8; { _ }]'
const ARRAY1: [u8; Struct::new(/* ... */).do_something(Self::ABSTRACT * 1_000)]
where [(); Struct::new(/* ... */).do_something(Self::ABSTRACT * 1_000)]:;
// @has - '//*[@id="associatedconstant.VERBOSE"]' \
//@ has - '//*[@id="associatedconstant.VERBOSE"]' \
// 'const VERBOSE: [u16; { _ }]'
const VERBOSE: [u16; compute("thing", 9 + 9) * Self::ABSTRACT]
where [(); compute("thing", 9 + 9) * Self::ABSTRACT]:;
@ -44,7 +44,7 @@ pub trait Stage {
// (e.g. printing sth. akin to `<Self as Helper<{ _ }>>::OUT`) but
// right now “safe is safe”.
//
// @has - '//*[@id="associatedconstant.PATH"]' \
//@ has - '//*[@id="associatedconstant.PATH"]' \
// 'const PATH: usize = _'
const PATH: usize = <Self as Helper<{ Struct { private: () } }>>::OUT;
}
@ -66,7 +66,7 @@ impl<const S: Struct, St: Stage + ?Sized> Helper<S> for St {
// If rustdoc gets patched to evaluate const arguments, it is fine to replace
// this test as long as one can ensure that private fields are not leaked!
//
// @has hide_complex_unevaluated_const_arguments/trait.Sub.html \
//@ has hide_complex_unevaluated_const_arguments/trait.Sub.html \
// '//pre[@class="rust item-decl"]' \
// 'pub trait Sub: Sup<{ _ }, { _ }> { }'
pub trait Sub: Sup<{ 90 * 20 * 4 }, { Struct { private: () } }> {}