about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2021-10-11Rollup merge of #89722 - jkugelman:cannonical-typo, r=joshtriplettMatthias Krüger-2/+2
Fix spelling: Cannonical -> Canonical
2021-10-10Auto merge of #88952 - skrap:add-armv7-uclibc, r=nagisabors-2/+2
Add new tier-3 target: armv7-unknown-linux-uclibceabihf This change adds a new tier-3 target: armv7-unknown-linux-uclibceabihf This target is primarily used in embedded linux devices where system resources are slim and glibc is deemed too heavyweight. Cross compilation C toolchains are available [here](https://toolchains.bootlin.com/) or via [buildroot](https://buildroot.org). The change is based largely on a previous PR #79380 with a few minor modifications. The author of that PR was unable to push the PR forward, and graciously allowed me to take it over. Per the [target tier 3 policy](https://github.com/rust-lang/rfcs/blob/master/text/2803-target-tier-policy.md), I volunteer to be the "target maintainer". This is my first PR to Rust itself, so I apologize if I've missed things!
2021-10-10Fix spelling: Cannonical -> CanonicalJohn Kugelman-2/+2
2021-10-09Auto merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillotbors-36/+40
Refactor fingerprint reconstruction This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds. This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.
2021-10-08Rollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514Guillaume Gomez-2/+2
clippy::complexity fixes
2021-10-08clippy::complexity fixesMatthias Krüger-2/+2
2021-10-08Auto merge of #89576 - tom7980:issue-89275-fix, r=estebankbors-4/+11
Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions Closes #89275 This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait. Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-79/+70
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-07Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoeristerJubilee-1/+1
Implement `#[link_ordinal(n)]` Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name. As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL. Part of #58713.
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-65/+69
2021-10-07Auto merge of #89534 - camsteffen:diag-name, r=oli-obkbors-4/+9
Introduce `tcx.get_diagnostic_name` Introduces a "reverse lookup" for diagnostic items. This is mainly intended for `@rust-lang/clippy` which often does a long series of `is_diagnostic_item` calls for the same `DefId`. r? `@oli-obk`
2021-10-07Remove untracked vtable-const-allocation cache from tcxMichael Woerister-15/+2
2021-10-06Query the fingerprint style during key reconstructionMark Rousskov-36/+40
Keys can be reconstructed from fingerprints that are not DefPathHash, but then we cannot extract a DefId from them.
2021-10-06Rollup merge of #89329 - tmiasko:print-type-sizes-no-fields, r=jackh726Manish Goregaokar-2/+5
print-type-sizes: skip field printing for primitives Fixes #86528.
2021-10-06Add new target armv7-unknown-linux-uclibceabihfYannick Koehler-2/+2
Co-authored-by: Jonah Petri <jonah@petri.us>
2021-10-06Introduce get_diagnostic_nameCameron Steffen-4/+9
2021-10-06Auto merge of #89323 - estebank:derive-binop, r=petrochenkovbors-0/+21
Consider unfulfilled obligations in binop errors When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Fix #84515.
2021-10-05Consider unfulfilled obligations in binop errorsEsteban Kuber-0/+21
When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Point at trait(s) that needs to be `impl`emented.
2021-10-05Issue 89275 fix and testTom Farmer-4/+11
Issue 89275 fix and test Fix librustdoc OverflowError usage rust tidy run Issue 89275 fix and test
2021-10-05Auto merge of #89266 - cjgillot:session-ich, r=michaelwoeristerbors-853/+33
Move ICH to rustc_query_system Based on https://github.com/rust-lang/rust/pull/89183 The StableHashingContext does not need to be in rustc_middle. This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-04Rollup merge of #89466 - Mark-Simulacrum:query-macros, r=oli-obkJubilee-5/+5
Fix bug with query modifier parsing The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided. Extracted from other work, and somewhat duplicates 0358edeb5 from #85830, but this approach seems a little simpler to me. Not technically currently necessary but seems like a good cleanup.
2021-10-04Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplettJubilee-1/+0
Stabilize try_reserve Stabilization PR for the [`try_reserve` feature](https://github.com/rust-lang/rust/issues/48043#issuecomment-898040475).
2021-10-04Rollup merge of #89453 - waywardmonkeys:consistent-supertrait-usage, r=nagisaJubilee-2/+2
Consistently use 'supertrait'. A subset of places referred to 'super-trait', so this changes them to all use 'supertrait'. This matches 'supertype' and some other usages. An exception is 'auto-trait' which is consistently used in that manner.
2021-10-04Stabilize try_reserveKornel-1/+0
2021-10-03Rollup merge of #88481 - bjorn3:remove_feature_gates, r=cjgillotManish Goregaokar-9/+7
Remove some feature gates The first commit removes various feature gates that are unused. The second commit replaces some `Fn` implementations with `Iterator` implementations, which is much cleaner IMO. The third commit replaces an unboxed_closures feature gate with min_specialization. For some reason the unboxed_closures feature gate suppresses the min_specialization feature gate from triggering on an `TrustedStep` impl. The last comment just turns a regular comment into a doc comment as drive by cleanup. I can move it to a separate PR if preferred.
2021-10-03Access StableHashingContext in rustc_query_system.Camille GILLOT-2/+1
2021-10-03Fully remove rustc_middle::ich.Camille GILLOT-4/+1
2021-10-03Remove re-export.Camille GILLOT-17/+14
2021-10-03Move ICH to rustc_query_system.Camille GILLOT-561/+17
2021-10-03Remove StableHashProvider.Camille GILLOT-31/+1
2021-10-03Move rustc_middle::middle::cstore to rustc_session.Camille GILLOT-205/+7
2021-10-03Move some HashStable impls.Camille GILLOT-41/+0
2021-10-02Add desugaring mark to while loopCameron Steffen-3/+3
2021-10-02Turn a module non-doc comment into a doc commentbjorn3-7/+7
2021-10-02Remove various unused feature gatesbjorn3-2/+0
2021-10-02Prevent macro ambiguity errorsbjorn3-5/+5
The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided.
2021-10-02Auto merge of #89408 - Mark-Simulacrum:fix-query-nondet, r=petrochenkovbors-2/+23
Avoid nondeterminism in trimmed_def_paths Previously this query depended on the global interning order of Symbols, which meant that irrelevant changes could influence the query and cause recompilations. This commit ensures that the return set is stable and will not be affected by the global order by deterministically (in lexicographic order) choosing a name to use if there are multiple names for a single DefId. This should fix the cause of the [regressions] in #83343. [regressions]: https://perf.rust-lang.org/compare.html?start=9620f3a84b079decfdc2e557be007580b097fe43&end=addb4da686a97da46159f0123cb6cdc2ce3d7fdb
2021-10-02Consistently use 'supertrait'.Bruce Mitchener-2/+2
A subset of places referred to 'super-trait', so this changes them to all use 'supertrait'. This matches 'supertype' and some other usages. An exception is 'auto-trait' which is consistently used in that manner.
2021-10-01Auto merge of #89449 - Manishearth:rollup-3alb61f, r=Manishearthbors-3/+28
Rollup of 7 pull requests Successful merges: - #85223 (rustdoc: Clarified the attribute which prompts the warning) - #88847 (platform-support.md: correct ARMv7+MUSL platform triple notes) - #88963 (Coerce const FnDefs to implement const Fn traits ) - #89376 (Fix use after drop in self-profile with llvm events) - #89422 (Replace whitespaces in doctests' name with dashes) - #89440 (Clarify a sentence in the documentation of Vec (#84488)) - #89441 (Normalize after substituting via `field.ty()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-01Rollup merge of #89441 - Nadrieril:fix-89393, r=tmandryManish Goregaokar-2/+2
Normalize after substituting via `field.ty()` Back in https://github.com/rust-lang/rust/issues/72476 I hadn't understood where the problem was coming from, and only worked around the issue. What happens is that calling `field.ty()` on a field of a generic struct substitutes the appropriate generics but doesn't normalize the resulting type. As a consumer of types I'm surprised that one would substitute without normalizing, feels like a footgun, so I added a comment. Fixes https://github.com/rust-lang/rust/issues/89393.
2021-10-01Rollup merge of #88963 - fee1-dead:const-iterator, r=oli-obkManish Goregaokar-1/+26
Coerce const FnDefs to implement const Fn traits You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`. r? ``@oli-obk`` ``@rustbot`` label T-compiler F-const_trait_impl
2021-10-01Auto merge of #88880 - cjgillot:no-krate, r=oli-obkbors-15/+67
Rework HIR API to make invocations of the hir_crate query harder. `hir_crate` forces the recomputation of queries that depend on it. This PR aims at avoiding useless invocations of `hir_crate` by making dependent code go through `tcx.hir()`.
2021-10-01Normalize after substituting via `field.ty()`Nadrieril-2/+2
2021-10-01Rollup merge of #87868 - Kixiron:packing-on-the-pounds, r=eddybManish Goregaokar-14/+72
Added -Z randomize-layout flag An implementation of #77316, it currently randomly shuffles the fields of `repr(rust)` types based on their `DefPathHash` r? ``@eddyb``
2021-10-01Auto merge of #89395 - ↵bors-40/+74
In-line:remove_visible_path_from_allowed_deprecated_lint, r=jyn514 Remove visible path calculation from allowed deprecation lint
2021-09-30Implemented -Z randomize-layoutChase Wilson-14/+72
2021-09-30Avoid nondeterminism in trimmed_def_pathsMark Rousskov-2/+23
Previously this query depended on the global interning order of Symbols, which meant that irrelevant changes could influence the query and cause recompilations. This commit ensures that the return set is stable and will not be affected by the global order by deterministically (in lexicographic order) choosing a name to use if there are multiple names for a single DefId.
2021-09-30Move EncodedMetadata to rustc_metadata.Camille GILLOT-11/+0
2021-09-30Move encode_metadata out of CrateStore.Camille GILLOT-11/+0
2021-09-30Apply suggestions from code reviewCamille Gillot-1/+1
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>