summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2021-09-04Tracking issue for UNSUPPORTED_CALLING_CONVENTIONSSimonas Kazlauskas-1/+1
2021-09-04Fix loading large rlibsMark Rousskov-1/+1
Bumps object crate to permit parsing archives with 64-bit table entries. These are primarily encountered when there's more than 4GB of archive data.
2021-09-04Concrete regions can show up in mir borrowck if the originated from there.Oli Scherer-9/+1
We used to not encounter them here, because we took regions from typeck's opaque type resolution by renumbering them. We don't do that anymore.
2021-08-27Do not ICE on HIR based WF check when involving lifetimesEsteban Küber-3/+4
Fix #87549.
2021-08-27Split critical edge targeting the start blockTomasz Miąsko-1/+3
2021-08-20Mir borrowck does not generate lifetime variables for 'static lifetimes ↵Oli Scherer-0/+1
during opaque type resolution.
2021-07-24Auto merge of #87338 - SparrowLii:MaybeTrait, r=wesleywiserbors-33/+17
Simplify the collecting of `? Trait` bounds in where clause This PR fixes the FIXME about using less rightward drift and only one error reporting when collecting of `?Trait` bounds in where clause. Checking whether the path length of `bound_ty` is 1 can be replaced by whether `unresolved_segments` in the partial_res is 0. Checking whether the `param.kind` is `Type{...}` can also be omitted. One Fx hash calculation will be done for Const or Lifetime param, but the impact on efficiency should be small IMO
2021-07-23Auto merge of #86429 - JohnTitor:get-by-key-enum-part-2, r=oli-obkbors-50/+24
Improve `get_by_key_enumerated` more Follow-up of #86392, this applies the suggestions by `@m-ou-se.` r? `@m-ou-se`
2021-07-24Rollup merge of #87322 - chazkiker2:fix/suggestion-ref-sync-send, r=estebankYuki Okushi-5/+30
fix: clarify suggestion that `&T` must refer to `T: Sync` for `&T: Send` ### Description - [x] fix #86507 - [x] add UI test for relevant code from issue - [x] change `rustc_trait_selection/src/traits/error_reporting/suggestions.rs` to include a more clear suggestion when `&T` fails to satisfy `Send` bounds due to the fact that `T` fails to implement `Sync` - [x] update UI test in Clippy: `src/tools/tests/ui/future_not_send.stderr`
2021-07-24Rollup merge of #86410 - spastorino:get_value_matching, r=oli-obkYuki Okushi-7/+33
VecMap::get_value_matching should return just one element r? `@nikomatsakis` Related to #86465 and #87287
2021-07-23Add ConstraintLocator docsSantiago Pastorino-1/+8
2021-07-23Add VecMap::get_value_matching and assert if > 1 elementSantiago Pastorino-6/+25
Otherwise is a bug that we want to uncover.
2021-07-23Rollup merge of #87373 - Aaron1011:hir-wf-field, r=estebankYuki Okushi-5/+7
Extend HIR WF checking to fields r? ``@estebank``
2021-07-23Sort features alphabeticallyYuki Okushi-13/+13
2021-07-23Use `map_while` instead of `take_while` + `map`Yuki Okushi-4/+6
2021-07-23Improve `get_by_key_enumerated` moreYuki Okushi-39/+11
2021-07-23Auto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorinobors-107/+70
Make mir borrowck's use of opaque types independent of the typeck query's result fixes #87218 fixes #86465 we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result. When i removed the `fixup_opaque_types` function in #87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information. We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead. r? `@spastorino`
2021-07-22Squash all commits.chaz-kiker-5/+30
add test for issue 86507 add stderr for issue 86507 update issue-86507 UI test add comment for the expected error in UI test file add proper 'refers to <ref_type>' in suggestion update diagnostic phrasing; update test to match new phrasing; re-organize logic for checking T: Sync evaluate additional obligation to figure out if T is Sync run './x.py test tidy --bless' incorporate changes from review; reorganize logic for readability
2021-07-22Auto merge of #86212 - ↵bors-6/+2
pnkfelix:mainline-targetted-revert-81473-warn-write-only-fields, r=simulacrum Revert PR 81473 to resolve (on mainline) issues 81626 and 81658. This is a nightly-targetted variant of PR #83171 The intent is to just address issue #81658 on all release channels, rather that keep repeatedly reverting PR #83171 on beta. However, our intent is *also* to reland PR #83171 after we have addressed issue #81658 , most likely by coupling the re-landing of PR #83171 with an enhancement like PR #83004
2021-07-22Extend HIR WF checking to fieldsAaron Hill-5/+7
2021-07-22Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomezbors-20/+2
Rollup of 6 pull requests Successful merges: - #87270 (Don't display <table> in item summary) - #87281 (Normalize generic_ty before checking if bound is met) - #87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping) - #87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.) - #87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations) - #87357 (Update my name/email in .mailmap) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-22Rollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisaGuillaume Gomez-20/+1
Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC. The LLVM limitation that previously prevented this has been fixed in LLVM 9 which is older than the oldest LLVM version we currently support. Fixes https://github.com/rust-lang/rust/issues/61002. r? ``@nagisa`` (or anyone else from ``@rust-lang/wg-llvm)``
2021-07-22Rollup merge of #87281 - rust-lang:issue-81487, r=nikomatsakisGuillaume Gomez-0/+1
Normalize generic_ty before checking if bound is met Fixes #81487 r? `@nikomatsakis`
2021-07-22Resolve nested inference variables.Oli Scherer-19/+7
I attempted that with the previous code, but I misunderstdood how `shallow_resolve` works.
2021-07-22Remove an unnecessary variableOli Scherer-2/+1
2021-07-22Use instrument debugging for more readable logsOli Scherer-13/+9
2021-07-22Make mir borrowck's use of opaque types independent of the typeck query's resultOli Scherer-87/+66
2021-07-22Fix VecMap::iter_mutOli Scherer-5/+6
It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.
2021-07-22Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiserbors-15/+75
Profile incremental compilation hashing fingerprints Adds profiling instrumentation for the hashing of incremental compilation fingerprints per query. This will eventually feed into the `measureme` and `rustc-perf` infrastructure for tracking if computing hashes changes over time. TODOs: * [x] Address the FIXME where we are including node interning in the hash timing. * [ ] Update measureme/summarize to handle this new data: https://github.com/rust-lang/measureme/pull/166 * [ ] ~Update rustc-perf to handle the new data from measureme~ (will be done at a later time) r? `@ghost` cc `@michaelwoerister`
2021-07-22Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebankbors-47/+172
Support HIR wf checking for function signatures During function type-checking, we normalize any associated types in the function signature (argument types + return type), and then create WF obligations for each of the normalized types. The HIR wf code does not currently support this case, so any errors that we get have imprecise spans. This commit extends `ObligationCauseCode::WellFormed` to support recording a function parameter, allowing us to get the corresponding HIR type if an error occurs. Function typechecking is modified to pass this information during signature normalization and WF checking. The resulting code is fairly verbose, due to the fact that we can no longer normalize the entire signature with a single function call. As part of the refactoring, we now perform HIR-based WF checking for several other 'typed items' (statics, consts, and inherent impls). As a result, WF and projection errors in a function signature now have a precise span, which points directly at the responsible type. If a function signature is constructed via a macro, this will allow the error message to point at the code 'most responsible' for the error (e.g. a user-supplied macro argument).
2021-07-22Auto merge of #87250 - robojumper:87199-sized-relaxation, r=nikomatsakisbors-0/+1
Fix implicit Sized relaxation when attempting to relax other, unsupported trait Fixes #87199. Do note that this bug fix causes code like the `ref_arg::<[i32]>(&[5]);` line in the test case in combination with an affected function to no longer compile.
2021-07-21Allow some temporarily dead code.Felix S. Klock II-0/+2
I expect these two methods to come back very soon; noise of removing them to satisfy lint seems wrong.
2021-07-21Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.Felix S. Klock II-6/+0
Revert "Add missing brace" This reverts commit 85ad773049536d7fed9a94ae0ac74f97135c8655. Revert "Simplify base_expr" This reverts commit 899aae465eb4ef295dc1eeb2603f744568e0768c. Revert "Warn write-only fields" This reverts commit d3c69a4c0dd98af2611b7553d1a65afef6a6ccb0.
2021-07-22Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakisbors-36/+108
When pretty printing, name placeholders as bound regions Split from #85499 When we see a placeholder that we are going to print, treat it as a bound var (and add it to a `for<...>`
2021-07-21Improve caching during trait evaluationAaron Hill-28/+49
Previously, we would 'forget' that we had `'static` regions in some place during trait evaluation. This lead to us producing `EvaluatedToOkModuloRegions` when we could have produced `EvaluatedToOk`, causing us to perform unnecessary work. This PR preserves `'static` regions when we canonicalize a predicate for `evaluate_obligation`, and when we 'freshen' a predicate during trait evaluation. Thie ensures that evaluating a predicate containing `'static` regions can produce `EvaluatedToOk` (assuming that we don't end up introducing any region dependencies during evaluation). Building off of this improved caching, we use `predicate_must_hold_considering_regions` during fulfillment of projection predicates to see if we can skip performing additional work. We already do this for trait predicates, but doing this for projection predicates lead to mixed performance results without the above caching improvements.
2021-07-21Rollup merge of #87346 - rylev:rename-force-warn, r=nikomatsakisEric Huss-6/+6
Rename force-warns to force-warn The renames the `--force-warns` option to `--force-warn`. This mirrors other lint options like `--warn` and `--deny` which are in the singular. r? `@nikomatsakis` cc `@ehuss` - this option is being used by Cargo. How do we make sure the transition to using the new name is as smooth as possible?
2021-07-21Rollup merge of #87342 - midgleyc:add-E0757-long, r=GuillaumeGomezGuillaume Gomez-1/+34
Add long explanation for E0757 Helps with #61137
2021-07-21Rollup merge of #87321 - midgleyc:add-E0722-long, r=GuillaumeGomezGuillaume Gomez-1/+32
Add long explanation for E0722 Helps with #61137
2021-07-21Rollup merge of #87311 - oli-obk:nll_suggestion_span, r=estebankGuillaume Gomez-4/+6
Get back the more precise suggestion spans of old regionck I noticed that when you turn on nll, the structured suggestion replaces a snippet instead of appending a snippet. It seems clearer to the user to only highlight the newly added characters instead of the entire `impl Trait` (and old regionck already does it this way). r? ``@estebank``
2021-07-21Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obkGuillaume Gomez-22/+34
Recognize bounds on impls as const bounds r? ```@oli-obk```
2021-07-21Rollup merge of #87206 - matthiaskrgr:clippy_collect, r=davidtwcoGuillaume Gomez-9/+5
avoid temporary vectors/reuse iterators Avoid collecting an interator just to re-iterate immediately. Rather reuse the previous iterator. (clippy::needless_collect)
2021-07-21Rename force-warns to force-warnRyan Levick-6/+6
2021-07-21docs: normalise wording in line with docsChris Midgley-1/+1
2021-07-21docs: add additional links for ffi_pure / ffi_constChris Midgley-2/+10
2021-07-21Add long explanation for E0757Chris Midgley-1/+26
2021-07-21docs: add newline before exampleChris Midgley-0/+1
2021-07-21docs: remove spurious main functionsChris Midgley-4/+0
2021-07-21add working code exampleChris Midgley-0/+10
2021-07-21Correct fmtsurechen-10/+7
2021-07-21Simplify the collecting of `? Trait` bounds in where clausesurechen-33/+20