-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Spurious type deduced when using ?
#71685
Comments
Looks like This has the problem: fn fn2(s: &str) -> Result<(), ()> {
let _ = s.parse().map_err(|_| ())?;
Ok(())
} But not this: fn fn2(s: &str) {
let _ = s.parse().unwrap();
} |
?
I think label "F-associated_type_bounds", "requires-nightly" should be removed. "A-diagnostics" should be added. |
Minimal repro
with
I agree with @yshui here: this is really just a diagnostics issue. |
Add some tests for associated-type-bounds issues Closes rust-lang#38917 Closes rust-lang#40093 Closes rust-lang#43475 Closes rust-lang#63591 rust-lang#47897 is likely closable too, but it needs an MCVE ~~rust-lang#38917, rust-lang#40093, rust-lang#43475, rust-lang#47897 all are mislabeled and shouldn't have the `F-associated-type-bounds` label~~ ~~rust-lang#71685 is also mislabeled as commented on in that thread~~
Current output:
|
This is a duplicate of #38508. Closing it in favor of the older one. |
I tried this code:
I expected to see this happen:
error[E0282]: type annotations needed
, because type ofs
cannot be determined.Instead, this happened:
error[E0277]: the trait bound '(): std::str::FromStr' is not satisfied
As if
s
is assigned type()
The text was updated successfully, but these errors were encountered: