summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-04-16Move a const-prop-lint specific hack from mir interpret to const-prop-lint ↵Oli Scherer-12/+13
and make it fallible
2023-04-16Revert "Don't recover lifetimes/labels containing emojis as character literals"Michael Goulet-43/+13
Reverts PR #108031 Fixes (doesnt close until beta backported) #109746 This reverts commit e3f9db5fc319c6d8eee5d47d216ea6a426070c41. This reverts commit 98b82aedba3f3f581e89df54352914b27f42c6f7. This reverts commit 380fa264132ad481e73cbbf0f3a0feefd99a1d78.
2023-03-29Fix linker detection for clang with prefixTaiki Endo-1/+3
2023-03-11tweak debug output and bless testsAli MJ Al-Nasrawy-14/+18
2023-03-11tweak ClosureOutlivesSubjectTyAli MJ Al-Nasrawy-8/+11
2023-03-11ignore bivariant regions in opaque typesAli MJ Al-Nasrawy-0/+30
2023-03-11smarter algorithm for finding an equal regionAli MJ Al-Nasrawy-92/+9
Smarter and simpler!
2023-03-11promote subject even if it has unnamed regionsAli MJ Al-Nasrawy-34/+62
Don't require a region to have an `external_name` in order to be promoted.
2023-03-11Retry pred_known_to_hold_modulo_regions with fulfillment if ambiguousMichael Goulet-3/+5
2023-03-11fix: evaluate with wrong obligation stackyifei-2/+2
2023-03-06Bump version placeholdersMark Rousskov-4/+4
2023-03-04Auto merge of #108692 - nnethercote:dont-call-temporary_scope-twice, r=cjgillotbors-4/+2
Don't call `temporary_scope` twice. `mirror_expr_inner` calls `temporary_scope`. It then calls `make_mirror_unadjusted` which makes an identical call to `temporary_scope`. This commit changes the `mirror_expr_inner` to get the `temp_lifetime` out of the expression produced by `make_mirror_unadjusted`, similar to how it currently gets the type. r? `@cjgillot`
2023-03-04Auto merge of #108732 - Dylan-DPC:rollup-dy1l8sx, r=Dylan-DPCbors-10/+37
Rollup of 6 pull requests Successful merges: - #108298 (Fix ICE: check if snippet is `)`) - #108405 (Lazily compute crate name for consider_optimizing) - #108656 (Rustdoc search: Emit an error for unclosed generic) - #108660 (Remove ne implementations from strings) - #108669 (Allow checking whether a type allows being uninitialized) - #108727 (rustc_expand: make proc-macro derive error translatable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-04Rollup merge of #108727 - tshepang:example-translatable-diagnostic, r=NilstriebDylan DPC-1/+11
rustc_expand: make proc-macro derive error translatable kept this tiny so as to point to it as an example in rustc-dev-guide `@rustbot` label +A-translation
2023-03-04Rollup merge of #108669 - Nilstrieb:query-my-uninitness, r=compiler-errorsDylan DPC-2/+11
Allow checking whether a type allows being uninitialized This is useful for clippy ([rust-lang/clippy#10407](https://github.com/rust-lang/rust-clippy/issues/10407)) and for the future `MaybeUninit::assume_init` panics (#100423).
2023-03-04Rollup merge of #108405 - Nilstrieb:lazy-crate-name-optimization-fuel, ↵Dylan DPC-5/+8
r=WaffleLapkin Lazily compute crate name for consider_optimizing The extra query is unnecessary in the common case of not having fuel.
2023-03-04Rollup merge of #108298 - TaKO8Ki:fix-104440, r=cjgillotDylan DPC-2/+7
Fix ICE: check if snippet is `)` Fixes #107705
2023-03-04Auto merge of #108689 - compiler-errors:normalization-error-smaller, r=lcnrbors-3/+0
Remove `NormalizationError::ConstantKind` No longer in use by `TryNormalizeAfterErasingRegionsFolder` (as of #102355 / e8150fa60cc445de7a57db634deb0668880be593 it seems). It's making `LayoutError`, etc. kinda large -- that was noticed by `@zoxc.`
2023-03-04rustc_expand: make proc-macro derive error translatableTshepang Mbambo-1/+11
2023-03-03Auto merge of #108709 - matthiaskrgr:rollup-j2tjbyx, r=matthiaskrgrbors-48/+61
Rollup of 8 pull requests Successful merges: - #104549 (add -Zexport-executable-symbols to unstable book) - #108292 (Label opaque type for 'captures lifetime' error message) - #108540 (Add `Atomic*::from_ptr`) - #108634 (Add link to component dashboard) - #108647 (Remove dead pgo.sh file) - #108678 (Use `Option::as_slice` where applicable) - #108681 (Improve comments in `needs_process_obligation`.) - #108688 (Match unmatched backticks in library/) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-03Rollup merge of #108681 - nnethercote:needs_process_obligation-comments, r=lqdMatthias Krüger-24/+34
Improve comments in `needs_process_obligation`. And a couple of other places. r? `@lqd`
2023-03-03Rollup merge of #108678 - llogiq:use-option-as-slice, r=NilstriebMatthias Krüger-17/+8
Use `Option::as_slice` where applicable After #105871 introduced `Option::as_slice`, this PR uses it within the compiler. I found it interesting that all cases where `as_slice` could be used were done with different code before; so it seems the new API also has the benefit of being "the obvious solution" where before there was a mix of options, none clearly better than the rest.
2023-03-03Rollup merge of #108292 - compiler-errors:opaque-captures-where, r=oli-obkMatthias Krüger-7/+19
Label opaque type for 'captures lifetime' error message Providing more information may help make this somewhat opaque (lol) error message a bit clearer.
2023-03-03Rollup merge of #108694 - est31:backticks_matchmaking_comments, r=NilstriebMatthias Krüger-48/+51
Match unmatched backticks in compiler/ comments r? ``@Nilstrieb`` as per [advice](https://github.com/rust-lang/rust/pull/108685#issuecomment-1453018499)
2023-03-03Rollup merge of #108685 - est31:backticks_matchmaking, r=petrochenkovMatthias Krüger-21/+23
Match unmatched backticks in compiler/ Found with GNU grep: ``` grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```' ```
2023-03-03Rollup merge of #108667 - compiler-errors:issue-108664, r=estebankMatthias Krüger-1/+1
Fix another ICE in `point_at_expr_source_of_inferred_type` Types coming from method probes must only be investigated *structurally*, since they often contain escaping infer variables from generalization and autoderef. We already have a hack in this PR that erases variables from types, so just use that. Fixes #108664 The note attached to this error is pretty bad: ``` here the type of `primes` is inferred to be `[_]` ``` But that's unrelated to the PR. --- Side-note: This is a pretty easy to trigger beta regression, so I've nominated it. Alternatively, I'm slightly inclined to remove this code altogether until it can be reformulated to be more accurate and less ICEy.
2023-03-03Rollup merge of #108599 - nikic:drop-init, r=cuviperMatthias Krüger-38/+2
Remove legacy PM leftovers This drops two leftovers of legacy PM usage: * We don't need to initialize passes anymore. * The pass listing was still using legacy PM passes. Replace it with the corresponding new PM listing.
2023-03-03Rollup merge of #108553 - compiler-errors:non-lt-late-bound-in-anon-ct, ↵Matthias Krüger-5/+83
r=petrochenkov Deny capturing late-bound non-lifetime param in anon const Introduce a new AnonConstBoundary so we can detect when we capture a late-bound non-lifetime param with `non_lifetime_binders` enabled. In the future, we could technically do something like introduce an early-bound parameter on the anon const, and stick the late-bound param in its substs (kinda like how we turn late-bound lifetimes in opaques into early-bound ones). But for now, just deny it so we don't ICE. Fixes #108191
2023-03-03Rollup merge of #107981 - lcnr:canonicalization-uwu, r=compiler-errorsMatthias Krüger-88/+805
new solver: implement canonicalization and region constraints see the corresponding rustc-dev-guide chapter: https://rustc-dev-guide.rust-lang.org/solve/canonicalization.html r? ``@compiler-errors``
2023-03-03canonicalizationlcnr-88/+805
2023-03-03Don't put integers into backticks during formattingest31-2/+2
2023-03-03Rustdoc-ify LiteralKind noteest31-5/+7
2023-03-03Match end user facing unmatched backticks in compiler/est31-15/+15
2023-03-03Match unmatched backticks in comments in compiler/est31-25/+28
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-23/+23
2023-03-03check if snippet is `)`Takayuki Maeda-2/+7
2023-03-03Don't call `temporary_scope` twice.Nicholas Nethercote-4/+2
`mirror_expr_inner` calls `temporary_scope`. It then calls `make_mirror_unadjusted` which makes an identical call to `temporary_scope`. This commit changes the `mirror_expr_inner` to get the `temp_lifetime` out of the expression produced by `make_mirror_unadjusted`, similar to how it currently gets the type.
2023-03-03Migrate diagnosticMichael Goulet-10/+18
2023-03-03Label opaque type for 'captures lifetime' error messageMichael Goulet-2/+6
2023-03-03Remove NormalizationError::ConstantKindMichael Goulet-3/+0
2023-03-03Improve comments in `needs_process_obligation`.Nicholas Nethercote-24/+34
And a couple of other places.
2023-03-02Rollup merge of #108672 - spastorino:new-rpitit-impl-side, r=compiler-errorsMatthias Krüger-5/+65
Feed queries on impl side for RPITITs when using lower_impl_trait_in_trait_to_assoc_ty I've added a test for traits that were already working and what I think is probably the last bit of infrastructure work needed. In following PRs I'm going to start adding things TDD style, tests and code that make it work. r? `@compiler-errors`
2023-03-02Rollup merge of #108624 - Nilstrieb:move-it-up, r=WaffleLapkinMatthias Krüger-3/+3
Make `ExprKind` the first field in `thir::Expr` This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-03-02Rollup merge of #108573 - kornelski:runtimeenvs, r=WaffleLapkinMatthias Krüger-10/+30
Explain compile-time vs run-time difference in env!() error message This PR is clarifying error message of `env!()` based on this user question: https://users.rust-lang.org/t/environment-variable-out-dir-is-undefined/90067 It makes it clear that `env!()` is for env variables defined at compile-time. There's special-case help text for common Cargo build script variables. I've also rearranged the code to avoid allocating error message on the happy path when the env var is defined.
2023-03-02Rollup merge of #108557 - Nathan-Fenner:nathanf/adjust-error-span-fix-Some, ↵Matthias Krüger-3/+17
r=WaffleLapkin Point error span at Some constructor argument when trait resolution fails This is a follow up to #108254 and #106477 which extends error span refinement to handle a case which I mistakenly believed was handled in #106477. The goal is to refine the error span depicted below: ```rs trait Fancy {} impl <T> Fancy for Option<T> where T: Iterator {} fn want_fancy<F>(f: F) where F: Fancy {} fn example() { want_fancy(Some(5)); // (BEFORE) ^^^^^^^ `{integer}` is not an iterator // (AFTER) ^ `{integer}` is not an iterator } ``` I had used a (slightly more complex) example as an illustrative example in #108254 , but hadn't actually turned it into a test, because I had (incorrectly) believed at the time it was covered by existing behavior. It turns out that `Some` is slightly "special" in that it resolves differently from the other `enum` constructors I had tried, and therefore this test was actually broken. I've now updated the tests to include this example, and fixed the code to correctly resolve the `Some` constructor so that the span of the error is reduced.
2023-03-02Rollup merge of #108022 - CraftSpider:align-bytes, r=oli-obkMatthias Krüger-49/+126
Support allocations with non-Box<[u8]> bytes This is prep work for allowing miri to support passing pointers to C code, which will require `Allocation`s to be correctly aligned. Currently, it just makes `Allocation` generic and plumbs the necessary changes through the right places. The follow-up to this will be adding a type in the miri interpreter which correctly aligns the bytes, using that for the Miri engine, then allowing Miri to pass pointers into these allocations to C calls. Based off of #100467, credit to ```@emarteca``` for the code
2023-03-02Use `Option::as_slice` where applicableAndre Bogus-17/+8
2023-03-02Feed queries on impl side for RPITITs when using ↵Santiago Pastorino-5/+65
lower_impl_trait_in_trait_to_assoc_ty
2023-03-02Allow checking whether a type allows being uninitializedNilstrieb-2/+11
This is useful for clippy and for the future `MaybeUninit::assume_init` panics.
2023-03-02Fix another ICE in point_at_expr_source_of_inferred_typeMichael Goulet-1/+1