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

"type ... too big for the current architecture" error reported without span pointing to type #25116

Open
oli-obk opened this issue May 5, 2015 · 4 comments · Fixed by #63152
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented May 5, 2015

e053dfa added checks for huge types. These checks are done in middle/trans, but the location of the type is not reported.

For anonymous array types there's no way to extract the span, as the ast-ID is lost.

An example:

fn main() {
    let _x = [0; 9223372036854775808];
}

the error message:

error: the type `[i32; 9223372036854775808]` is too big for the current architecture
@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label May 7, 2015
@steveklabnik
Copy link
Member

Triage: no change.

@steveklabnik steveklabnik added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 9, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@czipperz
Copy link
Contributor

czipperz commented Jun 1, 2019

Playground link

Centril added a commit to Centril/rust that referenced this issue Aug 5, 2019
Always error on `SizeOverflow` during mir evaluation

Fix rust-lang#55878, fix rust-lang#25116.

r? @oli-obk
Centril added a commit to Centril/rust that referenced this issue Aug 6, 2019
Always error on `SizeOverflow` during mir evaluation

Fix rust-lang#55878, fix rust-lang#25116.

r? @oli-obk
bors added a commit that referenced this issue Aug 6, 2019
Always error on `SizeOverflow` during mir evaluation

Fix #55878, fix #25116.

r? @oli-obk
bors added a commit that referenced this issue Aug 7, 2019
Always error on `SizeOverflow` during mir evaluation

Fix #55878, fix #25116.

r? @oli-obk
@oli-obk oli-obk reopened this Nov 18, 2020
@oli-obk
Copy link
Contributor Author

oli-obk commented Nov 18, 2020

The diagnostic is actually wrong. It's not about the type, it's about values of that type. You can use any type no matter its size for trait resolution and such, you just can't create values of it.

Additionally, we're still not emitting this error with spans. I think the only way to reasonably do this is to create a new well formedness bound that is automatically added to a function's where bounds for all types within that function that are used with values, but for which we can't prove well-formedness. This may be very expensive, since it spawns lots of new where bounds where there were none before. Not sure, but may be worth an experiment

@oli-obk oli-obk added the E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. label Nov 18, 2020
@estebank
Copy link
Contributor

Current output:

error: values of the type `[i32; 9223372036854775808]` are too big for the current architecture

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-bug Category: This is a bug. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. 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