-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 "function is expected to take 1 argument, but it takes 2 arguments" #48046
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
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.
Comments
Backtrace:
|
estebank
added
A-diagnostics
Area: Messages for errors, warnings, and lints
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
Feb 8, 2018
triage: P-high -- has pending fix in #48047 |
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Feb 8, 2018
…-on-target-without-span, r=estebank Fix ICE for mismatched args on target without span Commit 7ed00ca improved our error reporting by including the target function in our error messages when there is an argument count mismatch. A simple example from the UI tests is: ``` error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:32:53 | 32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo); | ^^^ expected function that takes a single 2-tuple as argument ... 44 | fn foo() {} | -------- takes 0 arguments ``` However, this assumed the target span was always available. This does not hold true if the target function is in `std` or another crate. A simple example from rust-lang#48046 is assigning `str::split` to a function type with a different number of arguments. Fix by omitting all of the labels and suggestions related to the target span when it's not found. Fixes rust-lang#48046 r? @estebank
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Feb 9, 2018
…-on-target-without-span, r=estebank Fix ICE for mismatched args on target without span Commit 7ed00ca improved our error reporting by including the target function in our error messages when there is an argument count mismatch. A simple example from the UI tests is: ``` error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:32:53 | 32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo); | ^^^ expected function that takes a single 2-tuple as argument ... 44 | fn foo() {} | -------- takes 0 arguments ``` However, this assumed the target span was always available. This does not hold true if the target function is in `std` or another crate. A simple example from rust-lang#48046 is assigning `str::split` to a function type with a different number of arguments. Fix by omitting all of the labels and suggestions related to the target span when it's not found. Fixes rust-lang#48046 r? @estebank
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Feb 10, 2018
…-on-target-without-span, r=estebank Fix ICE for mismatched args on target without span Commit 7ed00ca improved our error reporting by including the target function in our error messages when there is an argument count mismatch. A simple example from the UI tests is: ``` error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:32:53 | 32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo); | ^^^ expected function that takes a single 2-tuple as argument ... 44 | fn foo() {} | -------- takes 0 arguments ``` However, this assumed the target span was always available. This does not hold true if the target function is in `std` or another crate. A simple example from rust-lang#48046 is assigning `str::split` to a function type with a different number of arguments. Fix by omitting all of the labels and suggestions related to the target span when it's not found. Fixes rust-lang#48046 r? @estebank
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
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.
Minified example (Playground)
Tested working as expected on stable and beta:
Nightly on 2018-02-05 and 2018-02-06 throw the following ICE:
The text was updated successfully, but these errors were encountered: