summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-05-31add FIXMElcnr-0/+5
2023-05-31unique borrows are mutating useslcnr-19/+9
2023-05-30Exclude Rvalue::AddressOf for raw pointer deref alignment checksBen Kimock-0/+8
2023-05-25update recursion depth in `confirm_candidate`lcnr-3/+26
(cherry picked from commit 1708ad65a45fa39aa177c5f015415a9440c18912)
2023-05-25Dont check `must_use` on nested `impl Future` from fnMichael Goulet-1/+3
(cherry picked from commit 926e874fd1dccc208bf63db7a4288adf46caa3c3)
2023-05-19Simplify find_width_of_character_at_span.Mara Bos-24/+8
(cherry picked from commit 6289c57dc0ee8ebbe9e20fad808f85aed0afeceb)
2023-05-19Encode VariantIdx so we can decode variants in the right orderMichael Goulet-27/+45
(cherry picked from commit ff54c801f0c1552941bda472df992e9f9be25f33)
2023-05-19debuginfo: split method declaration and definitionJosh Stone-34/+89
When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration. (cherry picked from commit 10b69dde3fd15334ea2382d2dc9e9a261de1afaf)
2023-05-06only error with +whole-archive,+bundle for rlibsBe Wilson-1/+4
Fixes https://github.com/rust-lang/rust/issues/110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b36b1962285e371cf3c54eeb3b1b9b3a74 https://github.com/rust-lang/rust/pull/105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system.
2023-05-06Remove wrong assertion.Camille GILLOT-3/+0
2023-04-27make sysroot finding compatible with multiarch systemsozkanonur-17/+18
Signed-off-by: ozkanonur <work@onurozkan.dev> (cherry picked from commit 2e98368c2f1a4cbefa3c8f43f550a7fc1831636e)
2023-04-27Encode lifetime param spans tooMichael Goulet-1/+1
(cherry picked from commit 24c2c075cc2216af8868809fdd68c9da8466c327)
2023-04-26Encode def span for ConstParamMichael Goulet-2/+2
(cherry picked from commit 1ee189cde53a4cecd3e8811d6ffe983676a70c7b)
2023-04-16replace version placeholdersPietro Albini-5/+5
2023-04-15Auto merge of #110323 - lcnr:dropck-uwu, r=compiler-errorsbors-1/+3
explicit `adt_dtorck_constraint` for `ManuallyDrop` the only reason we didn't add outlives requirements when dropping `ManuallyDrop` was a fast-path in `trivial_dropck_outlives`. Explicitly acknowledge that fast-path in `adt_dtorck_constraint`
2023-04-15Remove outdated comment.Camille GILLOT-2/+0
2023-04-15Remove useless methods in visit.Camille GILLOT-6/+0
2023-04-15Only enable ConstProp at mir-opt-level >= 2.Camille GILLOT-1/+1
2023-04-14Auto merge of #110197 - cjgillot:codegen-discr, r=pnkfelixbors-181/+0
Do not attempt to commute comparison and cast to codegen discriminants The general algorithm to compute a discriminant is: ``` relative_tag = tag - niche_start is_niche = relative_tag <= (ule) relative_max discr = if is_niche { cast(relative_tag) + niche_variants.start() } else { untagged_variant } ``` We have an optimization branch which attempts to merge the addition and the subtraction by commuting them with the cast. We currently get this optimization wrong. This PR takes the easiest and safest way: remove the optimization, and let LLVM handle it. (Perf may not agree with that course of action :sweat_smile:) There may be a less invasive solution, but I don't have the necessary knowledge of LLVM semantics to find it. Cranelift has the same optimization, which should be handled similarly. cc `@nikic` and `@bjorn3` if you have a better solution. Fixes https://github.com/rust-lang/rust/issues/110128
2023-04-14Rollup merge of #108687 - ↵Matthias Krüger-200/+230
compiler-errors:reformulate-point_at_expr_source_of_inferred_type, r=oli-obk Reformulate `point_at_expr_source_of_inferred_type` to be more accurate Be more accurate when deducing where along the several usages of a binding it is constrained to be some type that is incompatible with an expectation. This also renames the method to `note_source_of_type_mismatch_constraint` because I prefer that name, though I guess I can revert that. (Also drive-by rename `note_result_coercion` -> `suggest_coercing_result_via_try_operator`, because it's suggesting, not noting!) This PR is (probably?) best reviewed per commit, but it does regress a bit only to fix it later on, so it could also be reviewed as a whole if that makes the final results more clear. r? `@estebank`
2023-04-14Remove from cranelift too.Camille GILLOT-89/+0
2023-04-14Remove attempt to optimize codegen for discriminants.Camille GILLOT-92/+0
2023-04-14Rollup merge of #110315 - oli-obk:mor_smir, r=WaffleLapkinYuki Okushi-0/+11
Add a stable MIR way to get the main function This is useful for analysis tools that only analyze the code paths that a specific program actually goes through. Or for code generators built on top of stable MIR.
2023-04-14 explicit adt_dtorck_constraint for ManuallyDroplcnr-1/+3
2023-04-14Add a stable MIR way to get the main functionOli Scherer-0/+11
2023-04-14Rollup merge of #110299 - kylematsuda:earlybinder-impl-subject, ↵Matthias Krüger-12/+8
r=compiler-errors Switch to `EarlyBinder` for `impl_subject` query Part of the work to finish https://github.com/rust-lang/rust/issues/105779. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `impl_subject` query and removes `bound_impl_subject`. r? ```@lcnr```
2023-04-14Rollup merge of #110276 - nnethercote:rm-BrAnon-Span, r=jackh726Matthias Krüger-15/+10
Remove all but one of the spans in `BoundRegionKind::BrAnon` There are only three places where `BoundRegionKind::BrAnon` uses `Some(span)` instead of `None`. Two of them are easy to remove, which this PR does. r? ```@jackh726```
2023-04-14Rollup merge of #110207 - compiler-errors:new-solver-unpin, r=lcnrMatthias Krüger-61/+102
Assemble `Unpin` candidates specially for generators in new solver Fixes compiler-errors/next-solver-hir-issues#16 r? ``@lcnr``
2023-04-14Rollup merge of #110180 - lcnr:canonicalize, r=compiler-errorsMatthias Krüger-14/+11
don't uniquify regions when canonicalizing uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions. I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements > ### 6. Trait solving must be (free) lifetime agnostic > > Trait solving during codegen should have the same result as during typeck. As we erase > all free regions during codegen we must not rely on them during typeck. A noteworthy example > is special behavior for `'static`. cc https://github.com/rust-lang/rustc-dev-guide/pull/1671 Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization. r? ```@compiler-errors```
2023-04-14Rollup merge of #109800 - bryangarza:safe-transmute-improved-errors, ↵Matthias Krüger-52/+137
r=compiler-errors Improve safe transmute error reporting This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-14Move auto trait built-in candidate disqualification to a separate methodMichael Goulet-77/+101
2023-04-14Assemble Unpin candidates specially for generators in new solverMichael Goulet-1/+18
2023-04-14Remove another use of `BrAnon(Some(_))`.Nicholas Nethercote-3/+2
2023-04-14Remove one use of `BrAnon(Some(_))`.Nicholas Nethercote-1/+1
2023-04-14Auto merge of #110160 - petrochenkov:notagain2, r=cjgillotbors-94/+67
resolve: Pre-compute non-reexport module children Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-13make impl_subject more readableKyle Matsuda-6/+4
2023-04-13Improve safe transmute error reportingBryan Garza-52/+137
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-13make tcx.impl_subject return EarlyBinder, remove bound_impl_subject, rename ↵Kyle Matsuda-12/+10
usages of bound_impl_subject to impl_subject
2023-04-13change usage of bound_impl_subject to impl_subjectKyle Matsuda-1/+1
2023-04-13Rollup merge of #110291 - WaffleLapkin:copy_location_detail, r=oli-obkMatthias Krüger-2/+2
Implement `Copy` for `LocationDetail` micro-nano-little-change
2023-04-13Rollup merge of #110283 - saethlin:check-panics-before-alignment, r=bjorn3Matthias Krüger-0/+7
Only emit alignment checks if we have a panic_impl Fixes https://github.com/rust-lang/rust/issues/109996 r? `@bjorn3` because you commented that this situation could impact you as well
2023-04-13Rollup merge of #110277 - Ezrashaw:combine-assoc-fns-dlint, r=lcnrMatthias Krüger-20/+42
dead-code-lint: de-dup multiple unused assoc functions Fixes #109600 Prior art: #97853
2023-04-13Rollup merge of #110233 - nbdd0121:intrinsic, r=tmiaskoMatthias Krüger-2/+3
Make rust-intrinsic ABI unwindable Fix #104451, fix https://github.com/rust-lang/miri/issues/2839 r? `@RalfJung`
2023-04-13Rollup merge of #110193 - compiler-errors:body-owner-issue, r=WaffleLapkinMatthias Krüger-1/+1
Check for body owner fallibly in error reporting Sometimes the "body id" we use for an obligation cause is not actually a body owner, like when we're doing WF checking on items. Fixes #110157
2023-04-13Implement `Copy` for `LocationDetail`Maybe Waffle-2/+2
2023-04-13Only emit alignment checks if we have a panic_implBen Kimock-0/+7
2023-04-13Auto merge of #109989 - ids1024:m68k-asm, r=Amanieubors-0/+124
Add inline assembly support for m68k I believe this should be correct, to the extent I understand the logic around inline assembly. M68k is fairly straightforward here, other than having separate address registers.
2023-04-13impl reviewer feedbackEzra Shaw-11/+10
- remove unused (pun intentional) `continue` - improve wording with assoc items in general
2023-04-13dead-code-lint: de-dup multiple unused assoc fnsEzra Shaw-17/+37
2023-04-13Rollup merge of #110220 - lcnr:regionzz, r=compiler-errorsMatthias Krüger-237/+192
cleanup our region error API - require `TypeErrCtxt` to always result in an error, closing #108810 - move `resolve_regions_and_report_errors` to the `ObligationCtxt` - call `process_registered_region_obligations` in `resolve_regions` - move `resolve_regions` into the `outlives` submodule - add `#[must_use]` to functions returning lists of errors r? types