Skip to content
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

proc and closure expressions do not accept ! as a return type #13490

Closed
ftxqxd opened this issue Apr 13, 2014 · 0 comments · Fixed by #16836
Closed

proc and closure expressions do not accept ! as a return type #13490

ftxqxd opened this issue Apr 13, 2014 · 0 comments · Fixed by #16836
Labels
A-grammar Area: The grammar of Rust

Comments

@ftxqxd
Copy link
Contributor

ftxqxd commented Apr 13, 2014

Example:

fn main() {
    // This is fine
    let x: proc() -> ! = proc() { loop {} }
    // error: expected type, found token NOT
    let y = proc() -> ! { loop {} }
}
ftxqxd added a commit to ftxqxd/rust that referenced this issue Aug 29, 2014
arcnmx pushed a commit to arcnmx/rust that referenced this issue Dec 17, 2022
Compute data layout of types

cc rust-lang#4091

Things that aren't working:
* Closures
* Generators (so no support for `Future` I think)
* Opaque types
* Type alias and associated types which may need normalization

Things that show wrong result:
* ~Enums with explicit discriminant~
* SIMD types
* ~`NonZero*` and similar standard library items which control layout with special attributes~

At the user level, I didn't put much work, since I wasn't confident about what is the best way to present this information. Currently it shows size and align for ADTs, and size, align, offset for struct fields, in the hover, similar to clangd. I used it some days and I feel I liked it, but we may consider it too noisy and move it to an assist or command.
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Show type alias layout

This PR expands on rust-lang#13490 to allow displaying layout data on hover for type aliases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants