rust/tests/rustdoc-json/trait_alias.rs
2024-07-07 15:02:30 +01:00

19 lines
631 B
Rust

// ignore-tidy-linelength
#![feature(trait_alias)]
// @set StrLike = "$.index[*][?(@.name=='StrLike')].id"
// @is "$.index[*][?(@.name=='StrLike')].visibility" \"public\"
// @has "$.index[*][?(@.name=='StrLike')].inner.trait_alias"
// @is "$.index[*][?(@.name=='StrLike')].span.filename" $FILE
pub trait StrLike = AsRef<str>;
// @is "$.index[*][?(@.name=='f')].inner.function.decl.output.impl_trait[0].trait_bound.trait.id" $StrLike
pub fn f() -> impl StrLike {
"heya"
}
// @!is "$.index[*][?(@.name=='g')].inner.function.decl.output.impl_trait[0].trait_bound.trait.id" $StrLike
pub fn g() -> impl AsRef<str> {
"heya"
}