Add missing lang items in no_core tests in rustdoc

This commit is contained in:
Michael Goulet 2025-02-03 19:00:20 +00:00
parent 0d907c17a8
commit 36839759ce
8 changed files with 31 additions and 8 deletions

View file

@ -1,4 +1,4 @@
#![feature(no_core)] #![feature(no_core, lang_items)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
#![no_core] #![no_core]
@ -6,6 +6,9 @@
//@ set impl_i32 = "$.index[*][?(@.docs=='Only core can do this')].id" //@ set impl_i32 = "$.index[*][?(@.docs=='Only core can do this')].id"
#[lang = "sized"]
trait Sized {}
/// Only core can do this /// Only core can do this
impl i32 { impl i32 {
//@ set identity = "$.index[*][?(@.docs=='Do Nothing')].id" //@ set identity = "$.index[*][?(@.docs=='Do Nothing')].id"

View file

@ -2,9 +2,12 @@
// feature. // feature.
#![deny(warnings)] #![deny(warnings)]
#![feature(no_core)] #![feature(no_core, lang_items)]
#![no_core] #![no_core]
#[lang = "sized"]
trait Sized {}
/// ```{class="} /// ```{class="}
/// main; /// main;
/// ``` /// ```

View file

@ -1,5 +1,5 @@
error: unclosed quote string `"` error: unclosed quote string `"`
--> $DIR/custom_code_classes_in_docs-warning3.rs:8:1 --> $DIR/custom_code_classes_in_docs-warning3.rs:11:1
| |
LL | / /// ```{class="} LL | / /// ```{class="}
LL | | /// main; LL | | /// main;
@ -17,7 +17,7 @@ LL | #![deny(warnings)]
= note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]` = note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]`
error: unclosed quote string `"` error: unclosed quote string `"`
--> $DIR/custom_code_classes_in_docs-warning3.rs:8:1 --> $DIR/custom_code_classes_in_docs-warning3.rs:11:1
| |
LL | / /// ```{class="} LL | / /// ```{class="}
LL | | /// main; LL | | /// main;

View file

@ -1,9 +1,12 @@
#![feature(doc_cfg)] #![feature(doc_cfg)]
#![feature(no_core)] #![feature(no_core, lang_items)]
#![crate_name = "foo"] #![crate_name = "foo"]
#![no_core] #![no_core]
#[lang = "sized"]
trait Sized {}
//@ has 'foo/index.html' //@ has 'foo/index.html'
//@ has - '//dt/*[@class="stab portability"]' 'foobar' //@ has - '//dt/*[@class="stab portability"]' 'foobar'
//@ has - '//dt/*[@class="stab portability"]' 'bar' //@ has - '//dt/*[@class="stab portability"]' 'bar'

View file

@ -2,9 +2,12 @@
//@ compile-flags: --extern-html-root-url=primitive_doc=../ -Z unstable-options //@ compile-flags: --extern-html-root-url=primitive_doc=../ -Z unstable-options
//@ only-linux //@ only-linux
#![feature(no_core)] #![feature(no_core, lang_items)]
#![no_core] #![no_core]
#[lang = "sized"]
trait Sized {}
extern crate primitive_doc; 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"]' 'usize'

View file

@ -6,8 +6,13 @@
#![rustc_coherence_is_core] #![rustc_coherence_is_core]
#![crate_type = "rlib"] #![crate_type = "rlib"]
//@ has no_doc_primitive/index.html //@ has no_doc_primitive/index.html
//! A [`char`] and its [`char::len_utf8`]. //! A [`char`] and its [`char::len_utf8`].
#[lang = "sized"]
trait Sized {}
impl char { impl char {
pub fn len_utf8(self) -> usize { pub fn len_utf8(self) -> usize {
42 42

View file

@ -1,8 +1,11 @@
// Regression test for <https://github.com/rust-lang/rust/issues/111064>. // Regression test for <https://github.com/rust-lang/rust/issues/111064>.
#![feature(no_core)] #![feature(no_core, lang_items)]
#![no_core] #![no_core]
#![crate_name = "foo"] #![crate_name = "foo"]
#[lang = "sized"]
trait Sized {}
//@ files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \ //@ files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \
// 'visible']" // 'visible']"
//@ files "foo/hidden" "['inner']" //@ files "foo/hidden" "['inner']"

View file

@ -1,10 +1,13 @@
#![feature(intrinsics)] #![feature(intrinsics)]
#![feature(no_core)] #![feature(no_core, lang_items)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![no_core] #![no_core]
#![crate_name = "foo"] #![crate_name = "foo"]
#[lang = "sized"]
trait Sized {}
//@ has 'foo/fn.abort.html' //@ has 'foo/fn.abort.html'
//@ has - '//pre[@class="rust item-decl"]' 'pub fn abort() -> !' //@ has - '//pre[@class="rust item-decl"]' 'pub fn abort() -> !'
#[rustc_intrinsic] #[rustc_intrinsic]