]> git.lizzy.rs Git - rust.git/commit
Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
authorbors <bors@rust-lang.org>
Thu, 26 Jan 2023 12:44:47 +0000 (12:44 +0000)
committerbors <bors@rust-lang.org>
Thu, 26 Jan 2023 12:44:47 +0000 (12:44 +0000)
commit3e977638728922d3a6cc7bea34a2fdb8ae97f7c0
treeccf38bab26084eb37c133e60987ba7bd4318ec9b
parent40fda7b3fe2b10c6e1a0568b59516f5e7f381886
parentdb731e42b3c139587cd7a87acaa92cd82ab8a11c
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.
16 files changed:
Cargo.lock
compiler/rustc_ast/src/ast.rs
compiler/rustc_ast/src/mut_visit.rs
compiler/rustc_ast/src/util/parser.rs
compiler/rustc_ast/src/visit.rs
compiler/rustc_ast_lowering/src/expr.rs
compiler/rustc_ast_lowering/src/lib.rs
compiler/rustc_ast_pretty/src/pprust/state/expr.rs
compiler/rustc_builtin_macros/src/format.rs
compiler/rustc_hir/src/hir.rs
compiler/rustc_hir/src/lang_items.rs
compiler/rustc_mir_build/src/thir/pattern/check_match.rs
compiler/rustc_span/src/symbol.rs
library/core/src/fmt/mod.rs
src/tools/rustfmt/src/expr.rs
src/tools/rustfmt/src/utils.rs