about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits/mod.rs
AgeCommit message (Collapse)AuthorLines
2023-11-27Auto merge of #117200 - rmehri01:repeated_help, r=WaffleLapkinbors-30/+65
Don't add redundant help for object safety violations Fixes #117186 r? WaffleLapkin
2023-11-26don't add redundant help for object safety violationsRyan Mehri-30/+65
2023-11-25Remove 3 more unused ObligationCauseCodesMichael Goulet-9/+0
2023-11-25Remove some more unused codepaths in (region) error reportingMichael Goulet-1/+2
2023-11-25Remove unused ObligationCauseCode::ProjectionWfMichael Goulet-3/+0
2023-11-25Remove HirId from QPath::LangItemMichael Goulet-1/+1
2023-11-22Auto merge of #118152 - matthiaskrgr:rollup-bqcck4w, r=matthiaskrgrbors-4/+17
Rollup of 5 pull requests Successful merges: - #117972 (Add VarDebugInfo to Stable MIR) - #118109 (rustdoc-search: simplify `checkPath` and `sortResults`) - #118110 (Document `DefiningAnchor` a bit more) - #118112 (Don't ICE when ambiguity is found when selecting `Index` implementation in typeck) - #118135 (Remove quotation from filename in stable_mir) Failed merges: - #118012 (Add support for global allocation in smir) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-20Document DefiningAnchor a bit moreMichael Goulet-4/+17
2023-11-08Rollup merge of #113925 - clubby789:const-ctor-repeat, r=estebankMatthias Krüger-3/+23
Improve diagnostic for const ctors in array repeat expressions Fixes #113912
2023-10-21Rollup merge of #106601 - estebank:match-semi, r=cjgillotMatthias Krüger-0/+1
Suggest `;` after bare `match` expression E0308 Fix #72634.
2023-10-20s/generator/coroutine/Oli Scherer-1/+1
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-11Suggest `;` after bare `match` expression E0308Esteban Küber-0/+1
Fix #72634.
2023-09-23Check types live across yields in generators tooMichael Goulet-1/+3
2023-09-23Check that closure's by-value captures are sizedMichael Goulet-0/+2
2023-09-19rustc_hir_analysis: add a helper to check function the signature mismatchesEduardo Sánchez Muñoz-0/+3
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions. The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
2023-09-18Remove more unused `Lift` impls.Nicholas Nethercote-9/+2
2023-09-18Remove unused `Lift` derives.Nicholas Nethercote-12/+12
I found these by commenting out all `Lift` derives and then adding back the ones that were necessary to successfully compile.
2023-08-14Move scrutinee `HirId` into `MatchSource::TryDesugar`Esteban Küber-2/+1
2023-08-14Point at return type when it influences non-first `match` armEsteban Küber-1/+1
When encountering code like ```rust fn foo() -> i32 { match 0 { 1 => return 0, 2 => "", _ => 1, } } ``` Point at the return type and not at the prior arm, as that arm has type `!` which isn't influencing the arm corresponding to arm `2`. Fix #78124.
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-5/+5
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-21/+18
2023-07-25Make everything builtin!Michael Goulet-52/+28
2023-07-25Restore tuple unsizing feature gateMichael Goulet-3/+9
2023-07-24Improve diagnostic for const ctors in array repeat expressionsclubby789-3/+23
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-4/+4
2023-07-05Add some extra information to opaque type cycle errorsOli Scherer-0/+4
2023-07-03Remove chalk from the compilerMichael Goulet-5/+0
2023-06-20yeet upcast_trait_def_id from ImplSourceObjectDataMichael Goulet-4/+0
2023-06-20yeet ImplSource::TraitAlias tooMichael Goulet-19/+0
2023-06-20cleanup importslcnr-6/+0
2023-06-19show normalizes-to hack and response instantiation goalsBoxy-0/+6
2023-06-19initial info dumpBoxy-1/+1
2023-06-17Remove even more redundant builtin candidatesMichael Goulet-36/+3
2023-06-17Simplify even more candidatesMichael Goulet-75/+26
2023-06-17Simplify an ObjectData fieldMichael Goulet-4/+4
2023-06-17Simplify some impl source candidatesMichael Goulet-37/+0
2023-06-17Remove some ImplSource candidatesMichael Goulet-22/+7
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-0/+3
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-0/+3
2023-05-25Move DefiningAnchorMichael Goulet-0/+11
2023-05-19update recursion depth in `confirm_candidate`lcnr-3/+20
2023-05-12Note base types of coercionMichael Goulet-3/+0
2023-05-09Shrink `SelectionError` a lotNilstrieb-5/+8
`SelectionError` used to be 80 bytes (on 64 bit). That's quite big. Especially because the selection cache contained `Result<_, SelectionError>. The Ok type is only 32 bytes, so the 80 bytes significantly inflate the size of the cache. Most variants of the `SelectionError` seem to be hard errors, only `Unimplemented` shows up in practice (for cranelift-codegen, it occupies 23.4% of all cache entries). We can just box away the biggest variant, `OutputTypeParameterMismatch`, to get the size down to 16 bytes, well within the size of the Ok type inside the cache.
2023-05-04Use fulfillment to check Drop impl compatibilityMichael Goulet-0/+4
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-5/+2
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-28Rollup merge of #110927 - nnethercote:Encoder-Decoder-cleanups, r=scottmcmMatthias Krüger-7/+7
Encoder/decoder cleanups Best reviewed one commit at a time. r? ``@scottmcm``
2023-04-28Remove some unnecessary derives.Nicholas Nethercote-7/+7
I was curious about how many `Encodable`/`Decodable` derives we have. Some grepping revealed that it's over 500 of each, but the number of `Encodable` ones was higher, which was weird. Most of the `Encodable`-only ones were in `hir.rs`. This commit removes them all, plus some other unnecessary derives in that file and others that I found via trial and error.
2023-04-26Remove unused `TypeFoldable`/`TypeVisitable` impls.Nicholas Nethercote-1/+1