]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/uninhabited/privately-uninhabited-mir-call.rs
1 // Verifies that MIR building for a call expression respects
2 // privacy when checking if a call return type is uninhabited.
6 pub struct Widget(Unimplemented
);
9 pub fn new() -> Widget
{
17 // Ok. Widget type returned from new is known to be uninhabited
18 // and the following code is considered unreachable.
25 widget
::Widget
::new();
26 // Error. Widget type is not known to be uninhabited here,
27 // so the following code is considered reachable.
28 *y
= 2; //~ ERROR E0381