Auto merge of #87133 - GuillaumeGomez:rollup-pfz9jbk, r=GuillaumeGomez

Rollup of 6 pull requests

Successful merges:

 - #87027 (expand: Support helper attributes for built-in derive macros)
 - #87056 (Fix codeblocks overflow)
 - #87117 (Shrink the CrateStore dynamic interface.)
 - #87120 (rustdoc: Remove unnecessary `extern crate` aliases)
 - #87125 (Fix Ayu theme `<code>` color)
 - #87130 (Update browser-ui-test package version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2021-07-14 18:36:44 +00:00
commit e87188c252
26 changed files with 267 additions and 174 deletions

View file

@ -0,0 +1,13 @@
// The ayu theme has a different color for the "<code>" tags in the doc blocks. We need to
// check that the rule isn't applied on other "<code>" elements.
goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html
// We need to show the text, otherwise the colors aren't "computed" by the web browser.
show-text: true
// We set the theme to ayu.
local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"}
// We reload to get the text appearing and the theme applied.
reload:
assert-css: (".docblock code", {"color": "rgb(255, 180, 84)"}, ALL)
// It includes variants and the "titles" as well (for example: "impl RefUnwindSafe for AnEnum").
assert-css: ("div:not(.docblock) > code", {"color": "rgb(197, 197, 197)"}, ALL)

View file

@ -0,0 +1,8 @@
// This test ensures that codeblocks content don't overflow.
goto: file://|DOC_PATH|/lib2/sub_mod/struct.Foo.html
size: (1080, 600)
// There should be two codeblocks: a rust one and a non-rust one.
assert-count: (".docblock > .example-wrap", 2)
assert: ".docblock > .example-wrap > .language-txt"
assert: ".docblock > .example-wrap > .rust-example-rendered"
assert-css: (".docblock > .example-wrap > pre", {"width": "796px", "overflow-x": "auto"}, ALL)

View file

@ -1,3 +1,5 @@
// ignore-tidy-linelength
pub mod module {
pub mod sub_module {
pub mod sub_sub_module {
@ -32,4 +34,16 @@ impl Trait for Foo {
const Y: u32 = 0;
}
impl implementors::Whatever for Foo {}
pub mod sub_mod {
/// ```txt
/// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
/// ```
///
/// ```
/// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
/// ```
pub struct Foo;
}

View file

@ -96,6 +96,7 @@ pub fn check_list_code_block() {}
#[doc(cfg(unix))]
pub fn replaced_function() {}
/// Some doc with `code`!
pub enum AnEnum {
WithVariants { and: usize, sub: usize, variants: usize },
}

View file

@ -0,0 +1,36 @@
// check-pass
// compile-flags: --crate-type=lib
#![feature(decl_macro)]
#![feature(lang_items)]
#![feature(no_core)]
#![feature(rustc_attrs)]
#![no_core]
#[rustc_builtin_macro]
macro derive() {}
#[rustc_builtin_macro(Default, attributes(default))]
macro Default() {}
mod default {
pub trait Default {
fn default() -> Self;
}
impl Default for u8 {
fn default() -> u8 {
0
}
}
}
#[lang = "sized"]
trait Sized {}
#[derive(Default)]
struct S {
#[default] // OK
field: u8,
}