You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Surf crate (1.0.3), and I've hit a very rough edge: there is a public method whose return type is not public. Therefore, I can call this method and use the returned value directly, but I can't return it from my functions and neither have it as a parameter. I can't even store in a variable with explicit type signature, even though I can have a variable with implicit type.
The crate is already undergoing a new major release, and this issue has already been adressed. I'm curious about the language point of view of this behavior. Is this intended? Are there reasons why Rust should allow this? Has this been discussed already? It feels like something that really isn't right, and doesn't cope with the basic language mechanisms.
Here is a short example that reproduces the issue: playground
I would expect Rust to disallow this kind of construct. A public opaque type would have the same effect, without restricting users from passing the value around.
Meta
Both on Stable (1.43.0) and Nightly (1.45.0-nightly).
The text was updated successfully, but these errors were encountered:
I'm using the Surf crate (1.0.3), and I've hit a very rough edge: there is a public method whose return type is not public. Therefore, I can call this method and use the returned value directly, but I can't return it from my functions and neither have it as a parameter. I can't even store in a variable with explicit type signature, even though I can have a variable with implicit type.
The crate is already undergoing a new major release, and this issue has already been adressed. I'm curious about the language point of view of this behavior. Is this intended? Are there reasons why Rust should allow this? Has this been discussed already? It feels like something that really isn't right, and doesn't cope with the basic language mechanisms.
Here is a short example that reproduces the issue: playground
I would expect Rust to disallow this kind of construct. A public opaque type would have the same effect, without restricting users from passing the value around.
Meta
Both on Stable (1.43.0) and Nightly (1.45.0-nightly).
The text was updated successfully, but these errors were encountered: