Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
master
rust/tests/ui/parser/lifetime-in-pattern.rs

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

8 lines
146 B
Rust
Raw Permalink Normal View History

libsyntax: better error for lifetimes in patterns Previously, if you copied a signature from a trait definition such as: ``` fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-25 00:57:42 +01:00
fn test(&'a str) {
//~^ ERROR unexpected lifetime `'a` in pattern
parser: recover on `&'lifetime mut $pat`.
2019-12-13 00:59:33 +01:00
//~| ERROR expected one of `:`, `@`, or `|`, found `)`
libsyntax: better error for lifetimes in patterns Previously, if you copied a signature from a trait definition such as: ``` fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-25 00:57:42 +01:00
}
fn main() {
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2994ms 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