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
aad1db737347b93b51a7dc45dcb6bec9e367bc02
rust/tests/ui/parser/macro/trait-non-item-macros.rs

14 lines
238 B
Rust
Raw Normal View History

Add support for macro expansion inside trait items
2016-06-11 02:00:07 +01:00
macro_rules! bah {
parse: use `parse_item_common` in `parse_assoc_item_`.
2020-02-22 08:16:39 +01:00
($a:expr) => {
$a
Tweak `expand_incomplete_parse` warning. By using `token_descr`, as is done for many other errors, we can get slightly better descriptions in error messages, e.g. "macro expansion ignores token `let` and any following" becomes "macro expansion ignores keyword `let` and any tokens following". This will be more important once invisible delimiters start being mentioned in error messages -- without this commit, that leads to error messages such as "error at ``" because invisible delimiters are pretty printed as an empty string.
2024-04-17 17:08:58 +10:00
}; //~^ ERROR macro expansion ignores expression `2` and any tokens following
Add support for macro expansion inside trait items
2016-06-11 02:00:07 +01:00
}
parse: use `parse_item_common` in `parse_assoc_item_`.
2020-02-22 08:16:39 +01:00
trait Bar {
Add support for macro expansion inside trait items
2016-06-11 02:00:07 +01:00
bah!(2);
}
parse: use `parse_item_common` in `parse_assoc_item_`.
2020-02-22 08:16:39 +01:00
fn main() {
let _recovery_witness: () = 0; //~ ERROR mismatched types
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 4471ms 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