Skip to content

Poor error message when attempting to use runtime from #[start] function #8887

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

Closed
jsanders opened this issue Aug 30, 2013 · 2 comments
Closed

Comments

@jsanders
Copy link
Contributor

Per #5809, you have to do some maneuvering just to print from a #[start] function, but if you don't know that, you get a very mysterious error at runtime:

#[start]
fn main(_: int, _: **u8, _: *u8) -> int { 
  println("Hello!\n");
  return 0;
}
$ ./hello

You've met with a terrible fate, haven't you?

fatal runtime error: runtime tls key not initialized
Abort trap: 6
@alexcrichton
Copy link
Member

This is working today, closing. (there's a test somewhere in the test suite for this)

@jsanders
Copy link
Contributor Author

Thanks! Sorry I hadn't kept my eye on it.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
…, r=Centri3,xFrednet

Fix false positive of [self_named_module_files] and [mod_module_files]

changelog: [self_named_module_files] [mod_module_files]: No longer lints dependencies located in subdirectory of workspace

fixes rust-lang#8887

---

First time contributor here, just read contribution guide today.

I have several questions:

1. ~Is it the correct way to use environment variable `CARGO_HOME` to get the location of cargo home directory?~
(Edit: Code no longer uses CARGO_HOME)
2. How to setup test for this PR? This involves multiple files and `CARGO_HOME` setup. ~Not sure how to do this.~
~Edit: Working on tests right now~ A workspace_test has been added
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

2 participants