315: allow handlers to be named 'main' r=korken89 a=japaric

`#[init]`, `#[idle]` and `#[task]` handlers can now be named `main`

fixes #311

Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
This commit is contained in:
bors[bot] 2020-06-11 16:22:33 +00:00 committed by GitHub
commit 4795c1dba3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 82 additions and 3 deletions

View file

@ -109,7 +109,7 @@ pub fn codegen(
let locals_new = locals_new.iter();
let call_init =
Some(quote!(let late = #name(#(#locals_new,)* #name::Context::new(core.into()));));
Some(quote!(let late = crate::#name(#(#locals_new,)* #name::Context::new(core.into()));));
root_init.push(module::codegen(Context::Init(core), needs_lt, app, extra));