diff options
| author | kennytm <kennytm@gmail.com> | 2019-02-06 00:29:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-06 00:29:08 +0900 |
| commit | 3abb03fdb31605ee3cb7b83fa89de110bce4ed13 (patch) | |
| tree | 7760709a2e842f71f38dad3d960750754f1d77a0 /src | |
| parent | a35dac2c5c03bdcc1a7a6a6211976fdea1cd813f (diff) | |
| parent | 652f2c753aed97261f5d988f0a2b50aa6508964c (diff) | |
| download | rust-3abb03fdb31605ee3cb7b83fa89de110bce4ed13.tar.gz rust-3abb03fdb31605ee3cb7b83fa89de110bce4ed13.zip | |
Rollup merge of #58138 - ishitatsuyuki:stability-delay, r=estebank
Fix #58101
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/stability.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/stability-in-private-module.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/stability-in-private-module.stderr | 9 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 3717ee7143c..c726885337e 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -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)); } } } diff --git a/src/test/ui/stability-in-private-module.rs b/src/test/ui/stability-in-private-module.rs new file mode 100644 index 00000000000..f12e9198b0d --- /dev/null +++ b/src/test/ui/stability-in-private-module.rs @@ -0,0 +1,4 @@ +fn main() { + let _ = std::thread::thread_info::current_thread(); + //~^ERROR module `thread_info` is private +} diff --git a/src/test/ui/stability-in-private-module.stderr b/src/test/ui/stability-in-private-module.stderr new file mode 100644 index 00000000000..c3edd62a15e --- /dev/null +++ b/src/test/ui/stability-in-private-module.stderr @@ -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`. |
