Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
31ae7c46bddd917886f88bd3ba38f39cd9b51cd0
rust/tests/ui/rfc-2005-default-binding-mode/lit.rs

25 lines
427 B
Rust
Raw Normal View History

implement pattern-binding-modes RFC See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06 16:30:23 -04:00
// FIXME(tschottdorf): we want these to compile, but they don't.
fn with_str() {
let s: &'static str = "abc";
match &s {
Merge cfail and ui tests into ui tests
2017-11-20 13:13:27 +01:00
"abc" => true, //~ ERROR mismatched types
implement pattern-binding-modes RFC See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06 16:30:23 -04:00
_ => panic!(),
};
}
fn with_bytes() {
let s: &'static [u8] = b"abc";
match &s {
Merge cfail and ui tests into ui tests
2017-11-20 13:13:27 +01:00
b"abc" => true, //~ ERROR mismatched types
implement pattern-binding-modes RFC See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06 16:30:23 -04:00
_ => panic!(),
};
}
pub fn main() {
with_str();
with_bytes();
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2925ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API