diff options
| author | bors <bors@rust-lang.org> | 2020-07-17 21:10:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-07-17 21:10:14 +0000 |
| commit | d3df8512d2c2afc6d2e7d8b5b951dd7f2ad77b02 (patch) | |
| tree | 2d4c9ecdcd068e028ae8367e165b9d54a8669633 /src/librustdoc | |
| parent | 39d5a61f2e4e237123837f5162cc275c2fd7e625 (diff) | |
| parent | c587386fd6eb21b5cc53cad2456e9745ec327855 (diff) | |
Auto merge of #74461 - Manishearth:rollup-xadbh00, r=Manishearth
Rollup of 18 pull requests Successful merges: - #71670 (Enforce even more the code blocks attributes check through rustdoc) - #73930 (Make some Option methods const) - #74009 (Fix MinGW `run-make-fulldeps` tests) - #74056 (Add Arguments::as_str().) - #74169 (Stop processing unreachable blocks when solving dataflow) - #74251 (Teach bootstrap about target files vs target triples) - #74288 (Fix src/test/run-make/static-pie/test-aslr.rs) - #74300 (Use intra-doc links in core::iter module) - #74364 (add lazy normalization regression tests) - #74368 (Add CSS tidy check) - #74394 (Remove leftover from emscripten fastcomp support) - #74411 (Don't assign `()` to `!` MIR locals) - #74416 (Use an UTF-8 locale for the linker.) - #74424 (Move hir::Place to librustc_middle/hir) - #74428 (docs: better demonstrate that None values are skipped as many times a…) - #74438 (warn about uninitialized multi-variant enums) - #74440 (Fix Arc::as_ptr docs) - #74452 (intra-doc links: resolve modules in the type namespace) Failed merges: r? @ghost
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/core.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/static/normalize.css | 1 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 23 | ||||
| -rw-r--r-- | src/librustdoc/html/static/themes/ayu.css | 118 | ||||
| -rw-r--r-- | src/librustdoc/html/static/themes/dark.css | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/static/themes/light.css | 6 | ||||
| -rw-r--r-- | src/librustdoc/passes/collect_intra_doc_links.rs | 23 | ||||
| -rw-r--r-- | src/librustdoc/test.rs | 6 |
8 files changed, 102 insertions, 87 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index bbe2555d56c..263909d5559 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -320,7 +320,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name; let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name; let no_crate_level_docs = rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS.name; - let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name; + let invalid_codeblock_attributes_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name; // In addition to those specific lints, we also need to allow those given through // command line, otherwise they'll get ignored and we don't want that. @@ -330,12 +330,12 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt missing_doc_example.to_owned(), private_doc_tests.to_owned(), no_crate_level_docs.to_owned(), - invalid_codeblock_attribute_name.to_owned(), + invalid_codeblock_attributes_name.to_owned(), ]; let (lint_opts, lint_caps) = init_lints(allowed_lints, lint_opts, |lint| { if lint.name == intra_link_resolution_failure_name - || lint.name == invalid_codeblock_attribute_name + || lint.name == invalid_codeblock_attributes_name { None } else { diff --git a/src/librustdoc/html/static/normalize.css b/src/librustdoc/html/static/normalize.css index 2804c26a296..0e042627918 100644 --- a/src/librustdoc/html/static/normalize.css +++ b/src/librustdoc/html/static/normalize.css @@ -1 +1,2 @@ +/* ignore-tidy-linelength */ /*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index f5551446bf2..38709b445ef 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -49,9 +49,9 @@ } * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } /* This part handles the "default" theme being used depending on the system one. */ @@ -91,7 +91,8 @@ h2 { h3 { font-size: 1.3em; } -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), +h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { font-weight: 500; margin: 20px 0 15px 0; padding-bottom: 6px; @@ -103,7 +104,8 @@ h1.fqn { h1.fqn > .in-band > a:hover { text-decoration: underline; } -h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), +h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { border-bottom: 1px solid; } h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant { @@ -1123,7 +1125,7 @@ h3 > .collapse-toggle, h4 > .collapse-toggle { /* The margin on the tooltip does not capture hover events, this extends the area of hover enough so that mouse hover is not lost when moving the mouse to the tooltip */ - content: "\00a0\00a0\00a0"; + content: "\00a0\00a0\00a0"; } .important-traits .important, .important-traits .docblock { @@ -1131,13 +1133,12 @@ h3 > .collapse-toggle, h4 > .collapse-toggle { } .important-traits .docblock code.content{ - margin: 0; - padding: 0; - font-size: 20px; + margin: 0; + padding: 0; + font-size: 20px; } -/* Example code has the "Run" button that - needs to be positioned relative to the pre */ +/* Example code has the "Run" button that needs to be positioned relative to the pre */ pre.rust.rust-example-rendered { position: relative; } diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/themes/ayu.css index 1326acec51c..e0ab7170ea8 100644 --- a/src/librustdoc/html/static/themes/ayu.css +++ b/src/librustdoc/html/static/themes/ayu.css @@ -10,7 +10,8 @@ body { color: #c5c5c5; } -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), +h4:not(.method):not(.type):not(.tymethod) { color: white; } h1.fqn { @@ -41,13 +42,13 @@ h3 > code, h4 > code, h5 > code { color: #e6e1cf; } pre > code { - color: #e6e1cf; + color: #e6e1cf; } span code { - color: #e6e1cf; + color: #e6e1cf; } .docblock a > code { - color: #39AFD7 !important; + color: #39AFD7 !important; } .docblock code, .docblock-short code { background-color: #191f26; @@ -100,11 +101,11 @@ pre { } .sidebar-elems .location { - color: #ff7733; + color: #ff7733; } .sidebar-elems .location a { - color: #fff; + color: #fff; } .sidebar .version { @@ -123,9 +124,9 @@ pre { .line-numbers span { color: #5c6773ab; } .line-numbers .line-highlighted { - background-color: rgba(255, 236, 164, 0.06) !important; - padding-right: 4px; - border-right: 1px solid #ffb44c; + background-color: rgba(255, 236, 164, 0.06) !important; + padding-right: 4px; + border-right: 1px solid #ffb44c; } .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { @@ -168,31 +169,31 @@ pre { .content span.keyword, .content a.keyword { color: #de5249; } .content span.externcrate, .content span.mod, .content a.mod { - color: #acccf9; + color: #acccf9; } .content span.struct, .content a.struct { - color: #ffa0a5; + color: #ffa0a5; } .content span.enum, .content a.enum { - color: #99e0c9; + color: #99e0c9; } .content span.trait, .content a.trait { - color: #39AFD7; + color: #39AFD7; } .content span.type, .content a.type { - color: #cfbcf5; + color: #cfbcf5; } .content span.fn, .content a.fn, .content span.method, .content a.method, .content span.tymethod, .content a.tymethod, .content .fnname { - color: #fdd687; + color: #fdd687; } .content span.attr, .content a.attr, .content span.derive, .content a.derive, .content span.macro, .content a.macro { - color: #a37acc; + color: #a37acc; } -pre.rust .comment, pre.rust .doccomment { +pre.rust .comment, pre.rust .doccomment { color: #788797; font-style: italic; } @@ -228,14 +229,24 @@ a { } .search-input { - color: #ffffff; - background-color: #141920; - box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent; - transition: box-shadow 150ms ease-in-out; + color: #ffffff; + background-color: #141920; + box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent; + transition: box-shadow 150ms ease-in-out; } #crate-search+.search-input:focus { - box-shadow: 0 0 0 1px #148099,0 0 0 2px transparent; + box-shadow: 0 0 0 1px #148099,0 0 0 2px transparent; + color: #ffffff; + background-color: #141920; + box-shadow: none; + transition: box-shadow 150ms ease-in-out; + border-radius: 4px; + margin-left: 8px; +} + +#crate-search+.search-input:focus { + box-shadow: 0px 6px 20px 0px black; } .search-focus:disabled { @@ -249,7 +260,7 @@ a { .stab.unstable, .stab.deprecated, .stab.portability { - color: #c5c5c5; + color: #c5c5c5; background: #314559 !important; border-style: none !important; border-radius: 4px; @@ -262,10 +273,10 @@ a { } #help > div { - background: #14191f; - box-shadow: 0px 6px 20px 0px black; - border: none; - border-radius: 4px; + background: #14191f; + box-shadow: 0px 6px 20px 0px black; + border: none; + border-radius: 4px; } .since { @@ -288,14 +299,14 @@ pre.rust .question-mark { color: #ff9011; } pre.rust .self { - color: #36a3d9; - font-style: italic; + color: #36a3d9; + font-style: italic; } pre.rust .attribute { - color: #e6e1cf; + color: #e6e1cf; } pre.rust .attribute .ident, pre.rust .attribute .op { - color: #e6e1cf; + color: #e6e1cf; } .example-wrap > pre.line-number { @@ -304,15 +315,15 @@ pre.rust .attribute .ident, pre.rust .attribute .op { } a.test-arrow { - font-size: 100%; - color: #788797; - border-radius: 4px; - background-color: rgba(255, 255, 255, 0); + font-size: 100%; + color: #788797; + border-radius: 4px; + background-color: rgba(255, 255, 255, 0); } a.test-arrow:hover { - background-color: rgba(242, 151, 24, 0.05); - color: #ffb44c; + background-color: rgba(242, 151, 24, 0.05); + color: #ffb44c; } .toggle-label { @@ -377,9 +388,9 @@ pre.ignore:hover, .information:hover + pre.ignore { } .tooltip .tooltiptext { - background-color: #314559; - color: #c5c5c5; - border: 1px solid #5c6773; + background-color: #314559; + color: #c5c5c5; + border: 1px solid #5c6773; } .tooltip .tooltiptext::after { @@ -387,12 +398,12 @@ pre.ignore:hover, .information:hover + pre.ignore { } .important-traits-tooltiptext { - background-color: #314559; - border-color: #5c6773; + background-color: #314559; + border-color: #5c6773; } #titles > div.selected { - background-color: #141920 !important; + background-color: #141920 !important; border-bottom: 1px solid #ffb44c !important; border-top: none; } @@ -403,7 +414,7 @@ pre.ignore:hover, .information:hover + pre.ignore { } #titles > div:hover { - border-bottom: 1px solid rgba(242, 151, 24, 0.3); + border-bottom: 1px solid rgba(242, 151, 24, 0.3); } #titles > div > div.count { @@ -413,12 +424,13 @@ pre.ignore:hover, .information:hover + pre.ignore { /* rules that this theme does not need to set, here to satisfy the rule checker */ /* note that a lot of these are partially set in some way (meaning they are set individually rather than as a group) */ -/* TODO: these rules should be at the bottom of the file but currently must be +/* FIXME: these rules should be at the bottom of the file but currently must be above the `@media (max-width: 700px)` rules due to a bug in the css checker */ /* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */ .content .highlighted.mod, .content .highlighted.externcrate {} .search-input:focus {} -.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro {} +.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive, +.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro {} .content .highlighted.trait {} .content span.struct,.content a.struct,.block a.current.struct {} #titles>div:hover,#titles>div.selected {} @@ -433,16 +445,20 @@ pre.rust .lifetime {} .content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod {} h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod) {} .content span.enum,.content a.enum,.block a.current.enum {} -.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static {} +.content span.constant,.content a.constant,.block a.current.constant,.content span.static, +.content a.static,.block a.current.static {} .content span.keyword,.content a.keyword,.block a.current.keyword {} pre.rust .comment {} .content .highlighted.enum {} .content .highlighted.struct {} .content .highlighted.keyword {} .content span.traitalias,.content a.traitalias,.block a.current.traitalias {} -.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname {} +.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method, +.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod, +.content .fnname {} pre.rust .kw {} -pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident {} +pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute, +pre.rust .attribute .ident {} .content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype {} pre.rust .doccomment {} .stab.deprecated {} @@ -483,11 +499,11 @@ kbd { #theme-picker, #settings-menu { border-color: #5c6773; - background-color: #0f1419; + background-color: #0f1419; } #theme-picker > img, #settings-menu > img { - filter: invert(100); + filter: invert(100); } #theme-picker:hover, #theme-picker:focus, diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index dc15220aa06..33c0f885fa9 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -3,13 +3,15 @@ body { color: #ddd; } -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), +h4:not(.method):not(.type):not(.tymethod) { color: #ddd; } h1.fqn { border-bottom-color: #d2d2d2; } -h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), +h4:not(.method):not(.type):not(.tymethod) { border-bottom-color: #d2d2d2; } diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css index 64d59ca411a..569ce7da209 100644 --- a/src/librustdoc/html/static/themes/light.css +++ b/src/librustdoc/html/static/themes/light.css @@ -5,13 +5,15 @@ body { color: black; } -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), +h4:not(.method):not(.type):not(.tymethod) { color: black; } h1.fqn { border-bottom-color: #D5D5D5; } -h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { +h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), +h4:not(.method):not(.type):not(.tymethod) { border-bottom-color: #DDDDDD; } diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index b1db1328392..e187b9251f7 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -584,25 +584,18 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> { let (res, fragment) = { let mut kind = None; let mut disambiguator = None; - path_str = if let Some(prefix) = ["struct@", "enum@", "type@", "trait@", "union@"] - .iter() - .find(|p| link.starts_with(**p)) + path_str = if let Some(prefix) = + ["struct@", "enum@", "type@", "trait@", "union@", "module@", "mod@"] + .iter() + .find(|p| link.starts_with(**p)) { kind = Some(TypeNS); disambiguator = Some(&prefix[..prefix.len() - 1]); link.trim_start_matches(prefix) - } else if let Some(prefix) = [ - "const@", - "static@", - "value@", - "function@", - "mod@", - "fn@", - "module@", - "method@", - ] - .iter() - .find(|p| link.starts_with(**p)) + } else if let Some(prefix) = + ["const@", "static@", "value@", "function@", "fn@", "method@"] + .iter() + .find(|p| link.starts_with(**p)) { kind = Some(ValueNS); disambiguator = Some(&prefix[..prefix.len() - 1]); diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index c2d644bdd05..e8ea7199710 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -45,14 +45,14 @@ pub struct TestOptions { pub fn run(options: Options) -> Result<(), String> { let input = config::Input::File(options.input.clone()); - let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name; + let invalid_codeblock_attributes_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name; // In addition to those specific lints, we also need to allow those given through // command line, otherwise they'll get ignored and we don't want that. - let allowed_lints = vec![invalid_codeblock_attribute_name.to_owned()]; + let allowed_lints = vec![invalid_codeblock_attributes_name.to_owned()]; let (lint_opts, lint_caps) = init_lints(allowed_lints, options.lint_opts.clone(), |lint| { - if lint.name == invalid_codeblock_attribute_name { + if lint.name == invalid_codeblock_attributes_name { None } else { Some((lint.name_lower(), lint::Allow)) |
