about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits
AgeCommit message (Collapse)AuthorLines
2022-11-04Rollup merge of #103937 - BoxyUwU:misc_cleanups, r=compiler-errorsMatthias Krüger-1/+8
minor changes to make method lookup diagnostic code easier to read The end result of around 4 days of trying to understand this 1000+ line long function- a bunch of tiny nitpicks r? `@compiler-errors`
2022-11-04Rollup merge of #103915 - chenyukang:yukang/fix-103874, r=lcnrMatthias Krüger-1/+1
Improve use of ErrorGuaranteed and code cleanup Part of #103874
2022-11-03CleanupsBoxy-1/+8
2022-11-03change error_reported to use Result instead of an optionyukang-1/+1
2022-10-30better error for rustc_strict_coherence misuseMichael Goulet-2/+15
2022-10-27Revert "Make ClosureOutlivesRequirement not rely on an unresolved type"Michael Goulet-1/+1
This reverts commit a6b5f95fb028f9feb4a2957c06b35035be2c6155.
2022-10-19Make ClosureOutlivesRequirement not rely on an unresolved typeMichael Goulet-1/+1
2022-10-17Duplicate comment in mod.rsSamuel Moelius-5/+0
2022-10-10Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnrDylan DPC-14/+2
Remove tuple candidate, nothing special about it r? `@lcnr` you mentioned this during the talk you gave i think
2022-10-07Remove tuple candidate, nothing special about itMichael Goulet-14/+2
2022-10-07Remove `DefId` from some `SelectionCandidate` variantsDeadbeef-2/+2
2022-09-21Neither require nor imply lifetime bounds on opaque type for well formednessOli Scherer-1/+3
2022-09-20Auto merge of #101989 - ↵bors-2/+3
fee1-dead-contrib:const_trait_impl-assoc-caller-bounds, r=oli-obk make projection bounds with const bounds satisfy const Fixes #101982.
2022-09-18make projection bounds with const bounds satisfy constDeadbeef-2/+3
2022-09-16Add AscribeUserTypeProvePredicateJack Huey-0/+5
2022-09-16Add to_constraint_category to ObligationCause and SubregionOriginJack Huey-0/+8
2022-09-16Revert "Better errors for implied static bound"Jack Huey-13/+0
This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.
2022-09-13Better errors for implied static boundJack Huey-0/+13
2022-09-12Rollup merge of #101681 - compiler-errors:rpitit-obj-safety, r=lcnrDylan DPC-0/+9
Deny return-position `impl Trait` in traits for object safety Fixes #101667
2022-09-12Auto merge of #100251 - compiler-errors:tuple-trait-2, r=jackh726bors-2/+14
Implement `std::marker::Tuple` Split out from #99943 (https://github.com/rust-lang/rust/pull/99943#pullrequestreview-1064459183). Implements part of rust-lang/compiler-team#537 r? `@jackh726`
2022-09-11Deny RPITIT for object safetyMichael Goulet-0/+9
2022-09-09rename `codegen_fulfill_obligation`lcnr-1/+1
2022-09-08Add associated item binding to non-param-ty where clause suggestionsMichael Goulet-2/+2
2022-09-05fix comment111-2/+1
2022-09-01Migrate DropCheckOverflow111-10/+3
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-24Note binding obligation causes for const equate errorsMichael Goulet-0/+7
2022-08-21More docsMichael Goulet-5/+11
2022-08-21Rework point-at-argMichael Goulet-0/+4
2022-08-07Built-in implementation of Tuple traitMichael Goulet-2/+14
2022-08-02Auto merge of #92268 - jswrenn:transmute, r=oli-obkbors-0/+4
Initial implementation of transmutability trait. *T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!* This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`. What this PR provides is: - [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives) - [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays) - [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs) - [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums) - [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions) - [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`) - [x] visibility checking What isn't yet implemented: - [ ] transmutability options passed using the `Assume` struct - [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs) - [ ] smarter error messages These features will be implemented in future PRs.
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-1/+1
2022-07-29remove some manual hash stable implslcnr-25/+1
2022-07-27Initial (incomplete) implementation of transmutability trait.Jack Wrenn-0/+4
This initial implementation handles transmutations between types with specified layouts, except when references are involved. Co-authored-by: Igor null <m1el.2027@gmail.com>
2022-07-24Combine redundant obligation cause codesMichael Goulet-10/+2
2022-07-21And for patterns tooMichael Goulet-2/+5
2022-07-21Do if-expression obligation stuff less eagerlyMichael Goulet-8/+9
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-1/+1
2022-07-16Rollup merge of #99290 - compiler-errors:revert-98794, r=lcnrMatthias Krüger-9/+1
Revert "Highlight conflicting param-env candidates" This reverts #98794, commit 08135254dcf22be0d5661ea8f75e703b29a83514. Seems to have caused an incremental compilation bug. The root cause of the incr comp bug is somewhat unrelated but is triggered by this PR, so I don't feel comfortable with having this PR in the codebase until it can be investigated further. Fixes #99233.
2022-07-15Propagate Expectation around binop typeck code to construct more precise ↵Will Crichton-1/+2
trait obligations for binops.
2022-07-15Revert "Highlight conflicting param-env candidates"Michael Goulet-9/+1
This reverts commit 08135254dcf22be0d5661ea8f75e703b29a83514.
2022-07-15remove tcx from ObligationCauseCode::spanMichael Goulet-1/+1
2022-07-15Remove some more usages of guess_head_spanMichael Goulet-6/+1
2022-07-12Move abstract const to rustc_middle::tykadmin-1/+1
2022-07-08Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiserbors-4/+14
don't succeed `evaluate_obligation` query if new opaque types were registered fixes #98608 fixes #98604 The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked. I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this. Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
2022-07-08Highlight conflicting param-env candidatesMichael Goulet-1/+9
2022-07-07not knowing about opaque types is worse than not knowing about regions, make ↵Oli Scherer-2/+2
sure we don't accidentally mark something as ok-modulo-regions if there are opaque types involved
2022-07-06Update TypeVisitor pathsAlan Egerton-1/+1
2022-07-05impl TypeVisitable in type traversal macrosAlan Egerton-2/+2
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-22/+38