Skip to content

std::os::errno incorrectly has the return type usize #21898

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
tbu- opened this issue Feb 3, 2015 · 3 comments
Closed

std::os::errno incorrectly has the return type usize #21898

tbu- opened this issue Feb 3, 2015 · 3 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@tbu-
Copy link
Contributor

tbu- commented Feb 3, 2015

No description provided.

@kmcallister kmcallister added A-io E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Feb 4, 2015
@Jormundir
Copy link
Contributor

Should these kinds of small type changes include a test?

@tbu-
Copy link
Contributor Author

tbu- commented Feb 4, 2015

@Jormundir Don't think so.

@alexcrichton I don't know who to ask for this, but .. should the return type be newtyped?

@alexcrichton
Copy link
Member

Currently the plan for errno is to leave it unstable/remove it and possibly add it back in platform-specific modules. If it were a platform-specific API, then it's fine to have its own type on each platform.

I do think that eventually we will grow struct OsError(os::$platform::errno_type) which has nice accessor methods like .code() -> i32 or .message() -> &'static str for example.

For now though, there are no concrete plans to stabilize this API or such a structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants