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: adt::represent_type called on non-ADT type when returning during tuple initialization #15993

Closed
apoelstra opened this issue Jul 26, 2014 · 1 comment

Comments

@apoelstra
Copy link
Contributor

Today is not my day! I was trying to create a test case for another bug and I bumped into this ICE:

fn foo() -> (int, int) {
  (0, return (0, 0))
}

fn main() {}

I don't think this is a useful pattern (the original involved a try! which I had simplified to return just for the sake of bug reproduction --- with try! it doesn't ICE) but it probably shouldn't ICE.

@apoelstra
Copy link
Contributor Author

Oops! This is a dupe of #10176, sorry.

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 4, 2023
…eykril

Debug use cargo workspace root as `cwd`

fixes rust-lang#13022
lnicola pushed a commit to lnicola/rust that referenced this issue May 26, 2024
Fix inconsistent cwd of `run` and `debug` command in client

Fix rust-lang#17012. Also related to rust-lang#13022 and rust-lang#15993.

When the `kind` of runnable is `bin`, Cargo would use the workspace root as the cwd for the `run` command; otherwise, Cargo defaults to the package root as the cwd for `run`.

Initially, r-a assumed the workspace root as the cwd for all runnables in `debug` command, which led to issue rust-lang#13022. In this case, during unit testing, the `run` command would use the package root while `debug` would use the workspace root, causing inconsistency.

PR rust-lang#15993 addressed this problem by using the package root as the cwd for `debug` command. However, it also resulted in an inconsistency: when executing the `run` command within the main fn of a package (whose target is `bin`), Cargo would use the workspace root, whereas `debug` would use the package root, leading to issue rust-lang#17012.

The preferable approach is to determine the cwd based on the runnable's type. To resolve this, this PR introduces a new `cwd` field within `CargoRunnable`, allowing r-a to decide the appropriate cwd depending on the specific kind of the runnable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant