rust/tests/rustdoc/intra-doc/prim-self.rs

42 lines
928 B
Rust
Raw Normal View History

#![deny(rustdoc::broken_intra_doc_links)]
2022-03-15 10:32:52 -05:00
#![rustc_coherence_is_core]
#![allow(incomplete_features)] // inherent_associated_types
2022-03-15 10:56:46 -05:00
#![feature(rustc_attrs)]
#![feature(no_core)]
#![feature(rustdoc_internals)]
#![feature(inherent_associated_types)]
#![feature(lang_items)]
#![no_core]
/// [Self::f]
/// [Self::MAX]
// @has prim_self/primitive.usize.html
// @has - '//a[@href="primitive.usize.html#method.f"]' 'Self::f'
// @has - '//a[@href="primitive.usize.html#associatedconstant.MAX"]' 'Self::MAX'
impl usize {
/// Some docs
pub fn f() {}
/// 10 and 2^32 are basically the same.
pub const MAX: usize = 10;
// @has - '//a[@href="primitive.usize.html#associatedtype.ME"]' 'Self::ME'
/// [Self::ME]
pub type ME = usize;
}
2023-03-21 10:44:06 -05:00
#[rustc_doc_primitive = "usize"]
/// This has some docs.
mod usize {}
/// [S::f]
/// [Self::f]
pub struct S;
impl S {
pub fn f() {}
}
#[lang = "sized"]
pub trait Sized {}