Skip to content

Commit 4a12d10

Browse files
committedSep 17, 2022
Auto merge of #101928 - notriddle:rollup-pexhhxe, r=notriddle
Rollup of 8 pull requests Successful merges: - #101340 (Adding Fuchsia zxdb debugging walkthrough to docs) - #101741 (Adding needs-unwind arg to applicable compiler ui tests) - #101782 (Update `symbol_mangling` diagnostics migration) - #101878 (More simple formatting) - #101898 (Remove some unused CSS rules) - #101911 (rustdoc: remove no-op CSS on `.source .content`) - #101914 (rustdoc-json-types: Document that ResolvedPath can also be a union) - #101921 (Pass --cfg=bootstrap for rustdoc for proc_macro crates) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
·
1.88.01.65.0
2 parents c524c7d + cafca7d commit 4a12d10

34 files changed

+307
-212
lines changed
 

‎compiler/rustc_ast/src/ast.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,15 +2088,15 @@ pub enum InlineAsmRegOrRegClass {
20882088
bitflags::bitflags! {
20892089
#[derive(Encodable, Decodable, HashStable_Generic)]
20902090
pub struct InlineAsmOptions: u16 {
2091-
const PURE = 1 << 0;
2092-
const NOMEM = 1 << 1;
2093-
const READONLY = 1 << 2;
2091+
const PURE = 1 << 0;
2092+
const NOMEM = 1 << 1;
2093+
const READONLY = 1 << 2;
20942094
const PRESERVES_FLAGS = 1 << 3;
2095-
const NORETURN = 1 << 4;
2096-
const NOSTACK = 1 << 5;
2097-
const ATT_SYNTAX = 1 << 6;
2098-
const RAW = 1 << 7;
2099-
const MAY_UNWIND = 1 << 8;
2095+
const NORETURN = 1 << 4;
2096+
const NOSTACK = 1 << 5;
2097+
const ATT_SYNTAX = 1 << 6;
2098+
const RAW = 1 << 7;
2099+
const MAY_UNWIND = 1 << 8;
21002100
}
21012101
}
21022102

‎compiler/rustc_ast/src/util/parser.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,11 @@ impl ExprPrecedence {
297297
match self {
298298
ExprPrecedence::Closure => PREC_CLOSURE,
299299

300-
ExprPrecedence::Break |
301-
ExprPrecedence::Continue |
302-
ExprPrecedence::Ret |
303-
ExprPrecedence::Yield |
304-
ExprPrecedence::Yeet => PREC_JUMP,
300+
ExprPrecedence::Break
301+
| ExprPrecedence::Continue
302+
| ExprPrecedence::Ret
303+
| ExprPrecedence::Yield
304+
| ExprPrecedence::Yeet => PREC_JUMP,
305305

306306
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
307307
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
@@ -318,43 +318,43 @@ impl ExprPrecedence {
318318
ExprPrecedence::AssignOp => AssocOp::Assign.precedence() as i8,
319319

320320
// Unary, prefix
321-
ExprPrecedence::Box |
322-
ExprPrecedence::AddrOf |
321+
ExprPrecedence::Box
322+
| ExprPrecedence::AddrOf
323323
// Here `let pats = expr` has `let pats =` as a "unary" prefix of `expr`.
324324
// However, this is not exactly right. When `let _ = a` is the LHS of a binop we
325325
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
326326
// but we need to print `(let _ = a) < b` as-is with parens.
327-
ExprPrecedence::Let |
328-
ExprPrecedence::Unary => PREC_PREFIX,
327+
| ExprPrecedence::Let
328+
| ExprPrecedence::Unary => PREC_PREFIX,
329329

330330
// Unary, postfix
331-
ExprPrecedence::Await |
332-
ExprPrecedence::Call |
333-
ExprPrecedence::MethodCall |
334-
ExprPrecedence::Field |
335-
ExprPrecedence::Index |
336-
ExprPrecedence::Try |
337-
ExprPrecedence::InlineAsm |
338-
ExprPrecedence::Mac => PREC_POSTFIX,
331+
ExprPrecedence::Await
332+
| ExprPrecedence::Call
333+
| ExprPrecedence::MethodCall
334+
| ExprPrecedence::Field
335+
| ExprPrecedence::Index
336+
| ExprPrecedence::Try
337+
| ExprPrecedence::InlineAsm
338+
| ExprPrecedence::Mac => PREC_POSTFIX,
339339

340340
// Never need parens
341-
ExprPrecedence::Array |
342-
ExprPrecedence::Repeat |
343-
ExprPrecedence::Tup |
344-
ExprPrecedence::Lit |
345-
ExprPrecedence::Path |
346-
ExprPrecedence::Paren |
347-
ExprPrecedence::If |
348-
ExprPrecedence::While |
349-
ExprPrecedence::ForLoop |
350-
ExprPrecedence::Loop |
351-
ExprPrecedence::Match |
352-
ExprPrecedence::ConstBlock |
353-
ExprPrecedence::Block |
354-
ExprPrecedence::TryBlock |
355-
ExprPrecedence::Async |
356-
ExprPrecedence::Struct |
357-
ExprPrecedence::Err => PREC_PAREN,
341+
ExprPrecedence::Array
342+
| ExprPrecedence::Repeat
343+
| ExprPrecedence::Tup
344+
| ExprPrecedence::Lit
345+
| ExprPrecedence::Path
346+
| ExprPrecedence::Paren
347+
| ExprPrecedence::If
348+
| ExprPrecedence::While
349+
| ExprPrecedence::ForLoop
350+
| ExprPrecedence::Loop
351+
| ExprPrecedence::Match
352+
| ExprPrecedence::ConstBlock
353+
| ExprPrecedence::Block
354+
| ExprPrecedence::TryBlock
355+
| ExprPrecedence::Async
356+
| ExprPrecedence::Struct
357+
| ExprPrecedence::Err => PREC_PAREN,
358358
}
359359
}
360360
}
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
symbol_mangling_invalid_symbol_name = symbol-name({$mangled_formatted})
2-
3-
symbol_mangling_invalid_trait_item = demangling({$demangling_formatted})
4-
5-
symbol_mangling_alt_invalid_trait_item = demangling-alt({$alt_demangling_formatted})
6-
7-
symbol_mangling_invalid_def_path = def-path({$def_path})
1+
symbol_mangling_test_output = {$kind}({$content})

‎compiler/rustc_hir/src/hir.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ impl LifetimeName {
139139
match self {
140140
LifetimeName::ImplicitObjectLifetimeDefault | LifetimeName::Infer => true,
141141

142-
// It might seem surprising that `Fresh` counts as
143-
// *not* elided -- but this is because, as far as the code
144-
// in the compiler is concerned -- `Fresh` variants act
145-
// equivalently to "some fresh name". They correspond to
146-
// early-bound regions on an impl, in other words.
142+
// It might seem surprising that `Fresh` counts as not *elided*
143+
// -- but this is because, as far as the code in the compiler is
144+
// concerned -- `Fresh` variants act equivalently to "some fresh name".
145+
// They correspond to early-bound regions on an impl, in other words.
147146
LifetimeName::Error | LifetimeName::Param(..) | LifetimeName::Static => false,
148147
}
149148
}

‎compiler/rustc_passes/src/check_attr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,8 @@ impl CheckAttrVisitor<'_> {
16661666
E0552,
16671667
"unrecognized representation hint"
16681668
)
1669-
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
1669+
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, \
1670+
`i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
16701671
.emit();
16711672

16721673
continue;
Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
11
//! Errors emitted by symbol_mangling.
22
3+
use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
34
use rustc_macros::SessionDiagnostic;
45
use rustc_span::Span;
56

67
#[derive(SessionDiagnostic)]
7-
#[diag(symbol_mangling::invalid_symbol_name)]
8-
pub struct InvalidSymbolName {
8+
#[diag(symbol_mangling::test_output)]
9+
pub struct TestOutput {
910
#[primary_span]
1011
pub span: Span,
11-
pub mangled_formatted: String,
12+
pub kind: Kind,
13+
pub content: String,
1214
}
1315

14-
#[derive(SessionDiagnostic)]
15-
#[diag(symbol_mangling::invalid_trait_item)]
16-
pub struct InvalidTraitItem {
17-
#[primary_span]
18-
pub span: Span,
19-
pub demangling_formatted: String,
16+
pub enum Kind {
17+
SymbolName,
18+
Demangling,
19+
DemanglingAlt,
20+
DefPath,
2021
}
2122

22-
#[derive(SessionDiagnostic)]
23-
#[diag(symbol_mangling::alt_invalid_trait_item)]
24-
pub struct AltInvalidTraitItem {
25-
#[primary_span]
26-
pub span: Span,
27-
pub alt_demangling_formatted: String,
28-
}
29-
30-
#[derive(SessionDiagnostic)]
31-
#[diag(symbol_mangling::invalid_def_path)]
32-
pub struct InvalidDefPath {
33-
#[primary_span]
34-
pub span: Span,
35-
pub def_path: String,
23+
impl IntoDiagnosticArg for Kind {
24+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
25+
let kind = match self {
26+
Kind::SymbolName => "symbol-name",
27+
Kind::Demangling => "demangling",
28+
Kind::DemanglingAlt => "demangling-alt",
29+
Kind::DefPath => "def-path",
30+
}
31+
.into();
32+
DiagnosticArgValue::Str(kind)
33+
}
3634
}

‎compiler/rustc_symbol_mangling/src/test.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! def-path. This is used for unit testing the code that generates
55
//! paths etc in all kinds of annoying scenarios.
66
7-
use crate::errors::{AltInvalidTraitItem, InvalidDefPath, InvalidSymbolName, InvalidTraitItem};
7+
use crate::errors::{Kind, TestOutput};
88
use rustc_hir::def_id::LocalDefId;
99
use rustc_middle::ty::print::with_no_trimmed_paths;
1010
use rustc_middle::ty::{subst::InternalSubsts, Instance, TyCtxt};
@@ -60,26 +60,30 @@ impl SymbolNamesTest<'_> {
6060
tcx.erase_regions(InternalSubsts::identity_for_item(tcx, def_id)),
6161
);
6262
let mangled = tcx.symbol_name(instance);
63-
tcx.sess.emit_err(InvalidSymbolName {
63+
tcx.sess.emit_err(TestOutput {
6464
span: attr.span,
65-
mangled_formatted: format!("{mangled}"),
65+
kind: Kind::SymbolName,
66+
content: format!("{mangled}"),
6667
});
6768
if let Ok(demangling) = rustc_demangle::try_demangle(mangled.name) {
68-
tcx.sess.emit_err(InvalidTraitItem {
69+
tcx.sess.emit_err(TestOutput {
6970
span: attr.span,
70-
demangling_formatted: format!("{demangling}"),
71+
kind: Kind::Demangling,
72+
content: format!("{demangling}"),
7173
});
72-
tcx.sess.emit_err(AltInvalidTraitItem {
74+
tcx.sess.emit_err(TestOutput {
7375
span: attr.span,
74-
alt_demangling_formatted: format!("{:#}", demangling),
76+
kind: Kind::DemanglingAlt,
77+
content: format!("{:#}", demangling),
7578
});
7679
}
7780
}
7881

7982
for attr in tcx.get_attrs(def_id.to_def_id(), DEF_PATH) {
80-
tcx.sess.emit_err(InvalidDefPath {
83+
tcx.sess.emit_err(TestOutput {
8184
span: attr.span,
82-
def_path: with_no_trimmed_paths!(tcx.def_path_str(def_id.to_def_id())),
85+
kind: Kind::DefPath,
86+
content: with_no_trimmed_paths!(tcx.def_path_str(def_id.to_def_id())),
8387
});
8488
}
8589
}

‎src/bootstrap/bin/rustc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ fn main() {
139139
// Cargo doesn't pass RUSTFLAGS to proc_macros:
140140
// https://github.com/rust-lang/cargo/issues/4423
141141
// Thus, if we are on stage 0, we explicitly set `--cfg=bootstrap`.
142-
// We also declare that the flag is expected, which is mainly needed for
143-
// later stages so that they don't warn about #[cfg(bootstrap)],
144-
// but enabling it for stage 0 too lets any warnings, if they occur,
145-
// occur more early on, e.g. about #[cfg(bootstrap = "foo")].
142+
// We also declare that the flag is expected, which we need to do to not
143+
// get warnings about it being unexpected.
146144
if stage == "0" {
147145
cmd.arg("--cfg=bootstrap");
148146
}

‎src/bootstrap/bin/rustdoc.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ include!("../dylib_util.rs");
1111

1212
fn main() {
1313
let args = env::args_os().skip(1).collect::<Vec<_>>();
14+
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
1415
let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
1516
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
1617
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
@@ -62,6 +63,16 @@ fn main() {
6263
cmd.arg("-Clink-arg=-Wl,--threads=1");
6364
}
6465
}
66+
// Cargo doesn't pass RUSTDOCFLAGS to proc_macros:
67+
// https://github.com/rust-lang/cargo/issues/4423
68+
// Thus, if we are on stage 0, we explicitly set `--cfg=bootstrap`.
69+
// We also declare that the flag is expected, which we need to do to not
70+
// get warnings about it being unexpected.
71+
if stage == "0" {
72+
cmd.arg("--cfg=bootstrap");
73+
}
74+
cmd.arg("-Zunstable-options");
75+
cmd.arg("--check-cfg=values(bootstrap)");
6576

6677
if verbose > 1 {
6778
eprintln!(

‎src/doc/rustc/src/platform-support/fuchsia.md

Lines changed: 135 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ authoritative if this occurs. Instead of pinging individual members, use
4242
1. [Testing](#testing)
4343
1. [Running unit tests](#running-unit-tests)
4444
1. [Running the compiler test suite](#running-the-compiler-test-suite)
45+
1. [Debugging](#debugging)
46+
1. [`zxdb`](#zxdb)
47+
1. [Attaching `zxdb`](#attaching-zxdb)
48+
1. [Using `zxdb`](#using-zxdb)
49+
1. [Displaying source code in `zxdb`](#displaying-source-code-in-zxdb)
4550

4651
## Requirements
4752

@@ -136,7 +141,7 @@ These options configure the following:
136141

137142
* `-Lnative=${SDK_PATH}/arch/${ARCH}/lib`: Link against Fuchsia libraries from
138143
the SDK
139-
* `-Lnative=${SDK_PATH}/arch/${ARCH}/sysroot/lib`: Link against Fuchsia kernel
144+
* `-Lnative=${SDK_PATH}/arch/${ARCH}/sysroot/lib`: Link against Fuchsia sysroot
140145
libraries from the SDK
141146

142147
In total, our new project will look like:
@@ -253,7 +258,7 @@ the following options:
253258
platform of your choice
254259
* `-Lnative ${SDK_PATH}/arch/${ARCH}/lib`: Link against Fuchsia libraries from
255260
the SDK
256-
* `-Lnative ${SDK_PATH}/arch/${ARCH}/sysroot/lib`: Link against Fuchsia kernel
261+
* `-Lnative ${SDK_PATH}/arch/${ARCH}/sysroot/lib`: Link against Fuchsia sysroot
257262
libraries from the SDK
258263

259264
Putting it all together:
@@ -639,6 +644,130 @@ available on the [Fuchsia devsite].
639644
Running the Rust test suite on Fuchsia is [not currently supported], but work is
640645
underway to enable it.
641646

647+
## Debugging
648+
649+
### `zxdb`
650+
651+
Debugging components running on a Fuchsia emulator can be done using the
652+
console-mode debugger: [zxdb]. We will demonstrate attaching necessary symbol
653+
paths to debug our `hello-fuchsia` component.
654+
655+
### Attaching `zxdb`
656+
657+
In a separate terminal, issue the following command from our `hello_fuchsia`
658+
directory to launch `zxdb`:
659+
660+
**In separate terminal**
661+
```sh
662+
${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \
663+
--symbol-path target/x86_64-fuchsia/debug
664+
```
665+
666+
* `--symbol-path` gets required symbol paths, which are
667+
necessary for stepping through your program.
668+
669+
The "[displaying source code in `zxdb`](#displaying-source-code-in-zxdb)" section describes how you can
670+
display Rust and/or Fuchsia source code in your debugging session.
671+
672+
### Using `zxdb`
673+
674+
Once launched, you will be presented with the window:
675+
676+
```sh
677+
Connecting (use "disconnect" to cancel)...
678+
Connected successfully.
679+
👉 To get started, try "status" or "help".
680+
[zxdb]
681+
```
682+
683+
To attach to our program, we can run:
684+
685+
```sh
686+
[zxdb] attach hello_fuchsia
687+
```
688+
689+
**Expected output**
690+
```sh
691+
Waiting for process matching "hello_fuchsia".
692+
Type "filter" to see the current filters.
693+
```
694+
695+
Next, we can create a breakpoint at main using "b main":
696+
697+
```sh
698+
[zxdb] b main
699+
```
700+
701+
**Expected output**
702+
```sh
703+
Created Breakpoint 1 @ main
704+
```
705+
706+
Finally, we can re-run the "hello_fuchsia" component from our original
707+
terminal:
708+
709+
```sh
710+
${SDK_PATH}/tools/${ARCH}/ffx component run \
711+
--recreate \
712+
fuchsia-pkg://hello-fuchsia/hello_fuchsia_manifest#meta/hello_fuchsia.cm
713+
```
714+
715+
Once our component is running, our `zxdb` window will stop execution
716+
in our main as desired:
717+
718+
**Expected output**
719+
```txt
720+
Breakpoint 1 now matching 1 addrs for main
721+
🛑 on bp 1 hello_fuchsia::main() • main.rs:2
722+
1 fn main() {
723+
▶ 2 println!("Hello Fuchsia!");
724+
3 }
725+
4
726+
[zxdb]
727+
```
728+
729+
`zxdb` has similar commands to other debuggers like [gdb].
730+
To list the available commands, run "help" in the
731+
`zxdb` window or visit [the zxdb documentation].
732+
733+
```sh
734+
[zxdb] help
735+
```
736+
737+
**Expected output**
738+
```sh
739+
Help!
740+
741+
Type "help <command>" for command-specific help.
742+
743+
Other help topics (see "help <topic>")
744+
...
745+
```
746+
747+
### Displaying source code in `zxdb`
748+
749+
By default, the debugger will not be able to display
750+
source code while debugging. For our user code, we displayed
751+
source code by pointing our debugger to our debug binary via
752+
the `--symbol-path` arg. To display library source code in
753+
the debugger, you must provide paths to the source using
754+
`--build-dir`. For example, to display the Rust and Fuchsia
755+
source code:
756+
757+
```sh
758+
${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \
759+
--symbol-path target/x86_64-fuchsia/debug \
760+
--build-dir ${RUST_SRC_PATH}/rust \
761+
--build-dir ${FUCHSIA_SRC_PATH}/fuchsia/out/default
762+
```
763+
764+
* `--build-dir` links against source code paths, which
765+
are not strictly necessary for debugging, but is a nice-to-have
766+
for displaying source code in `zxdb`.
767+
768+
Linking to a Fuchsia checkout can help with debugging Fuchsia libraries,
769+
such as [fdio].
770+
642771
[Fuchsia team]: https://team-api.infra.rust-lang.org/v1/teams/fuchsia.json
643772
[Fuchsia]: https://fuchsia.dev/
644773
[source tree]: https://fuchsia.dev/fuchsia-src/get-started/learn/build
@@ -649,3 +778,7 @@ underway to enable it.
649778
[reference for the file format]: https://fuchsia.dev/reference/cml
650779
[Fuchsia devsite]: https://fuchsia.dev/reference/cml
651780
[not currently supported]: https://fxbug.dev/105393
781+
[zxdb]: https://fuchsia.dev/fuchsia-src/development/debugger
782+
[gdb]: https://www.sourceware.org/gdb/
783+
[the zxdb documentation]: https://fuchsia.dev/fuchsia-src/development/debugger
784+
[fdio]: https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/lib/fdio/

‎src/librustdoc/html/static/css/rustdoc.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ img {
346346
}
347347

348348
.source .content {
349-
max-width: none;
350349
overflow: visible;
351-
margin-left: 0px;
352350
}
353351

354352
.sub-container {

‎src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ pre, .rustdoc.source .example-wrap {
118118
.content span.primitive, .content a.primitive { color: #ffa0a5; }
119119
.content span.traitalias, .content a.traitalias { color: #39AFD7; }
120120
.content span.keyword, .content a.keyword { color: #39AFD7; }
121-
122-
.content span.externcrate, .content span.mod, .content a.mod {
121+
.content span.mod, .content a.mod {
123122
color: #39AFD7;
124123
}
125124
.content span.struct, .content a.struct {
@@ -131,28 +130,17 @@ pre, .rustdoc.source .example-wrap {
131130
.content span.trait, .content a.trait {
132131
color: #39AFD7;
133132
}
134-
.content span.type, .content a.type {
135-
color: #39AFD7;
136-
}
137-
.content span.type,
138-
.content a.type,
139-
.block a.current.type { color: #39AFD7; }
140-
.content span.associatedtype,
141-
.content a.associatedtype,
142-
.block a.current.associatedtype { color: #39AFD7; }
143-
.content span.fn, .content a.fn, .content span.method,
144-
.content a.method, .content span.tymethod,
145-
.content a.tymethod, .content .fnname {
146-
color: #fdd687;
147-
}
133+
.content span.type, .content a.type { color: #39AFD7; }
134+
.content span.associatedtype, .content a.associatedtype { color: #39AFD7; }
135+
.content span.fn, .content a.fn,
136+
.content .fnname { color: #fdd687; }
148137
.content span.attr, .content a.attr, .content span.derive,
149138
.content a.derive, .content span.macro, .content a.macro {
150139
color: #a37acc;
151140
}
152141

153142
.sidebar a { color: #53b1db; }
154143
.sidebar a.current.type { color: #53b1db; }
155-
.sidebar a.current.associatedtype { color: #53b1db; }
156144

157145
pre.rust .comment { color: #788797; }
158146
pre.rust .doccomment { color: #a1ac88; }
@@ -290,34 +278,11 @@ individually rather than as a group) */
290278
/* FIXME: these rules should be at the bottom of the file but currently must be
291279
above the `@media (max-width: 700px)` rules due to a bug in the css checker */
292280
/* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */
293-
.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,
294-
.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro {}
295-
.content span.struct,.content a.struct,.block a.current.struct {}
296-
#titles>button:hover,#titles>button.selected {}
297-
.content span.typedef,.content a.typedef,.block a.current.typedef {}
298-
.content span.union,.content a.union,.block a.current.union {}
299281
pre.rust .lifetime {}
300-
.stab.unstable {}
301-
h2,
302-
h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {}
303-
.content span.enum,.content a.enum,.block a.current.enum {}
304-
.content span.constant,.content a.constant,.block a.current.constant,.content span.static,
305-
.content a.static, .block a.current.static {}
306-
.content span.keyword,.content a.keyword,.block a.current.keyword {}
307-
.content span.traitalias,.content a.traitalias,.block a.current.traitalias {}
308-
.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,
309-
.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,
310-
.content .fnname {}
311282
pre.rust .kw {}
312-
pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute {}
313-
.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype {}
314-
.stab.deprecated {}
315-
.content a.attr,.content a.derive,.content a.macro {}
316-
.stab.portability {}
317-
.content span.primitive,.content a.primitive,.block a.current.primitive {}
318-
.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod {}
319-
pre.rust .kw-2,pre.rust .prelude-ty {}
320-
.content span.trait,.content a.trait,.block a.current.trait {}
283+
#titles > button:hover, #titles > button.selected {}
284+
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, pre.rust .attribute {}
285+
pre.rust .kw-2, pre.rust .prelude-ty {}
321286

322287
.search-results a:focus span {}
323288
a.result-trait:focus {}
@@ -353,13 +318,9 @@ a.result-keyword:focus {}
353318
.sidebar a.current.constant
354319
.sidebar a.current.static {}
355320
.sidebar a.current.primitive {}
356-
.sidebar a.current.externcrate
357-
.sidebar a.current.mod {}
358321
.sidebar a.current.trait {}
359322
.sidebar a.current.traitalias {}
360-
.sidebar a.current.fn,
361-
.sidebar a.current.method,
362-
.sidebar a.current.tymethod {}
323+
.sidebar a.current.fn {}
363324
.sidebar a.current.keyword {}
364325

365326
kbd {

‎src/librustdoc/html/static/css/themes/dark.css

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -83,35 +83,29 @@ a.result-keyword:focus { background-color: #884719; }
8383

8484
.content .item-info::before { color: #ccc; }
8585

86-
.content span.enum, .content a.enum, .block a.current.enum { color: #2dbfb8; }
87-
.content span.struct, .content a.struct, .block a.current.struct { color: #2dbfb8; }
88-
.content span.type, .content a.type, .block a.current.type { color: #2dbfb8; }
89-
.content span.associatedtype,
90-
.content a.associatedtype,
91-
.block a.current.associatedtype { color: #D2991D; }
92-
.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #2dbfb8; }
93-
.content span.attr, .content a.attr, .block a.current.attr,
94-
.content span.derive, .content a.derive, .block a.current.derive,
95-
.content span.macro, .content a.macro, .block a.current.macro { color: #09bd00; }
96-
.content span.union, .content a.union, .block a.current.union { color: #2dbfb8; }
97-
.content span.constant, .content a.constant, .block a.current.constant,
98-
.content span.static, .content a.static, .block a.current.static { color: #D2991D; }
99-
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #2dbfb8; }
100-
.content span.externcrate,
101-
.content span.mod, .content a.mod, .block a.current.mod { color: #D2991D; }
102-
.content span.trait, .content a.trait, .block a.current.trait { color: #b78cf2; }
103-
.content span.traitalias, .content a.traitalias, .block a.current.traitalias { color: #b78cf2; }
104-
.content span.fn, .content a.fn, .block a.current.fn,
105-
.content span.method, .content a.method, .block a.current.method,
106-
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
107-
.content .fnname{ color: #2BAB63; }
108-
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #D2991D; }
86+
.content span.enum, .content a.enum { color: #2dbfb8; }
87+
.content span.struct, .content a.struct { color: #2dbfb8; }
88+
.content span.type, .content a.type { color: #2dbfb8; }
89+
.content span.associatedtype, .content a.associatedtype { color: #D2991D; }
90+
.content span.foreigntype, .content a.foreigntype { color: #2dbfb8; }
91+
.content span.attr, .content a.attr,
92+
.content span.derive, .content a.derive,
93+
.content span.macro, .content a.macro { color: #09bd00; }
94+
.content span.union, .content a.union { color: #2dbfb8; }
95+
.content span.constant, .content a.constant,
96+
.content span.static, .content a.static { color: #D2991D; }
97+
.content span.primitive, .content a.primitive { color: #2dbfb8; }
98+
.content span.mod, .content a.mod { color: #D2991D; }
99+
.content span.trait, .content a.trait { color: #b78cf2; }
100+
.content span.traitalias, .content a.traitalias { color: #b78cf2; }
101+
.content span.fn, .content a.fn,
102+
.content .fnname { color: #2BAB63; }
103+
.content span.keyword, .content a.keyword { color: #D2991D; }
109104

110105
.sidebar a { color: #fdbf35; }
111106
.sidebar a.current.enum { color: #12ece2; }
112107
.sidebar a.current.struct { color: #12ece2; }
113108
.sidebar a.current.type { color: #12ece2; }
114-
.sidebar a.current.associatedtype { color: #fdbf35; }
115109
.sidebar a.current.foreigntype { color: #12ece2; }
116110
.sidebar a.current.attr,
117111
.sidebar a.current.derive,
@@ -120,13 +114,9 @@ a.result-keyword:focus { background-color: #884719; }
120114
.sidebar a.current.constant
121115
.sidebar a.current.static { color: #fdbf35; }
122116
.sidebar a.current.primitive { color: #12ece2; }
123-
.sidebar a.current.externcrate
124-
.sidebar a.current.mod { color: #fdbf35; }
125117
.sidebar a.current.trait { color: #cca7ff; }
126118
.sidebar a.current.traitalias { color: #cca7ff; }
127-
.sidebar a.current.fn,
128-
.sidebar a.current.method,
129-
.sidebar a.current.tymethod { color: #32d479; }
119+
.sidebar a.current.fn { color: #32d479; }
130120
.sidebar a.current.keyword { color: #fdbf35; }
131121

132122
pre.rust .comment { color: #8d8d8b; }

‎src/librustdoc/html/static/css/themes/light.css

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -82,35 +82,29 @@ a.result-keyword:focus { background-color: #afc6e4; }
8282

8383
.content .item-info::before { color: #ccc; }
8484

85-
.content span.enum, .content a.enum, .block a.current.enum { color: #AD378A; }
86-
.content span.struct, .content a.struct, .block a.current.struct { color: #AD378A; }
87-
.content span.type, .content a.type, .block a.current.type { color: #AD378A; }
88-
.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #3873AD; }
89-
.content span.associatedtype,
90-
.content a.associatedtype,
91-
.block a.current.associatedtype { color: #3873AD; }
92-
.content span.attr, .content a.attr, .block a.current.attr,
93-
.content span.derive, .content a.derive, .block a.current.derive,
94-
.content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
95-
.content span.union, .content a.union, .block a.current.union { color: #AD378A; }
96-
.content span.constant, .content a.constant, .block a.current.constant,
97-
.content span.static, .content a.static, .block a.current.static { color: #3873AD; }
98-
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #AD378A; }
99-
.content span.externcrate,
100-
.content span.mod, .content a.mod, .block a.current.mod { color: #3873AD; }
101-
.content span.trait, .content a.trait, .block a.current.trait { color: #6E4FC9; }
102-
.content span.traitalias, .content a.traitalias, .block a.current.traitalias { color: #5137AD; }
103-
.content span.fn, .content a.fn, .block a.current.fn,
104-
.content span.method, .content a.method, .block a.current.method,
105-
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
85+
.content span.enum, .content a.enum { color: #AD378A; }
86+
.content span.struct, .content a.struct { color: #AD378A; }
87+
.content span.type, .content a.type { color: #AD378A; }
88+
.content span.associatedtype, .content a.associatedtype { color: #3873AD; }
89+
.content span.foreigntype, .content a.foreigntype { color: #3873AD; }
90+
.content span.attr, .content a.attr,
91+
.content span.derive, .content a.derive,
92+
.content span.macro, .content a.macro { color: #068000; }
93+
.content span.union, .content a.union { color: #AD378A; }
94+
.content span.constant, .content a.constant,
95+
.content span.static, .content a.static { color: #3873AD; }
96+
.content span.primitive, .content a.primitive { color: #AD378A; }
97+
.content span.mod, .content a.mod { color: #3873AD; }
98+
.content span.trait, .content a.trait { color: #6E4FC9; }
99+
.content span.traitalias, .content a.traitalias { color: #5137AD; }
100+
.content span.fn, .content a.fn,
106101
.content .fnname { color: #AD7C37; }
107-
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #3873AD; }
102+
.content span.keyword, .content a.keyword { color: #3873AD; }
108103

109104
.sidebar a { color: #356da4; }
110105
.sidebar a.current.enum { color: #a63283; }
111106
.sidebar a.current.struct { color: #a63283; }
112107
.sidebar a.current.type { color: #a63283; }
113-
.sidebar a.current.associatedtype { color: #356da4; }
114108
.sidebar a.current.foreigntype { color: #356da4; }
115109
.sidebar a.current.attr,
116110
.sidebar a.current.derive,
@@ -119,13 +113,9 @@ a.result-keyword:focus { background-color: #afc6e4; }
119113
.sidebar a.current.constant
120114
.sidebar a.current.static { color: #356da4; }
121115
.sidebar a.current.primitive { color: #a63283; }
122-
.sidebar a.current.externcrate
123-
.sidebar a.current.mod { color: #356da4; }
124116
.sidebar a.current.trait { color: #6849c3; }
125117
.sidebar a.current.traitalias { color: #4b349e; }
126-
.sidebar a.current.fn,
127-
.sidebar a.current.method,
128-
.sidebar a.current.tymethod { color: #a67736; }
118+
.sidebar a.current.fn { color: #a67736; }
129119
.sidebar a.current.keyword { color: #356da4; }
130120

131121
a {

‎src/rustdoc-json-types/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ pub enum Term {
542542
#[serde(rename_all = "snake_case")]
543543
#[serde(tag = "kind", content = "inner")]
544544
pub enum Type {
545-
/// Structs and enums
545+
/// Structs, enums, and unions
546546
ResolvedPath(Path),
547547
DynTrait(DynTrait),
548548
/// Parameterized types

‎src/test/rustdoc-json/unions/union.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
// @has "$.index[*][?(@.name=='Union')].visibility" \"public\"
22
// @has "$.index[*][?(@.name=='Union')].kind" \"union\"
33
// @!has "$.index[*][?(@.name=='Union')].inner.struct_type"
4+
// @set Union = "$.index[*][?(@.name=='Union')].id"
45
pub union Union {
56
int: i32,
67
float: f32,
78
}
9+
10+
11+
// @is "$.index[*][?(@.name=='make_int_union')].inner.decl.output.kind" '"resolved_path"'
12+
// @is "$.index[*][?(@.name=='make_int_union')].inner.decl.output.inner.id" $Union
13+
pub fn make_int_union(int: i32) -> Union {
14+
Union { int }
15+
}

‎src/test/ui/asm/x86_64/may_unwind.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// only-x86_64
22
// run-pass
33
// needs-asm-support
4+
// needs-unwind
45

56
#![feature(asm_sym, asm_unwind)]
67

‎src/test/ui/mir/mir_codegen_calls_diverging_drops.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// error-pattern:diverging_fn called
33
// error-pattern:0 dropped
44
// ignore-emscripten no processes
5+
// needs-unwind this test checks that a destructor is called after panicking
56

67
struct Droppable(u8);
78
impl Drop for Droppable {

‎src/test/ui/proc-macro/invalid-punct-ident-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:invalid-punct-ident.rs
2+
// needs-unwind proc macro panics to report errors
23

34
#[macro_use]
45
extern crate invalid_punct_ident;

‎src/test/ui/proc-macro/invalid-punct-ident-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: proc macro panicked
2-
--> $DIR/invalid-punct-ident-1.rs:6:1
2+
--> $DIR/invalid-punct-ident-1.rs:7:1
33
|
44
LL | invalid_punct!();
55
| ^^^^^^^^^^^^^^^^

‎src/test/ui/proc-macro/invalid-punct-ident-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:invalid-punct-ident.rs
2+
// needs-unwind proc macro panics to report errors
23

34
#[macro_use]
45
extern crate invalid_punct_ident;

‎src/test/ui/proc-macro/invalid-punct-ident-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: proc macro panicked
2-
--> $DIR/invalid-punct-ident-2.rs:6:1
2+
--> $DIR/invalid-punct-ident-2.rs:7:1
33
|
44
LL | invalid_ident!();
55
| ^^^^^^^^^^^^^^^^

‎src/test/ui/proc-macro/invalid-punct-ident-3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:invalid-punct-ident.rs
2+
// needs-unwind proc macro panics to report errors
23

34
#[macro_use]
45
extern crate invalid_punct_ident;

‎src/test/ui/proc-macro/invalid-punct-ident-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: proc macro panicked
2-
--> $DIR/invalid-punct-ident-3.rs:6:1
2+
--> $DIR/invalid-punct-ident-3.rs:7:1
33
|
44
LL | invalid_raw_ident!();
55
| ^^^^^^^^^^^^^^^^^^^^

‎src/test/ui/proc-macro/invalid-punct-ident-4.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:invalid-punct-ident.rs
2+
// needs-unwind proc macro panics to report errors
23

34
#[macro_use]
45
extern crate invalid_punct_ident;

‎src/test/ui/proc-macro/invalid-punct-ident-4.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: unexpected closing delimiter: `)`
2-
--> $DIR/invalid-punct-ident-4.rs:6:1
2+
--> $DIR/invalid-punct-ident-4.rs:7:1
33
|
44
LL | lexer_failure!();
55
| ^^^^^^^^^^^^^^^^ unexpected closing delimiter
66
|
77
= note: this error originates in the macro `lexer_failure` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error: proc macro panicked
10-
--> $DIR/invalid-punct-ident-4.rs:6:1
10+
--> $DIR/invalid-punct-ident-4.rs:7:1
1111
|
1212
LL | lexer_failure!();
1313
| ^^^^^^^^^^^^^^^^
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/invalid-punct-ident-4.rs:11:33
16+
--> $DIR/invalid-punct-ident-4.rs:12:33
1717
|
1818
LL | let _recovery_witness: () = 0;
1919
| -- ^ expected `()`, found integer

‎src/test/ui/proc-macro/issue-36935.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:test-macros.rs
2+
// needs-unwind proc macro panics to report errors
23

34
#[macro_use]
45
extern crate test_macros;

‎src/test/ui/proc-macro/issue-36935.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0428]: the name `Baz` is defined multiple times
2-
--> $DIR/issue-36935.rs:7:1
2+
--> $DIR/issue-36935.rs:8:1
33
|
44
LL | struct Baz {
55
| ^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | struct Baz {
1010
= note: `Baz` must be defined only once in the type namespace of this module
1111

1212
error: proc-macro derive panicked
13-
--> $DIR/issue-36935.rs:6:20
13+
--> $DIR/issue-36935.rs:7:20
1414
|
1515
LL | #[derive(Identity, Panic)]
1616
| ^^^^^

‎src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// aux-build:proc-macro-panic.rs
22
// edition:2018
3+
// needs-unwind proc macro panics to report errors
34

45
// Regression test for issue #76270
56
// Tests that we don't print an ICE message when a panic

‎src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: proc macro panicked
2-
--> $DIR/issue-76270-panic-in-libproc-macro.rs:10:1
2+
--> $DIR/issue-76270-panic-in-libproc-macro.rs:11:1
33
|
44
LL | proc_macro_panic::panic_in_libproc_macro!();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

‎src/test/ui/proc-macro/load-panic-backtrace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// rustc-env:RUST_BACKTRACE=0
44
// normalize-stderr-test "thread '.*' panicked " -> ""
55
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
6+
// needs-unwind proc macro panics to report errors
67

78
#[macro_use]
89
extern crate test_macros;

‎src/test/ui/proc-macro/load-panic-backtrace.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
at 'panic-derive', $DIR/auxiliary/test-macros.rs:43:5
22
error: proc-macro derive panicked
3-
--> $DIR/load-panic-backtrace.rs:10:10
3+
--> $DIR/load-panic-backtrace.rs:11:10
44
|
55
LL | #[derive(Panic)]
66
| ^^^^^

‎src/test/ui/proc-macro/load-panic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:test-macros.rs
2+
// needs-unwind proc macro panics to report errors
23

34
#[macro_use]
45
extern crate test_macros;

‎src/test/ui/proc-macro/load-panic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: proc-macro derive panicked
2-
--> $DIR/load-panic.rs:6:10
2+
--> $DIR/load-panic.rs:7:10
33
|
44
LL | #[derive(Panic)]
55
| ^^^^^

0 commit comments

Comments
 (0)
Please sign in to comment.