diff options
| author | bors <bors@rust-lang.org> | 2017-06-11 23:51:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-06-11 23:51:04 +0000 |
| commit | 29ef41215c2ffe3105ea8cc1621dda00542f65ee (patch) | |
| tree | e62470fb75e29975d23e1749d56df1e70238bc7e /src/libsyntax | |
| parent | e2eaef8497bd212694840515a568d592b17d0e07 (diff) | |
| parent | 2f3789474042e16f0fb35d1a03d1acfce151774e (diff) | |
| download | rust-29ef41215c2ffe3105ea8cc1621dda00542f65ee.tar.gz rust-29ef41215c2ffe3105ea8cc1621dda00542f65ee.zip | |
Auto merge of #42585 - GuillaumeGomez:E0609, r=Susurrus
Add E0609 Part of #42229. cc @Susurrus
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/diagnostics/macros.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsyntax/diagnostics/macros.rs b/src/libsyntax/diagnostics/macros.rs index 13016d72127..e8ecf58072a 100644 --- a/src/libsyntax/diagnostics/macros.rs +++ b/src/libsyntax/diagnostics/macros.rs @@ -75,6 +75,17 @@ macro_rules! struct_span_err { } #[macro_export] +macro_rules! type_error_struct { + ($session:expr, $span:expr, $typ:expr, $code:ident, $($message:tt)*) => ({ + if $typ.references_error() { + $session.diagnostic().struct_dummy() + } else { + struct_span_err!($session, $span, $code, $($message)*) + } + }) +} + +#[macro_export] macro_rules! struct_span_warn { ($session:expr, $span:expr, $code:ident, $($message:tt)*) => ({ __diagnostic_used!($code); |
