Skip to content

Conversation

@dtolnay
Copy link
Owner

@dtolnay dtolnay commented Sep 29, 2025

Before:

error[E0308]: mismatched types
 --> tests/ui/does-not-have-iter-interpolated.rs:8:5
  |
8 |     quote!(#(#nonrep)*);
  |     ^^^^^^^^^^^^^^^^^^^
  |     |
  |     expected `HasIterator`, found `ThereIsNoIteratorInRepetition`
  |     expected due to this
  |     here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition`
  |
  = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

After:

error[E0277]: repetition contains no interpolated value that is an iterator
 --> tests/ui/does-not-have-iter-interpolated.rs:8:5
  |
8 |     quote!(#(#nonrep)*);
  |     ^^^^^^^^^^^^^^^^^^^ none of the values interpolated inside this repetition are iterable
  |
  = help: the trait `CheckHasIterator<true>` is not implemented for `HasIterator<false>`
          but it is implemented for `HasIterator<true>`
  = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

@dtolnay dtolnay changed the title Use diagnostic::on_unimplemented for no iterator in repetition Use diagnostic::on_unimplemented for checking iterator in repetition Sep 29, 2025
@dtolnay dtolnay merged commit 68956e6 into master Sep 29, 2025
18 checks passed
@dtolnay dtolnay deleted the hasiter branch September 29, 2025 00:51
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

Successfully merging this pull request may close these issues.

2 participants