Skip to content

Different results when expanding macros manually #6788

@auroranockert

Description

@auroranockert

The code https://gist.github.com/jensnockert/ab64d115023bf9d20261 (unfortunately requires OpenCL to link with) produces the following warnings

min.rs:21:8: 21:13 warning: value assigned to `error` is never read [-W dead-assignment (default)]
min.rs:21 let error = unsafe { $name($($arg),+) };
^~~~~
min.rs:20:0: 26:3 note: in expansion of cl_call!
min.rs:35:4: 35:93 note: expansion site
min.rs:28:0: 40:3 note: in expansion of cl_call_unknown_length!
min.rs:43:38: 43:123 note: expansion site

When compiled like rust build min.rs, but when doing the two-step process rustc --pretty expanded min.rs > min-expanded.rs then rust build min-expanded.rs it builds without warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions