rust/compiler/rustc_parse/src/parser
Matthias Krüger f372476d2c
Rollup merge of #91150 - dtolnay:qpath, r=davidtwco
Let qpath contain NtTy: `<$:ty as $:ty>::…`

Example:

```rust
macro_rules! m {
    (<$type:ty as $trait:ty>::$name:ident) => {
        <$type as $trait>::$name
    };
}

fn main() {
    let _: m!(<str as ToOwned>::Owned);
}
```

Previous behavior:

```console
error: expected identifier, found `ToOwned`
 --> src/main.rs:3:19
  |
3 |         <$type as $trait>::$name
  |                   ^^^^^^ expected identifier
...
8 |     let _: m!(<str as ToOwned>::Owned);
  |            ---------------------------
  |            |
  |            this macro call doesn't expand to a type
  |            in this macro invocation
```

The <code>expected identifier, found \`ToOwned\`</code> error is particularly silly. I think it should be fine to accept this code as long as $trait is of the form `TyKind::Path(None, path)`; if it is any other kind of `NtTy`, we'll keep the same behavior as before.
2022-01-18 22:00:43 +01:00
..
attr.rs Do not add ; to expected tokens list when it's wrong 2021-12-04 11:05:30 -07:00
attr_wrapper.rs Change more x64 size checks to not apply to x32. 2021-09-05 16:42:36 +01:00
diagnostics.rs Rollup merge of #92876 - compiler-errors:fix-turbofish-lifetime-suggestion, r=nagisa 2022-01-17 06:08:15 +01:00
expr.rs Rollup merge of #92876 - compiler-errors:fix-turbofish-lifetime-suggestion, r=nagisa 2022-01-17 06:08:15 +01:00
generics.rs remove feature gate and cleanup code 2021-12-10 19:20:31 +00:00
item.rs ast: Always keep a NodeId in ast::Crate 2022-01-05 17:09:37 +08:00
mod.rs Do not add ; to expected tokens list when it's wrong 2021-12-04 11:05:30 -07:00
nonterminal.rs Use if-let guards in the codebase 2021-08-25 20:24:35 +02:00
pat.rs review comments: clean up 2021-11-29 18:39:08 +00:00
path.rs Rollup merge of #91150 - dtolnay:qpath, r=davidtwco 2022-01-18 22:00:43 +01:00
stmt.rs Do not add ; to expected tokens list when it's wrong 2021-12-04 11:05:30 -07:00
ty.rs Parse Ty? as Option<Ty> and provide structured suggestion 2022-01-14 00:07:23 +00:00