Release notes
*Sourced from [quote's releases](https://github.com/dtolnay/quote/releases).*
> ## 1.0.0
> This release fixes some longstanding limitations of the `quote!` macro, bringing quote better in line with the patterns that macro authors are used to from working with macro\_rules.
>
>
>
> ## Duplicate interpolations in a repetition
>
> In past versions of quote, interpolating the same variable multiple times inside of one repeating block was not allowed.
>
> For example if we had an iterator of local variable names and wanted the generated code to do a clone of each one, that wouldn't compile:
>
> ```console
> error[E0416]: identifier `var` is bound more than once in the same pattern
> --> src/main.rs:7:27
> |
> 7 | #( let #var = #var.clone(); )*
> | ^^^ used in a pattern more than once
> ```
>
> Macros usually worked around this by having the same sequence of interpolated values named two different things:
>
> ```rust
> // old workaround 1
> let var = input.fields.iter().map(|field| &field.ident);
> let var2 = var.clone();
>
> quote! {
> #( let #var = #var2.clone(); )*
> }
> ```
>
> or by giving up on repetitions and doing more of the work within the iterator chain:
>
> ```rust
> // old workaround 2
> let var_clones = input
> .fields
> .iter()
> .map(|field| {
> let var = &field.ident;
> quote! {
> let #var = #var.clone();
> }
> });
>
> quote! {
> #(#var_clones)*
> }
> ```
>
> ... (truncated)
Commits
- [`97d4571`](https://github.com/dtolnay/quote/commit/97d457120732acd576856ce68cc1592870b63f23) Release 1.0.0
- [`ab7241b`](https://github.com/dtolnay/quote/commit/ab7241b6d31a299d054d570e71acbfbd550501fc) Release 1.0.0-rc3
- [`1d757d4`](https://github.com/dtolnay/quote/commit/1d757d4bda76933aaf64005b00bd0e43108c5cee) Can assume Span::join exists
- [`640899a`](https://github.com/dtolnay/quote/commit/640899aa86884b7a00c4f4eef9c3ad5f485a01f3) Update to proc-macro2 rc2
- [`35c085d`](https://github.com/dtolnay/quote/commit/35c085d4ae2d1e4d023382551321828d0ab851fd) Space apart rustdoc sections
- [`dbe67ef`](https://github.com/dtolnay/quote/commit/dbe67ef8d9c144012ee941b412229e0cbd5872ee) Document tuple indexing
- [`353ecdc`](https://github.com/dtolnay/quote/commit/353ecdcda86f2fbd5f596eaad768675b4490b7b7) Merge pull request [#125](https://github-redirect.dependabot.com/dtolnay/quote/issues/125) from dtolnay/doc
- [`96ec7e7`](https://github.com/dtolnay/quote/commit/96ec7e7f64272ff8766ea37accb330ed143d2256) Document interpolating in doc comments
- [`5dd3812`](https://github.com/dtolnay/quote/commit/5dd3812c1cc01847f8e525fa3adbc6179126b5cf) Remove outdated doc about def_site
- [`5218552`](https://github.com/dtolnay/quote/commit/5218552d94bf0bd675939a6e5f87408d23533657) Em dashes
- Additional commits viewable in [compare view](https://github.com/dtolnay/quote/compare/0.6.12...1.0.0)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
Bumps quote from 0.6.12 to 1.0.0.
Release notes
*Sourced from [quote's releases](https://github.com/dtolnay/quote/releases).* > ## 1.0.0 > This release fixes some longstanding limitations of the `quote!` macro, bringing quote better in line with the patterns that macro authors are used to from working with macro\_rules. > >> > ## Duplicate interpolations in a repetition > > In past versions of quote, interpolating the same variable multiple times inside of one repeating block was not allowed. > > For example if we had an iterator of local variable names and wanted the generated code to do a clone of each one, that wouldn't compile: > > ```console > error[E0416]: identifier `var` is bound more than once in the same pattern > --> src/main.rs:7:27 > | > 7 | #( let #var = #var.clone(); )* > | ^^^ used in a pattern more than once > ``` > > Macros usually worked around this by having the same sequence of interpolated values named two different things: > > ```rust > // old workaround 1 > let var = input.fields.iter().map(|field| &field.ident); > let var2 = var.clone(); > > quote! { > #( let #var = #var2.clone(); )* > } > ``` > > or by giving up on repetitions and doing more of the work within the iterator chain: > > ```rust > // old workaround 2 > let var_clones = input > .fields > .iter() > .map(|field| { > let var = &field.ident; > quote! { > let #var = #var.clone(); > } > }); > > quote! { > #(#var_clones)* > } > ``` > > ... (truncated)
Commits
- [`97d4571`](https://github.com/dtolnay/quote/commit/97d457120732acd576856ce68cc1592870b63f23) Release 1.0.0 - [`ab7241b`](https://github.com/dtolnay/quote/commit/ab7241b6d31a299d054d570e71acbfbd550501fc) Release 1.0.0-rc3 - [`1d757d4`](https://github.com/dtolnay/quote/commit/1d757d4bda76933aaf64005b00bd0e43108c5cee) Can assume Span::join exists - [`640899a`](https://github.com/dtolnay/quote/commit/640899aa86884b7a00c4f4eef9c3ad5f485a01f3) Update to proc-macro2 rc2 - [`35c085d`](https://github.com/dtolnay/quote/commit/35c085d4ae2d1e4d023382551321828d0ab851fd) Space apart rustdoc sections - [`dbe67ef`](https://github.com/dtolnay/quote/commit/dbe67ef8d9c144012ee941b412229e0cbd5872ee) Document tuple indexing - [`353ecdc`](https://github.com/dtolnay/quote/commit/353ecdcda86f2fbd5f596eaad768675b4490b7b7) Merge pull request [#125](https://github-redirect.dependabot.com/dtolnay/quote/issues/125) from dtolnay/doc - [`96ec7e7`](https://github.com/dtolnay/quote/commit/96ec7e7f64272ff8766ea37accb330ed143d2256) Document interpolating in doc comments - [`5dd3812`](https://github.com/dtolnay/quote/commit/5dd3812c1cc01847f8e525fa3adbc6179126b5cf) Remove outdated doc about def_site - [`5218552`](https://github.com/dtolnay/quote/commit/5218552d94bf0bd675939a6e5f87408d23533657) Em dashes - Additional commits viewable in [compare view](https://github.com/dtolnay/quote/compare/0.6.12...1.0.0)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot.