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 instead of syntax error while calling super() #82156

Closed
plazmoid opened this issue Feb 15, 2021 · 5 comments · Fixed by #82259
Closed

ICE instead of syntax error while calling super() #82156

plazmoid opened this issue Feb 15, 2021 · 5 comments · Fixed by #82259
Assignees
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@plazmoid
Copy link

plazmoid commented Feb 15, 2021

I tried to call default trait implementation from overriden method. Googling was not so useful as wanted so I started playing with "super" keyword and found this bug.

Code

fn main() {
    super();
}

Meta

Bug appears both on stable and nightly

rustc --version --verbose:

rustc 1.50.0 (cb75ad5db 2021-02-10)
binary: rustc
commit-hash: cb75ad5db02783e8b0222fee363c5f63f7e2cf5b
commit-date: 2021-02-10
host: x86_64-unknown-linux-gnu
release: 1.50.0

rustc 1.52.0-nightly (e9920ef77 2021-02-11)
binary: rustc
commit-hash: e9920ef7749d11fc71cc32ca4ba055bcfeaab945
commit-date: 2021-02-11
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_resolve/src/late/diagnostics.rs:138: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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0 (cb75ad5db 2021-02-10) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:50:5
   3: rustc_resolve::late::diagnostics::<impl rustc_resolve::late::LateResolutionVisitor>::smart_resolve_report_errors
   4: rustc_resolve::late::LateResolutionVisitor::smart_resolve_path_fragment
   5: rustc_resolve::late::LateResolutionVisitor::resolve_expr
   6: rustc_resolve::late::LateResolutionVisitor::resolve_expr
   7: <rustc_resolve::late::LateResolutionVisitor as rustc_ast::visit::Visitor>::visit_block
   8: <rustc_resolve::late::LateResolutionVisitor as rustc_ast::visit::Visitor>::visit_fn
   9: rustc_ast::visit::walk_item
  10: rustc_resolve::late::LateResolutionVisitor::resolve_item
  11: rustc_resolve::Resolver::resolve_crate
  12: rustc_interface::passes::configure_and_expand_inner
  13: rustc_interface::passes::configure_and_expand::{{closure}}
  14: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  15: rustc_interface::passes::configure_and_expand
  16: rustc_interface::queries::Queries::expansion
  17: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  18: rustc_span::with_source_map
  19: rustc_interface::interface::create_compiler_and_run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@plazmoid plazmoid added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 15, 2021
@jonas-schievink jonas-schievink added A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 15, 2021
@hameerabbasi
Copy link
Contributor

Bisected:

********************************************************************************
Regression in nightly-2020-06-05
********************************************************************************

fetching https://static.rust-lang.org/dist/2020-06-04/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2020-06-04: 40 B / 40 B [===============] 100.00 % 720.31 KB/s converted 2020-06-04 to 56daaf669ebc3d5083db5cded719f780dc31104e
fetching https://static.rust-lang.org/dist/2020-06-05/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2020-06-05: 40 B / 40 B [===============] 100.00 % 778.59 KB/s converted 2020-06-05 to 47c3158c3d797f75f0f7b2b2a977179668919dab
looking for regression commit between 2020-06-04 and 2020-06-05
opening existing repository at "rust.git"
refreshing repository
fetching (via local git) commits from 56daaf669ebc3d5083db5cded719f780dc31104e to 47c3158c3d797f75f0f7b2b2a977179668919dab
opening existing repository at "rust.git"
refreshing repository
looking up first commit
looking up second commit
checking that commits are by bors and thus have ci artifacts...
finding bors merge commits
found 6 bors merge commits in the specified range
  commit[0] 2020-06-03UTC: Auto merge of #72948 - Dylan-DPC:rollup-fazhw00, r=Dylan-DPC
  commit[1] 2020-06-03UTC: Auto merge of #72754 - lcnr:predicate-fold, r=nikomatsakis
  commit[2] 2020-06-04UTC: Auto merge of #72618 - Aaron1011:feature/early-sourcemap, r=petrochenkov
  commit[3] 2020-06-04UTC: Auto merge of #72975 - Dylan-DPC:rollup-6zvco5x, r=Dylan-DPC
  commit[4] 2020-06-04UTC: Auto merge of #72882 - marmeladema:save-analysis-hir-tree, r=Xanewok
  commit[5] 2020-06-04UTC: Auto merge of #72995 - Dylan-DPC:rollup-7gsyb8x, r=Dylan-DPC
ERROR: no commits between 56daaf669ebc3d5083db5cded719f780dc31104e and 47c3158c3d797f75f0f7b2b2a977179668919dab within last 167 days

@jyn514 jyn514 added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Feb 16, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 16, 2021

Relevant code:

let item_str = path.last().unwrap().ident;

In case it helps, the merges in nightly-2020-06-05 were #72948, #72754, #72618, #72975, #72882, and #72995.

Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0ccab6c6b67a5c848dffdd6a369f2438

@camelid
Copy link
Member

camelid commented Feb 16, 2021

Error from just before the regression was introduced (run with nightly-2020-06-01):

error[E0433]: failed to resolve: there are too many leading `super` keywords
 --> <anon>:2:5
  |
2 |     super();
  |     ^^^^^ there are too many leading `super` keywords

error: aborting due to previous error

For more information about this error, try `rustc --explain E0433`.

@camelid
Copy link
Member

camelid commented Feb 16, 2021

Assigning P-medium and removing I-prioritize as discussed in the prioritization working group.

@camelid camelid added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 16, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Feb 16, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Feb 16, 2021
@osa1
Copy link
Contributor

osa1 commented Feb 18, 2021

@rustbot claim

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 19, 2021
Fix popping singleton paths in when generating E0433

Fixes rust-lang#82156

---

This was introduced with rust-lang#72923, so pinging `@Patryk27` for reviews.
@bors bors closed this as completed in 9889e44 Feb 19, 2021
cuviper pushed a commit to cuviper/rust that referenced this issue Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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.

7 participants