rust/compiler
Matthias Krüger a4f323ce9c
Rollup merge of #132583 - mejrs:tuples, r=compiler-errors
Suggest creating unary tuples when types don't match a trait

When you want to have a variadic function, a common workaround to implement this is to create a trait and then implement that trait for various tuples. For example in `pyo3` there exists
```rust
/// Calls the object with only positional arguments.
pub fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<&PyAny> {
   ...
}
```

with various impls like
```rust
impl<A: IntoPy<PyObject> IntoPy<Py<PyAny>> for (A,)
impl<A: IntoPy<PyObject, B: IntoPy<PyObject> IntoPy<Py<PyAny>> for (A, B)
... etc
```

This means that if you want to call the method with a single item you have to create a unary tuple, like `(x,)`, rather than just `x`.

This PR implements a suggestion to do that, if applicable.
2024-11-04 18:12:48 +01:00
..
rustc
rustc_abi
rustc_arena
rustc_ast Do not format generic consts 2024-11-02 20:25:06 +00:00
rustc_ast_ir
rustc_ast_lowering
rustc_ast_passes Rename the FIXMEs, remove a few that dont matter anymore 2024-11-03 18:59:41 +00:00
rustc_ast_pretty
rustc_attr
rustc_baked_icu_data
rustc_borrowck BorrowckDiags tweaks. 2024-11-04 17:36:25 +11:00
rustc_builtin_macros
rustc_codegen_cranelift Auto merge of #132526 - bjorn3:sync_cg_clif-2024-11-02, r=bjorn3 2024-11-03 05:03:52 +00:00
rustc_codegen_gcc Reduce dependence on the target name 2024-11-03 18:29:01 +00:00
rustc_codegen_llvm Rollup merge of #132565 - bjorn3:less_target_name_dependence, r=workingjubilee 2024-11-03 20:08:14 -08:00
rustc_codegen_ssa Rollup merge of #132565 - bjorn3:less_target_name_dependence, r=workingjubilee 2024-11-03 20:08:14 -08:00
rustc_const_eval Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnay 2024-11-03 20:08:13 -08:00
rustc_data_structures
rustc_driver
rustc_driver_impl make time format parsing compiletime 2024-11-03 15:51:39 +03:00
rustc_error_codes
rustc_error_messages
rustc_errors Rename target triple to target tuple in many places in the compiler 2024-11-02 21:29:59 +01:00
rustc_expand
rustc_feature Yeet effects feature 2024-11-03 18:59:31 +00:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnay 2024-11-03 20:08:13 -08:00
rustc_hir_analysis Rollup merge of #132559 - bvanjoi:fix-132534, r=compiler-errors 2024-11-04 18:12:47 +01:00
rustc_hir_pretty
rustc_hir_typeck Make sure to enforce ~const DerefMut on mutability fixup 2024-11-04 04:51:32 +00:00
rustc_incremental replace manual time convertions with std ones 2024-11-03 15:51:39 +03:00
rustc_index
rustc_index_macros
rustc_infer Remove or fix some FIXME(async_closure) 2024-11-02 03:33:31 +00:00
rustc_interface Rename target triple to target tuple in many places in the compiler 2024-11-02 21:29:59 +01:00
rustc_lexer
rustc_lint compiler: Directly use rustc_abi in lints 2024-11-03 13:38:47 -08:00
rustc_lint_defs
rustc_llvm Auto merge of #132555 - matthiaskrgr:rollup-2d79661, r=matthiaskrgr 2024-11-03 13:46:47 +00:00
rustc_log
rustc_macros
rustc_metadata compiler: Directly use rustc_abi in metadata and middle 2024-11-03 13:38:47 -08:00
rustc_middle Rollup merge of #132544 - dianne:unstable-library-feature-backticks, r=compiler-errors 2024-11-04 18:12:46 +01:00
rustc_mir_build Register const preds for Deref adjustments in HIR typeck 2024-11-04 04:51:31 +00:00
rustc_mir_dataflow compiler: Remove unused rustc_target from Cargo.tomls 2024-11-03 13:38:47 -08:00
rustc_mir_transform compiler: Directly use rustc_abi in mir_transform 2024-11-03 13:38:47 -08:00
rustc_monomorphize compiler: Add rustc_abi to _monomorphize 2024-11-02 20:31:47 -07:00
rustc_next_trait_solver Rename the FIXMEs, remove a few that dont matter anymore 2024-11-03 18:59:41 +00:00
rustc_parse
rustc_parse_format
rustc_passes Rollup merge of #132576 - jdonszelmann:no-attrid-in-stats, r=nnethercote 2024-11-03 20:08:15 -08:00
rustc_pattern_analysis compiler: Remove unused rustc_target from Cargo.tomls 2024-11-03 13:38:47 -08:00
rustc_privacy
rustc_query_impl
rustc_query_system replace manual time convertions with std ones 2024-11-03 15:51:39 +03:00
rustc_resolve
rustc_sanitizers compiler: Add rustc_abi to _sanitizers 2024-11-02 20:31:47 -07:00
rustc_serialize
rustc_session Rollup merge of #132355 - practicalrs:fix_117638, r=SparrowLii 2024-11-04 18:12:45 +01:00
rustc_smir compiler: Directly use rustc_abi in smir again 2024-11-03 13:38:47 -08:00
rustc_span remove const-support for align_offset 2024-11-03 17:00:44 +01:00
rustc_symbol_mangling compiler: Replace rustc_target with abi in symbol_mangling 2024-11-03 13:38:47 -08:00
rustc_target Remove is_builtin target spec field 2024-11-03 21:06:49 +00:00
rustc_trait_selection Rollup merge of #132583 - mejrs:tuples, r=compiler-errors 2024-11-04 18:12:48 +01:00
rustc_traits
rustc_transmute
rustc_ty_utils Rollup merge of #132574 - workingjubilee:abi-in-compiler, r=compiler-errors 2024-11-03 15:25:00 -08:00
rustc_type_ir Rename the FIXMEs, remove a few that dont matter anymore 2024-11-03 18:59:41 +00:00
rustc_type_ir_macros
stable_mir