rust/compiler/rustc_middle/src
Matthias Krüger 917662a8f6
Rollup merge of #107555 - edward-shen:edward-shen/dup-trait-suggestion, r=compiler-errors
Modify existing bounds if they exist

Fixes #107335.

This implementation is kinda gross but I don't really see a better way to do it.

This primarily does two things: Modifies `suggest_constraining_type_param` to accept a new parameter that indicates a span to be replaced instead of added, if presented, and limit the additive suggestions to either suggest a new bound on an existing bound (see newly added unit test) or add the generics argument if a generics argument wasn't found.

The former change is required to retain the capability to add an entirely new bounds if it was entirely omitted.

r? ``@compiler-errors``
2023-02-07 17:57:14 +01:00
..
dep_graph rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
hir Improve pretty-printing of HirIdValidator errors 2023-02-01 20:09:22 +01:00
infer Make make_identity take CanonicalVarInfos 2023-01-26 20:33:40 +00:00
middle rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
mir Put a DefId in AggregateKind. 2023-02-02 23:09:51 +00:00
query Auto merge of #107463 - Dylan-DPC:rollup-6mq1li8, r=Dylan-DPC 2023-01-30 11:14:21 +00:00
thir address review 2023-01-27 22:13:55 +01:00
traits Rollup merge of #106477 - Nathan-Fenner:nathanf/refined-error-span-trait-impl, r=compiler-errors 2023-02-06 21:16:39 +01:00
ty Rollup merge of #107555 - edward-shen:edward-shen/dup-trait-suggestion, r=compiler-errors 2023-02-07 17:57:14 +01:00
util Add some docs to bug, span_bug and delay_span_bug 2022-12-30 16:47:56 +01:00
arena.rs intern external constraints 2023-02-03 21:36:59 +00:00
error.rs Match crate and slug names 2022-11-21 15:24:50 +01:00
lib.rs Use strict provenance APIs in ty::tls 2023-01-21 11:25:21 +01:00
lint.rs create helper function for rustc_lint_defs::Level and remove it's duplicated code r=ozkanonur 2023-01-10 10:56:17 +03:00
macros.rs Stop using BREAK & CONTINUE in compiler 2023-01-17 23:17:51 -08:00
metadata.rs rustc: Parameterize ty::Visibility over used ID 2022-09-07 13:35:41 +04:00
tests.rs
thir.rs output tree representation for thir-tree 2023-01-26 11:31:55 +01:00
values.rs add EarlyBinder::subst_identity; impl ParameterizedOverTcx (needed for rustc_metadata) and Value for EarlyBinder 2023-01-14 00:13:06 -07:00