-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Guide: Some Nitpicking #17191
Comments
Since the details of Option are explained right in the next chapter, I think it's fine as it is, but prehaps one could write something like: "Rust provides a method on these IoResults called ok(), which does the same thing as our match statement, but assuming that we have a valid value. If we don't, it will return an Option, which we will explore in the next chapter, (for now, we can say that it will terminate our program)" or something like that. |
@steveklabnik People keep noticing and commenting on this, so I think we should at least have a more obvious note pointing people to |
The Is there a way we can have the range function without a trait? That's the blocking issue here. |
+1 on a range function. The fact that the obvious way to do this is too hard for beginner docs indicates that an API adjustment might be a good idea. |
/cc @aturon , what do you think about removing the need for this trait? |
@steveklabnik We could potentially do it by adding a default type parameter. Would that suffice? Or do you need to show the signature in full (in which case this would make it even more complex)? |
A default parameter would be fine. I don't actually need to show the type signature. |
@huonw is going to work on stabilizing |
I'm giving this a close, finally, as it's not even sure that |
fix: Insert a generic arg for `impl Trait` when lowering generic args Fixes rust-lang#17191 We are not inserting a generic arg when lowering generics like ```rust fn foo<T: B<impl A>(..) { ... } ``` but when we are lowering predicates we do; https://github.com/rust-lang/rust-analyzer/blob/aa00ddcf654a35ba0eafe17247cf189958d33182/crates/hir-ty/src/lower.rs#L1697-L1718 https://github.com/rust-lang/rust-analyzer/blob/aa00ddcf654a35ba0eafe17247cf189958d33182/crates/hir-ty/src/lower.rs#L310 and this mismatch causes index out of bound panic while substituting the predicates
ok()
documentation in the read_line example is not just inaccurate, it's misleading and wrong..ok()
does not abort the program, it returns an option. Maybe it needs to have an option section before to explain that type.%
to make random numbers. This is a bad idea and generally guides are something people copy out of, so I would propose not bringing an antipattern into the mix.The text was updated successfully, but these errors were encountered: