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
14e59bb317c3c901bce83deb16ee9bfa5cc90e28
rust/tests/ui/pattern/usefulness/issue-30240-rpass.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
264 B
Rust
Raw Normal View History

Add `// run-pass` annotations to all the tests under `ui/run-pass/`. (I may have accidentally added it to some auxilliary crates as well; my emacs-macro-based methodology was pretty crude.)
2018-08-30 14:18:55 +02:00
// run-pass
handle string literals correctly in match checking The root of the problem is that a string literal pattern is essentially of the form `&LITERAL`, in a single block, while match checking wants to split that. To fix that, I added a type field to the patterns in match checking, which allows us to distinguish between a full and split pattern. That file is ugly and needs to be cleaned. However, `trans::_match` calls it, so I think we should delay the cleanup until we kill that. Fixes #30240
2016-06-05 23:56:11 +03:00
fn main() {
let &ref a = &[0i32] as &[_];
assert_eq!(a, &[0i32] as &[_]);
let &ref a = "hello";
assert_eq!(a, "hello");
match "foo" {
"fool" => unreachable!(),
"foo" => {},
ref _x => unreachable!()
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2926ms Template: 4ms
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