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

Add project skeleton generation to rust pkg #8643

Closed
DylanLukes opened this issue Aug 20, 2013 · 3 comments
Closed

Add project skeleton generation to rust pkg #8643

DylanLukes opened this issue Aug 20, 2013 · 3 comments

Comments

@DylanLukes
Copy link

I think it'd be beneficial for getting new rust programmers up to speed to have something along the lines of npm create, that generates a simple project structure for a library or executable program, or both.

I'm entirely unfamiliar with what they're supposed to look like myself as of yet, and have been unable to find anything explaining it. If I knew, I'd implement this myself...

  • Dylan
@metajack
Copy link
Contributor

leiningen does this particularly well. It makes things from templates and can also look up template plugins from clojars, so that the templates don't have to be installed when you run it.

@emberian
Copy link
Member

This should probably wait until rustpkg figures out how it wants to work.

@thestinger
Copy link
Contributor

rustpkg is gone

Jarcho pushed a commit to Jarcho/rust that referenced this issue Aug 29, 2022
Refactor `FormatArgsExpn`

It now for each format argument `{..}` has:
- The `Expr` it points to, and how it does so (named/named inline/numbered/implicit)
- The parsed `FormatSpec` (format trait/fill/align/etc., the precision/width and any value they point to)
- Many spans

The caller no longer needs to pair up arguments to their value, or separately interpret the `specs` `Expr`s when it isn't `None`

The gist is that it combines the result of [`rustc_parse_format::Parser`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse_format/struct.Parser.html) with the macro expansion itself

This unfortunately makes the code a bit longer, however we need to use both as neither have all the information we're after. `rustc_parse_format` doesn't have the information to resolve named arguments to their values. The macro expansion doesn't contain whether the positions are implicit/numbered/named, or the spans for format arguments

Wanted by rust-lang#9233 and rust-lang#8518 to be able to port the changes from rust-lang#9040

Also fixes rust-lang#8643, previously the format args seem to have been paired up with the wrong values somehow

changelog: [`format_in_format_args`]: Fix false positive due to misattributed arguments

r? `@flip1995`
cc `@nyurik`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants