Skip to content

Should Option::expect be parameterized over Any + Send? #14008

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
alexcrichton opened this issue May 7, 2014 · 1 comment · Fixed by #14610
Closed

Should Option::expect be parameterized over Any + Send? #14008

alexcrichton opened this issue May 7, 2014 · 1 comment · Fixed by #14610

Comments

@alexcrichton
Copy link
Member

In the extraction of the option module to libcore, the expect method was left to be defined in libstd. It's uncertain whether this Any + Send parameterization is necessary. If the method only took &str it could be defined in libcore.

alexcrichton added a commit to alexcrichton/rust that referenced this issue May 7, 2014
@aturon
Copy link
Member

aturon commented May 14, 2014

+1 for taking &str and nuking the extension trait.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jun 4, 2014
This commit removes the <M: Any + Send> type parameter from Option::expect in
favor of just taking a hard-coded `&str` argument. This allows this function to
move into libcore.

Previous code using strings with `expect` will continue to work, but code using
this implicitly to transmit task failure will need to unwrap manually with a
`match` statement.

[breaking-change]
Closes rust-lang#14008
bors added a commit that referenced this issue Jun 5, 2014
This commit removes the <M: Any + Send> type parameter from Option::expect in
favor of just taking a hard-coded `&str` argument. This allows this function to
move into libcore.

Previous code using strings with `expect` will continue to work, but code using
this implicitly to transmit task failure will need to unwrap manually with a
`match` statement.

[breaking-change]
Closes #14008
mcpherrinm pushed a commit to mcpherrinm/rust that referenced this issue Jun 10, 2014
This commit removes the <M: Any + Send> type parameter from Option::expect in
favor of just taking a hard-coded `&str` argument. This allows this function to
move into libcore.

Previous code using strings with `expect` will continue to work, but code using
this implicitly to transmit task failure will need to unwrap manually with a
`match` statement.

[breaking-change]
Closes rust-lang#14008
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants