summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/module_tree.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-02-24 20:57:11 +0800
committerJohn Hodge <tpg@mutabah.net>2018-02-24 20:57:11 +0800
commitcec5b32e9918c97b0b044ff30b86892d974c82f4 (patch)
tree7c593b476db80574cecd948724e294c958dd047d /tools/standalone_miri/module_tree.cpp
parentef3009113058aa6b0a723c292b38a92baa87b0af (diff)
downloadmrust-cec5b32e9918c97b0b044ff30b86892d974c82f4.tar.gz
Standalone MIRI + Codegen MMIR - Drop support
Diffstat (limited to 'tools/standalone_miri/module_tree.cpp')
-rw-r--r--tools/standalone_miri/module_tree.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/standalone_miri/module_tree.cpp b/tools/standalone_miri/module_tree.cpp
index a457db8e..2fc99bc4 100644
--- a/tools/standalone_miri/module_tree.cpp
+++ b/tools/standalone_miri/module_tree.cpp
@@ -173,16 +173,27 @@ bool Parser::parse_one()
rv.alignment = lex.consume().integer();
lex.check_consume(';');
- // TODO: DST Meta
+ // Drop glue (if present)
+ if( lex.consume_if("DROP") )
+ {
+ rv.drop_glue = parse_path();
+ lex.check_consume(';');
+ }
+ else
+ {
+ // No drop glue
+ }
+
+ // DST Meta type
if( lex.consume_if("DSTMETA") )
{
- //rv->dst_meta = parse_type();
+ rv.dst_meta = parse_type();
lex.check_consume(';');
- throw "TODO";
}
else
{
- //rv->dst_meta = ::HIR::TypeRef::diverge();
+ // Using ! as the metadata type means that the type is Sized (meanwhile, `()` means unsized with no meta)
+ rv.dst_meta = ::HIR::TypeRef::diverge();
}
while( lex.next() != '}' )