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

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

Closed
dtolnay opened this issue Sep 11, 2019 · 5 comments · Fixed by #64457
Closed

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

dtolnay opened this issue Sep 11, 2019 · 5 comments · Fixed by #64457
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dtolnay
Copy link
Member

dtolnay commented Sep 11, 2019

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.

@dtolnay dtolnay added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Sep 11, 2019
@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-nominated A-attributes Area: Attributes (`#[…]`, `#![…]`) labels Sep 11, 2019
@petrochenkov petrochenkov self-assigned this Sep 11, 2019
@petrochenkov
Copy link
Contributor

Yeah, this is some known shortcut taken in #63468, sorry.
Didn't expect people to hit it that fast.
Will fix ~this weekend.

@dtolnay
Copy link
Member Author

dtolnay commented Sep 11, 2019

Thanks. The realistic usage where this appears is if you forget to import a derive macro, which happens commonly.

//use serde::Deserialize;

#[derive(Deserialize)]
struct Outer<'a>(#[serde(borrow)] Inner<'a>);

@Centril
Copy link
Contributor

Centril commented Sep 11, 2019

Un-nominating since Vadim self-assigned.

@pnkfelix
Copy link
Member

triage: P-high.

@petrochenkov
Copy link
Contributor

Fixed in #64457.

@petrochenkov petrochenkov removed their assignment Sep 14, 2019
@bors bors closed this as completed in 8f55245 Sep 15, 2019
sdbondi added a commit to tari-project/tari that referenced this issue Oct 11, 2019
- rust nightly-2019-10-04 (Requires new docker image build)
- futures alpha.19
- tokio alpha.6
- tower alpha2

Came across this panic in the rust compiler in a PR to follow:
rust-lang/rust#64385
sdbondi added a commit to tari-project/tari that referenced this issue Oct 11, 2019
- rust nightly-2019-10-04 (Requires new docker image build)
- futures alpha.19
- tokio alpha.6
- tower alpha2

Came across this panic in the rust compiler in a PR to follow:
rust-lang/rust#64385
sdbondi added a commit to tari-project/tari that referenced this issue Oct 14, 2019
- rust nightly-2019-10-04 (Requires new docker image build)
- futures alpha.19
- tokio alpha.6
- tower alpha2

Came across this panic in the rust compiler in a PR to follow:
rust-lang/rust#64385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants