rust/tests/rustdoc-json/trait_alias.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
629 B
Rust
Raw Normal View History

// 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.sig.output.impl_trait[0].trait_bound.trait.id" $StrLike
pub fn f() -> impl StrLike {
"heya"
}
//@ !is "$.index[*][?(@.name=='g')].inner.function.sig.output.impl_trait[0].trait_bound.trait.id" $StrLike
pub fn g() -> impl AsRef<str> {
"heya"
}