rust/compiler/rustc_builtin_macros/src
Preston From 3330c7d1c3 Generate correct suggestion with named arguments used positionally
Address issue #99265 by checking each positionally used argument
to see if the argument is named and adding a lint to use the name
instead. This way, when named arguments are used positionally in a
different order than their argument order, the suggested lint is
correct.

For example:
```
println!("{b} {}", a=1, b=2);
```
This will now generate the suggestion:
```
println!("{b} {a}", a=1, b=2);
```

Additionally, this check now also correctly replaces or inserts
only where the positional argument is (or would be if implicit).
Also, width and precision are replaced with their argument names
when they exists.

Since the issues were so closely related, this fix for issue #99265
also fixes issue #99266.

Fixes #99265
Fixes #99266
2022-07-25 00:00:27 -06:00
..
assert Parse closure binders 2022-07-12 16:25:16 +04:00
deriving Don't add attribute to allow unused-qualifications to derive impl's 2022-07-18 22:28:17 -04:00
format_foreign update tests 2021-12-31 12:51:27 -05:00
asm.rs Generate correct suggestion with named arguments used positionally 2022-07-25 00:00:27 -06:00
assert.rs remove unnecessary to_string and String::new 2022-06-13 15:48:40 +09:00
cfg_accessible.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
cfg_eval.rs rustc_parse: Move AST -> TokenStream conversion logic to rustc_ast 2022-05-22 12:01:07 +03:00
cfg.rs macros: use typed identifiers in diag derive 2022-06-24 09:08:25 +01:00
cmdline_attrs.rs Unconditionally capture tokens for attributes. 2020-10-21 18:57:29 -04:00
compile_error.rs check_doc_keyword: don't alloc string for emptiness check 2022-04-08 11:45:57 +03:00
concat_bytes.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
concat_idents.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
concat.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
derive.rs remove unnecessary to_string and String::new 2022-06-13 15:48:40 +09:00
edition_panic.rs Spellchecking some comments 2022-03-30 01:39:38 -04:00
env.rs check_doc_keyword: don't alloc string for emptiness check 2022-04-08 11:45:57 +03:00
format_foreign.rs [rustc_builtin_macros] add indices to format_foreign::printf::Substitution::Escape 2021-12-31 12:42:15 -05:00
format.rs Generate correct suggestion with named arguments used positionally 2022-07-25 00:00:27 -06:00
global_allocator.rs Point at type when a static #[global_allocator] doesn't impl GlobalAlloc 2021-12-15 01:40:08 +00:00
lib.rs Stabilize let_chains 2022-07-16 20:17:58 -03:00
log_syntax.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
proc_macro_harness.rs Rename some ExtCtxt methods. 2022-06-23 11:10:43 +10:00
source_util.rs Add support for a new attribute #[debugger_visualizer] to support embedding debugger visualizers into a generated PDB. 2022-05-03 10:53:54 -07:00
standard_library_imports.rs Create 2024 edition 2022-04-02 02:45:49 -04:00
test_harness.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
test.rs remove unnecessary to_string and String::new 2022-06-13 15:48:40 +09:00
trace_macros.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
util.rs Add a lint for duplicated attributes. 2021-12-15 23:43:13 +01:00