Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: unprintable span #33185

Closed
Manishearth opened this issue Apr 24, 2016 · 2 comments
Closed

ICE: unprintable span #33185

Manishearth opened this issue Apr 24, 2016 · 2 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Manishearth
Copy link
Member

#[macro_export]
macro_rules! state {
    ( $( $name:ident : $field:ty )* ) => (
        #[derive(Default)]
        struct State {
            $($name : $field),*
        }
    )
}

state! { x: i64 }

pub fn main() {
}

gives:

<anon>:11:11: 6:20 warning: struct field is never used: `x`, #[warn(dead_code)] on by default
(internal compiler error: unprintable span)
<anon>:11:1: 11:18 note: in this expansion of state! (defined in <anon>)

(no backtrace)

@Manishearth Manishearth added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Apr 24, 2016
@Mark-Simulacrum
Copy link
Member

Fixed.

warning: field is never used: `x`, #[warn(dead_code)] on by default
  --> /tmp/t.rs:11:11
   |
11 | state! { x: i64 }
   | ----------^------
   | |
   | in this macro invocation

@Mark-Simulacrum
Copy link
Member

E-needstest.

warning: field is never used: `x`
  --> test.rs:11:10
   |
6  | |             $($name : $field),*
   | |____________________________^
...
11 |   state! { x: i64 }
   |  _---------^-------
   | | |
   | | in this macro invocation
   |
   = note: #[warn(dead_code)] on by default


@Mark-Simulacrum Mark-Simulacrum added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label May 15, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
mattico added a commit to mattico/rust that referenced this issue Sep 2, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Sep 6, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants