diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-46302.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-46302.rs b/src/test/ui/issues/issue-46302.rs new file mode 100644 index 000000000..ba681d84e --- /dev/null +++ b/src/test/ui/issues/issue-46302.rs @@ -0,0 +1,9 @@ +fn foo() { + let s = "abc"; + let u: &str = if true { s[..2] } else { s }; + //~^ ERROR mismatched types +} + +fn main() { + foo(); +} |