Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

v0.1.1 has a token hygeiene bug. #95

@seunlanlege

Description

@seunlanlege

Marking a function as async or using async_block, causes variables used in macro invocations to be unresolved.

Minimal Code to reproduce

#[async]
pub fn test() -> Result<(), ()> {
	let lk = "haha, i'm a str";
	let res = Ok::<_, bool>(true);
	println!("{}", lk);
	println!("{:?}", &res);
	Ok(())
}

which compiles with the errors,

error[E0425]: cannot find value `lk` in this scope
 --> <println macros>:3:44
  |
3 | ) => ( print ! ( concat ! ( $ fmt , "\n" ) , $ ( $ arg ) * ) ) ;
  |                                            ^ not found in this scope

error[E0425]: cannot find value `res` in this scope
 --> <println macros>:3:44
  |
3 | ) => ( print ! ( concat ! ( $ fmt , "\n" ) , $ ( $ arg ) * ) ) ;
  |                                            ^ not found in this scope

error[E0425]: cannot find value `res` in this scope
  |
  = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0425`.
error: Could not compile `paysquare`.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions