Commit Graph

11 Commits

Author SHA1 Message Date
Matthias Krüger 13640e337a Rollup merge of #108573 - kornelski:runtimeenvs, r=WaffleLapkin
Explain compile-time vs run-time difference in env!() error message

This PR is clarifying error message of `env!()` based on this user question: https://users.rust-lang.org/t/environment-variable-out-dir-is-undefined/90067

It makes it clear that `env!()` is for env variables defined at compile-time. There's special-case help text for common Cargo build script variables.

I've also rearranged the code to avoid allocating error message on the happy path when the env var is defined.
2023-03-02 23:05:29 +01:00
Kornel 2407b0c578 Explain compile-time vs run-time difference in env!() error message 2023-02-28 16:44:59 +00:00
yukang f01d0c02e7 Exit when there are unmatched delims to avoid noisy diagnostics 2023-02-28 07:55:19 +00:00
Michael Goulet 56bf28d4f4 Expand const-if-const trait bounds correctly 2023-02-07 21:00:12 +00:00
bors 3e97763872 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.
2023-01-26 12:44:47 +00:00
Matthias Krüger 9e3f330656 Rollup merge of #106897 - estebank:issue-99430, r=davidtwco
Tweak E0597

CC #99430
2023-01-25 22:19:52 +01:00
Aaron Hill dc8876196b Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS to future-incompat report 2023-01-21 14:38:25 -06:00
Michael Goulet 21725774a2 note -> help 2023-01-17 03:09:49 +00:00
Esteban Küber 7b8251e188 Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
Mara Bos 525b0bb77a Bless tests. 2023-01-12 00:25:46 +01:00
Albert Larsan cf2dff2b1e Move /src/test to /tests 2023-01-11 09:32:08 +00:00