Skip to content

"Don't know the field number in this context" #64385

Closed
@dtolnay

Description

@dtolnay
src/lib.rs:
struct S(#[attr] u8);

Stable, and nightly-2019-09-09:

error[E0658]: the attribute `attr` is currently unknown to the compiler and may have meaning added to it in the future
 --> src/main.rs:1:10
  |
1 | struct S(#[attr] u8);
  |          ^^^^^^^
  |
  = note: for more information, see https://github.com/rust-lang/rust/issues/29642
  = help: add `#![feature(custom_attribute)]` to the crate attributes to enable

nightly-2019-09-10:

thread 'rustc' panicked at 'don't know the field number in this context', src/librustc/hir/map/def_collector.rs:346:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.39.0-nightly (0b36e9dea 2019-09-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

2b8116d...0b36e9d

Mentioning @c410-f3r @petrochenkov because this is likely from #63468.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions