Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #58101 #58138

Merged
merged 2 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
}
}
EvalResult::Unmarked => {
span_bug!(span, "encountered unmarked API: {:?}", def_id);
// The API could be uncallable for other reasons, for example when a private module
// was referenced.
self.sess.delay_span_bug(span, &format!("encountered unmarked API: {:?}", def_id));
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/test/ui/stability-in-private-module.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
let _ = std::thread::thread_info::current_thread();
//~^ERROR module `thread_info` is private
}
9 changes: 9 additions & 0 deletions src/test/ui/stability-in-private-module.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0603]: module `thread_info` is private
--> $DIR/stability-in-private-module.rs:2:26
|
LL | let _ = std::thread::thread_info::current_thread();
| ^^^^^^^^^^^

error: aborting due to previous error

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