Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e374c91
Stabilize Windows `FileTypeExt` with `is_symlink_dir` and `is_symlink…
joshtriplett Jun 27, 2022
a4cb0b9
Seal Windows `FileTypeExt` extension trait to allow adding future met…
joshtriplett Jun 27, 2022
6d1100f
Add failing test
In-line Dec 21, 2021
42a4419
Do not prefer module parents which are `doc(hidden)` in visibility map
compiler-errors Jul 24, 2022
76cf6bd
passes: port more of `check_attr` module
davidtwco Jul 19, 2022
5fcd2f7
Add a clickable link to the layout section
est31 Jul 24, 2022
15db418
Simplify test
est31 Jul 26, 2022
017e172
Remove dead code from cg_llvm
bjorn3 Jul 26, 2022
05c1a4a
Don't build std for *-uefi targets
nicholasbishop Jul 26, 2022
7f78a9a
Update pulldown-cmark version
GuillaumeGomez Jul 26, 2022
b8fb6e1
rustdoc: do not allocate String when writing path full name
notriddle Jul 26, 2022
1ff84f0
Rollup merge of #98583 - joshtriplett:stabilize-windows-symlink-types…
JohnTitor Jul 27, 2022
3ca1c31
Rollup merge of #99698 - compiler-errors:no-doc-hidden, r=cjgillot
JohnTitor Jul 27, 2022
181bf05
Rollup merge of #99700 - est31:rustdoc_layout_heading, r=GuillaumeGomez
JohnTitor Jul 27, 2022
fe51d07
Rollup merge of #99712 - davidtwco:translation-migrate-passes-2, r=co…
JohnTitor Jul 27, 2022
7f608e9
Rollup merge of #99759 - bjorn3:remove_llvm_dead_code, r=nikic
JohnTitor Jul 27, 2022
a76f2fe
Rollup merge of #99765 - nicholasbishop:bishop-disable-uefi-std-build…
JohnTitor Jul 27, 2022
f8f07de
Rollup merge of #99771 - GuillaumeGomez:update-pulldown-cmark, r=Urgau
JohnTitor Jul 27, 2022
0d5bdca
Rollup merge of #99775 - notriddle:notriddle/as-str, r=camelid
JohnTitor Jul 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,13 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
use std::collections::vec_deque::VecDeque;

let mut visible_parent_map: DefIdMap<DefId> = Default::default();
// This is a secondary visible_parent_map, storing the DefId of parents that re-export
// the child as `_`. Since we prefer parents that don't do this, merge this map at the
// end, only if we're missing any keys from the former.
// This is a secondary visible_parent_map, storing the DefId of
// parents that re-export the child as `_` or module parents
// which are `#[doc(hidden)]`. Since we prefer paths that don't
// do this, merge this map at the end, only if we're missing
// keys from the former.
// This is a rudimentary check that does not catch all cases,
// just the easiest.
let mut fallback_map: DefIdMap<DefId> = Default::default();

// Issue 46112: We want the map to prefer the shortest
Expand Down Expand Up @@ -412,6 +416,11 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
return;
}

if ty::util::is_doc_hidden(tcx, parent) {
fallback_map.insert(def_id, parent);
return;
}

match visible_parent_map.entry(def_id) {
Entry::Occupied(mut entry) => {
// If `child` is defined in crate `cnum`, ensure
Expand Down Expand Up @@ -439,8 +448,9 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
}
}

// Fill in any missing entries with the (less preferable) path ending in `::_`.
// We still use this path in a diagnostic that suggests importing `::*`.
// Fill in any missing entries with the less preferable path.
// If this path re-exports the child as `_`, we still use this
// path in a diagnostic that suggests importing `::*`.
for (child, parent) in fallback_map {
visible_parent_map.entry(child).or_insert(parent);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![crate_type = "lib"]

extern crate core;

pub mod __private {
#[doc(hidden)]
pub use core::option::Option::{self, None, Some};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![crate_type = "lib"]

extern crate core;

#[doc(hidden)]
pub mod __private {
pub use core::option::Option::{self, None, Some};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// aux-build:hidden-child.rs

// FIXME(compiler-errors): This currently suggests the wrong thing.
// UI test exists to track the problem.

extern crate hidden_child;

fn main() {
let x: Option<i32> = 1i32; //~ ERROR mismatched types
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0308]: mismatched types
--> $DIR/hidden-child.rs:9:26
|
LL | let x: Option<i32> = 1i32;
| ----------- ^^^^ expected enum `Option`, found `i32`
| |
| expected due to this
|
= note: expected enum `Option<i32>`
found type `i32`
help: try wrapping the expression in `hidden_child::__private::Some`
|
LL | let x: Option<i32> = hidden_child::__private::Some(1i32);
| ++++++++++++++++++++++++++++++ +

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// aux-build:hidden-parent.rs

extern crate hidden_parent;

fn main() {
let x: Option<i32> = 1i32; //~ ERROR mismatched types
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0308]: mismatched types
--> $DIR/hidden-parent.rs:6:26
|
LL | let x: Option<i32> = 1i32;
| ----------- ^^^^ expected enum `Option`, found `i32`
| |
| expected due to this
|
= note: expected enum `Option<i32>`
found type `i32`
help: try wrapping the expression in `Some`
|
LL | let x: Option<i32> = Some(1i32);
| +++++ +

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.