diff options
| author | bors <bors@rust-lang.org> | 2023-01-26 12:44:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-26 12:44:47 +0000 |
| commit | 3e977638728922d3a6cc7bea34a2fdb8ae97f7c0 (patch) | |
| tree | ccf38bab26084eb37c133e60987ba7bd4318ec9b /compiler/rustc_mir_build | |
| parent | 40fda7b3fe2b10c6e1a0568b59516f5e7f381886 (diff) | |
| parent | db731e42b3c139587cd7a87acaa92cd82ab8a11c (diff) | |
| download | rust-3e977638728922d3a6cc7bea34a2fdb8ae97f7c0.tar.gz rust-3e977638728922d3a6cc7bea34a2fdb8ae97f7c0.zip | |
Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
Move format_args!() into AST (and expand it during AST lowering) Implements https://github.com/rust-lang/compiler-team/issues/541 This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier. This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`. This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
Diffstat (limited to 'compiler/rustc_mir_build')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/check_match.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index 34e637f5948..17e4ccb4179 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -208,9 +208,9 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> { // Don't report arm reachability of desugared `match $iter.into_iter() { iter => .. }` // when the iterator is an uninhabited type. unreachable_code will trigger instead. hir::MatchSource::ForLoopDesugar if arms.len() == 1 => {} - hir::MatchSource::ForLoopDesugar | hir::MatchSource::Normal => { - report_arm_reachability(&cx, &report) - } + hir::MatchSource::ForLoopDesugar + | hir::MatchSource::Normal + | hir::MatchSource::FormatArgs => report_arm_reachability(&cx, &report), // Unreachable patterns in try and await expressions occur when one of // the arms are an uninhabited type. Which is OK. hir::MatchSource::AwaitDesugar | hir::MatchSource::TryDesugar => {} |
