]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-39808.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-39808.rs
1 // run-pass
2 #![allow(unreachable_code)]
3
4 // Regression test for #39808. The type parameter of `Owned` was
5 // considered to be "unconstrained" because the type resulting from
6 // `format!` (`String`) was not being propagated upward, owing to the
7 // fact that the expression diverges.
8
9 use std::borrow::Cow;
10
11 fn main() {
12     let _ = if false {
13         Cow::Owned(format!("{:?}", panic!()))
14     } else {
15         Cow::Borrowed("")
16     };
17 }