rust/compiler/rustc_ast/src
León Orell Valerian Liehr 5b485f04de
Rollup merge of #125049 - dtolnay:castbrace, r=compiler-errors
Disallow cast with trailing braced macro in let-else

This fixes an edge case I noticed while porting #118880 and #119062 to syn.

Previously, rustc incorrectly accepted code such as:

```rust
let foo = &std::ptr::null as &'static dyn std::ops::Fn() -> *const primitive! {
    8
} else {
    return;
};
```

even though a right curl brace `}` directly before `else` in a `let...else` statement is not supposed to be valid syntax.
2024-05-22 19:04:44 +02:00
..
attr Move #[do_not_recommend] to the #[diagnostic] namespace 2024-05-21 13:14:41 +02:00
expand Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
util Disallow cast with trailing braced macro in let-else 2024-05-12 21:50:14 -07:00
ast.rs document what the span of UseTreeKind::Nested is 2024-05-19 10:22:19 +02:00
ast_traits.rs Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
entry.rs Various improvements to entrypoint code 2024-05-04 14:48:42 +02:00
format.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
lib.rs Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
mut_visit.rs Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
node_id.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
ptr.rs Implement BOXED_SLICE_INTO_ITER 2024-05-20 19:21:30 -04:00
token.rs Auto merge of #123865 - eholk:expr_2021, r=fmease 2024-05-17 21:54:14 +00:00
tokenstream.rs Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
visit.rs Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00