summaryrefslogtreecommitdiff
path: root/src/expand/rustc_diagnostics.cpp
blob: b5337d26da0e322d37e3f2575c4e3cebe8bdbde1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * MRustC - Rust Compiler
 * - By John Hodge (Mutabah/thePowersGang)
 *
 * expand/rustc_diagnostics.cpp
 * - Stubbed handling for __register_diagnostic and __diagnostic_used
 */
#include <synext.hpp>
#include <parse/common.hpp>  // TokenTree etc
#include <parse/ttstream.hpp>

class CExpanderRegisterDiagnostic:
    public ExpandProcMacro
{
    ::std::unique_ptr<TokenStream> expand(const Span& sp, const AST::Crate& crate, const ::std::string& ident, const TokenTree& tt, AST::Module& mod) override
    {
        return box$( TTStreamO(TokenTree()) );
    }
};
class CExpanderDiagnosticUsed:
    public ExpandProcMacro
{
    ::std::unique_ptr<TokenStream> expand(const Span& sp, const AST::Crate& crate, const ::std::string& ident, const TokenTree& tt, AST::Module& mod) override
    {
        return box$( TTStreamO(TokenTree()) );
    }
};

STATIC_MACRO("__register_diagnostic", CExpanderRegisterDiagnostic)
STATIC_MACRO("__diagnostic_used", CExpanderDiagnosticUsed)