Skip to content

Commit 95978b3

Browse files
committed
Auto merge of #113083 - matthiaskrgr:rollup-anbqpij, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - #113039 (make custom mir ICE a bit nicer) - #113058 (Add/improve code comments) - #113063 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b5e51db + c396abe commit 95978b3

File tree

9 files changed

+15
-8
lines changed

9 files changed

+15
-8
lines changed

compiler/rustc_mir_build/src/build/custom/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ fn parse_attribute(attr: &Attribute) -> MirPhase {
118118
phase = Some(value);
119119
}
120120
other => {
121-
panic!("Unexpected key {}", other);
121+
span_bug!(
122+
nested.span(),
123+
"Unexpected key while parsing custom_mir attribute: '{}'",
124+
other
125+
);
122126
}
123127
}
124128
}

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ fn filter_tokens_from_list(
23552355
tokens
23562356
}
23572357

2358-
/// When inlining items, we merge its attributes (and all the reexports attributes too) with the
2358+
/// When inlining items, we merge their attributes (and all the reexports attributes too) with the
23592359
/// final reexport. For example:
23602360
///
23612361
/// ```ignore (just an example)

src/librustdoc/clean/types.rs

+3
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,8 @@ pub(crate) trait AttributesExt {
956956
.filter_map(|attr| Cfg::parse(attr.meta_item()?).ok())
957957
.fold(Cfg::True, |cfg, new_cfg| cfg & new_cfg)
958958
} else if doc_auto_cfg_active {
959+
// If there is no `doc(cfg())`, then we retrieve the `cfg()` attributes (because
960+
// `doc(cfg())` overrides `cfg()`).
959961
self.iter()
960962
.filter(|attr| attr.has_name(sym::cfg))
961963
.filter_map(|attr| single(attr.meta_item_list()?))
@@ -2387,6 +2389,7 @@ impl ImplKind {
23872389
#[derive(Clone, Debug)]
23882390
pub(crate) struct Import {
23892391
pub(crate) kind: ImportKind,
2392+
/// The item being re-exported.
23902393
pub(crate) source: ImportSource,
23912394
pub(crate) should_be_displayed: bool,
23922395
}

tests/rustdoc/reexport-doc-hidden-inside-private.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
1+
// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
22
// module will still be displayed (the re-export, not the item).
33

44
#![crate_name = "foo"]

0 commit comments

Comments
 (0)