Created
October 29, 2016 16:07
-
-
Save Marwes/70702584148698477d78582010eebc8c to your computer and use it in GitHub Desktop.
compile-fail spans with macros
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"message": "cannot infer an appropriate lifetime for lifetime parameter `'vm` due to conflicting requirements", | |
"code": { | |
"code": "E0495", | |
"explanation": null | |
}, | |
"level": "error", | |
"spans": [ | |
{ | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6569, | |
"byte_end": 6616, | |
"line_start": 12, | |
"line_end": 12, | |
"column_start": 1, | |
"column_end": 48, | |
"is_primary": true, | |
"text": [ | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 48 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": { | |
"span": { | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 492, | |
"byte_end": 507, | |
"line_start": 26, | |
"line_end": 26, | |
"column_start": 30, | |
"column_end": 45, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": " vm.define_global(\"test\", primitive!(1 f));\r", | |
"highlight_start": 30, | |
"highlight_end": 45 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
}, | |
"macro_decl_name": "primitive!", | |
"def_site_span": { | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6115, | |
"byte_end": 7780, | |
"line_start": 1, | |
"line_end": 37, | |
"column_start": 1, | |
"column_end": 79, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": "( 0 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 25 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 74 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 68 | |
}, | |
{ | |
"text": "1 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 75 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "2 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "3 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 77 | |
}, | |
{ | |
"text": "4 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ , _ ) -> _ ) } } ;", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
} | |
} | |
} | |
], | |
"children": [ | |
{ | |
"message": "first, the lifetime cannot outlive the anonymous lifetime #1 defined on the block at 11:17...", | |
"code": null, | |
"level": "note", | |
"spans": [ | |
{ | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6567, | |
"byte_end": 6661, | |
"line_start": 11, | |
"line_end": 13, | |
"column_start": 18, | |
"column_end": 43, | |
"is_primary": true, | |
"text": [ | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 18, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 43 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": { | |
"span": { | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 492, | |
"byte_end": 507, | |
"line_start": 26, | |
"line_end": 26, | |
"column_start": 30, | |
"column_end": 45, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": " vm.define_global(\"test\", primitive!(1 f));\r", | |
"highlight_start": 30, | |
"highlight_end": 45 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
}, | |
"macro_decl_name": "primitive!", | |
"def_site_span": { | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6115, | |
"byte_end": 7780, | |
"line_start": 1, | |
"line_end": 37, | |
"column_start": 1, | |
"column_end": 79, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": "( 0 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 25 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 74 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 68 | |
}, | |
{ | |
"text": "1 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 75 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "2 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "3 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 77 | |
}, | |
{ | |
"text": "4 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ , _ ) -> _ ) } } ;", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
} | |
} | |
} | |
], | |
"children": [], | |
"rendered": null | |
}, | |
{ | |
"message": "...so that reference does not outlive borrowed content", | |
"code": null, | |
"level": "note", | |
"spans": [ | |
{ | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6651, | |
"byte_end": 6657, | |
"line_start": 13, | |
"line_end": 13, | |
"column_start": 33, | |
"column_end": 39, | |
"is_primary": true, | |
"text": [ | |
{ | |
"text": "& ( $ name as fn ( _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 33, | |
"highlight_end": 39 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": { | |
"span": { | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 492, | |
"byte_end": 507, | |
"line_start": 26, | |
"line_end": 26, | |
"column_start": 30, | |
"column_end": 45, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": " vm.define_global(\"test\", primitive!(1 f));\r", | |
"highlight_start": 30, | |
"highlight_end": 45 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
}, | |
"macro_decl_name": "primitive!", | |
"def_site_span": { | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6115, | |
"byte_end": 7780, | |
"line_start": 1, | |
"line_end": 37, | |
"column_start": 1, | |
"column_end": 79, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": "( 0 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 25 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 74 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 68 | |
}, | |
{ | |
"text": "1 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 75 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "2 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "3 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 77 | |
}, | |
{ | |
"text": "4 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ , _ ) -> _ ) } } ;", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
} | |
} | |
} | |
], | |
"children": [], | |
"rendered": null | |
}, | |
{ | |
"message": "but, the lifetime must be valid for the static lifetime...", | |
"code": null, | |
"level": "note", | |
"spans": [], | |
"children": [], | |
"rendered": null | |
}, | |
{ | |
"message": "...so that expression is assignable (expected fn(&Test), found fn(&'static Test))", | |
"code": null, | |
"level": "note", | |
"spans": [ | |
{ | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 505, | |
"byte_end": 506, | |
"line_start": 26, | |
"line_end": 26, | |
"column_start": 43, | |
"column_end": 44, | |
"is_primary": true, | |
"text": [ | |
{ | |
"text": " vm.define_global(\"test\", primitive!(1 f));\r", | |
"highlight_start": 43, | |
"highlight_end": 44 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": { | |
"span": { | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 492, | |
"byte_end": 507, | |
"line_start": 26, | |
"line_end": 26, | |
"column_start": 30, | |
"column_end": 45, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": " vm.define_global(\"test\", primitive!(1 f));\r", | |
"highlight_start": 30, | |
"highlight_end": 45 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
}, | |
"macro_decl_name": "primitive!", | |
"def_site_span": { | |
"file_name": "<gluon_vm macros>", | |
"byte_start": 6115, | |
"byte_end": 7780, | |
"line_start": 1, | |
"line_end": 37, | |
"column_start": 1, | |
"column_end": 79, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": "( 0 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 25 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 74 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 68 | |
}, | |
{ | |
"text": "1 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 75 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "2 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ ) -> _ ) , thread ) } $ crate :: api :: primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "3 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 69 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ ) -> _ ) } } ; (", | |
"highlight_start": 1, | |
"highlight_end": 77 | |
}, | |
{ | |
"text": "4 $ name : expr ) => {", | |
"highlight_start": 1, | |
"highlight_end": 23 | |
}, | |
{ | |
"text": "unsafe {", | |
"highlight_start": 1, | |
"highlight_end": 9 | |
}, | |
{ | |
"text": "extern \"C\" fn wrapper ( thread : & $ crate :: thread :: Thread ) -> $ crate ::", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
}, | |
{ | |
"text": "thread :: Status {", | |
"highlight_start": 1, | |
"highlight_end": 19 | |
}, | |
{ | |
"text": "$ crate :: api :: VmFunction :: unpack_and_call (", | |
"highlight_start": 1, | |
"highlight_end": 50 | |
}, | |
{ | |
"text": "& ( $ name as fn ( _ , _ , _ , _ ) -> _ ) , thread ) } $ crate :: api ::", | |
"highlight_start": 1, | |
"highlight_end": 73 | |
}, | |
{ | |
"text": "primitive_f (", | |
"highlight_start": 1, | |
"highlight_end": 14 | |
}, | |
{ | |
"text": "stringify ! ( $ name ) , wrapper , $ name as fn ( _ , _ , _ , _ ) -> _ ) } } ;", | |
"highlight_start": 1, | |
"highlight_end": 79 | |
} | |
], | |
"label": null, | |
"suggested_replacement": null, | |
"expansion": null | |
} | |
} | |
} | |
], | |
"children": [], | |
"rendered": null | |
} | |
], | |
"rendered": null | |
}{ | |
"message": "`vm` does not live long enough", | |
"code": null, | |
"level": "error", | |
"spans": [ | |
{ | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 452, | |
"byte_end": 454, | |
"line_start": 25, | |
"line_end": 25, | |
"column_start": 5, | |
"column_end": 7, | |
"is_primary": true, | |
"text": [ | |
{ | |
"text": " vm.define_global(\"test\", f);\r", | |
"highlight_start": 5, | |
"highlight_end": 7 | |
} | |
], | |
"label": "does not live long enough", | |
"suggested_replacement": null, | |
"expansion": null | |
}, | |
{ | |
"file_name": "tests/compile-fail/getable-reference.rs", | |
"byte_start": 529, | |
"byte_end": 530, | |
"line_start": 27, | |
"line_end": 27, | |
"column_start": 1, | |
"column_end": 2, | |
"is_primary": false, | |
"text": [ | |
{ | |
"text": "}\r", | |
"highlight_start": 1, | |
"highlight_end": 2 | |
} | |
], | |
"label": "borrowed value only lives until here", | |
"suggested_replacement": null, | |
"expansion": null | |
} | |
], | |
"children": [ | |
{ | |
"message": "borrowed value must be valid for the static lifetime...", | |
"code": null, | |
"level": "note", | |
"spans": [], | |
"children": [], | |
"rendered": null | |
} | |
], | |
"rendered": null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment