-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
assign a Closure in Enum #48838
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
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.
Comments
sfackler
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Mar 8, 2018
#![crate_type = "rlib"]
enum Functions {
Square = |x| x,
} |
leoyvens
added a commit
to leoyvens/rust
that referenced
this issue
May 10, 2018
During type collection, error if a closures is found in constant position, catching that before they go causing ICEs. Fixes rust-lang#50600. Fixes rust-lang#48838.
XAMPPRocky
added
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 14, 2018
bors
added a commit
that referenced
this issue
May 20, 2018
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants". Previously, constants in array lengths and enum variant discriminants were "merely an expression", and had no separate ID for, e.g. type-checking or const-eval, instead reusing the expression's. That complicated code working with bodies, because such constants were the only special case where the "owner" of the body wasn't the HIR parent, but rather the same node as the body itself. Also, if the body happened to be a closure, we had no way to allocate a `DefId` for both the constant *and* the closure, leading to *several* bugs (mostly ICEs where type errors were expected). This PR rectifies the situation by adding another (`{ast,hir}::AnonConst`) node around every such constant. Also, const generics are expected to rely on the new `AnonConst` nodes, as well (cc @varkor). * fixes #48838 * fixes #50600 * fixes #50688 * fixes #50689 * obsoletes #50623 r? @nikomatsakis
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Feb 5, 2025
Rename and Move some UI tests to more suitable subdirs ## Affected Tests - tests/ui/issues/issue-48838.rs -> tests/ui/enum/closure-in-enum-issue-48838.rs rust-lang#48838 - tests/ui/issues/issue-40350.rs -> tests/ui/enum/enum-inside-enum-issue-40350.rs rust-lang#40350 - tests/ui/issues/issue-41272.rs -> tests/ui/expr/if/if-let-no-match-guards-issue-41272.rs rust-lang#41272 - tests/ui/issues/issue-40408.rs -> tests/ui/lexer/floating-point-0e10-issue-40408.rs rust-lang#40408 - tests/ui/issues/issue-40136.rs -> tests/ui/macros/const-expr-invocations-issue-40136.rs rust-lang#40136 - tests/ui/issues/issue-40845.rs -> tests/ui/macros/macros-in-trait-positions-issue-40845.rs rust-lang#40845 - tests/ui/issues/issue-41213.rs -> tests/ui/match/enum-and-break-in-match-issue-41213.rs rust-lang#41213 - tests/ui/issues/issue-40782.rs -> tests/ui/suggestions/for-loop-missing-in.rs rust-lang#40782 - tests/ui/issues/issue-40827.rs -> tests/ui/trait-bounds/deep-level-Send-bound-check-issue-40827.rs rust-lang#40827 - tests/ui/issues/issue-40610.rs -> tests/ui/typeck/coercion-check-for-addition-issue-40610.rs rust-lang#40610 - tests/ui/issues/issue-40883.rs -> tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs rust-lang#40883 - tests/ui/issues/issue-40861.rs -> tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.rs rust-lang#40861 - tests/ui/issues/issue-41139.rs -> tests/ui/typeck/unsized-rvalue-issue-41139.rs rust-lang#41139 - tests/ui/issues/issue-40749.rs -> tests/ui/wf/range-expr-root-of-constant-issue-40749.rs rust-lang#40749 - tests/ui/issues/issue-40235.rs -> tests/ui/while/while-let-scope-issue-40235.rs rust-lang#40235
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Feb 5, 2025
Rename and Move some UI tests to more suitable subdirs ## Affected Tests - tests/ui/issues/issue-48838.rs -> tests/ui/enum/closure-in-enum-issue-48838.rs rust-lang#48838 - tests/ui/issues/issue-40350.rs -> tests/ui/enum/enum-inside-enum-issue-40350.rs rust-lang#40350 - tests/ui/issues/issue-41272.rs -> tests/ui/expr/if/if-let-no-match-guards-issue-41272.rs rust-lang#41272 - tests/ui/issues/issue-40408.rs -> tests/ui/lexer/floating-point-0e10-issue-40408.rs rust-lang#40408 - tests/ui/issues/issue-40136.rs -> tests/ui/macros/const-expr-invocations-issue-40136.rs rust-lang#40136 - tests/ui/issues/issue-40845.rs -> tests/ui/macros/macros-in-trait-positions-issue-40845.rs rust-lang#40845 - tests/ui/issues/issue-41213.rs -> tests/ui/match/enum-and-break-in-match-issue-41213.rs rust-lang#41213 - tests/ui/issues/issue-40782.rs -> tests/ui/suggestions/for-loop-missing-in.rs rust-lang#40782 - tests/ui/issues/issue-40827.rs -> tests/ui/trait-bounds/deep-level-Send-bound-check-issue-40827.rs rust-lang#40827 - tests/ui/issues/issue-40610.rs -> tests/ui/typeck/coercion-check-for-addition-issue-40610.rs rust-lang#40610 - tests/ui/issues/issue-40883.rs -> tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs rust-lang#40883 - tests/ui/issues/issue-40861.rs -> tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.rs rust-lang#40861 - tests/ui/issues/issue-41139.rs -> tests/ui/typeck/unsized-rvalue-issue-41139.rs rust-lang#41139 - tests/ui/issues/issue-40749.rs -> tests/ui/wf/range-expr-root-of-constant-issue-40749.rs rust-lang#40749 - tests/ui/issues/issue-40235.rs -> tests/ui/while/while-let-scope-issue-40235.rs rust-lang#40235
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Feb 5, 2025
Rename and Move some UI tests to more suitable subdirs ## Affected Tests - tests/ui/issues/issue-48838.rs -> tests/ui/enum/closure-in-enum-issue-48838.rs rust-lang#48838 - tests/ui/issues/issue-40350.rs -> tests/ui/enum/enum-inside-enum-issue-40350.rs rust-lang#40350 - tests/ui/issues/issue-41272.rs -> tests/ui/expr/if/if-let-no-match-guards-issue-41272.rs rust-lang#41272 - tests/ui/issues/issue-40408.rs -> tests/ui/lexer/floating-point-0e10-issue-40408.rs rust-lang#40408 - tests/ui/issues/issue-40136.rs -> tests/ui/macros/const-expr-invocations-issue-40136.rs rust-lang#40136 - tests/ui/issues/issue-40845.rs -> tests/ui/macros/macros-in-trait-positions-issue-40845.rs rust-lang#40845 - tests/ui/issues/issue-41213.rs -> tests/ui/match/enum-and-break-in-match-issue-41213.rs rust-lang#41213 - tests/ui/issues/issue-40782.rs -> tests/ui/suggestions/for-loop-missing-in.rs rust-lang#40782 - tests/ui/issues/issue-40827.rs -> tests/ui/trait-bounds/deep-level-Send-bound-check-issue-40827.rs rust-lang#40827 - tests/ui/issues/issue-40610.rs -> tests/ui/typeck/coercion-check-for-addition-issue-40610.rs rust-lang#40610 - tests/ui/issues/issue-40883.rs -> tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs rust-lang#40883 - tests/ui/issues/issue-40861.rs -> tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.rs rust-lang#40861 - tests/ui/issues/issue-41139.rs -> tests/ui/typeck/unsized-rvalue-issue-41139.rs rust-lang#41139 - tests/ui/issues/issue-40749.rs -> tests/ui/wf/range-expr-root-of-constant-issue-40749.rs rust-lang#40749 - tests/ui/issues/issue-40235.rs -> tests/ui/while/while-let-scope-issue-40235.rs rust-lang#40235
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
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.
Compiler say it's a bug :note: the compiler unexpectedly panicked. this is a bug.
I tried this code:
Meta
The text was updated successfully, but these errors were encountered: