summary refs log tree commit diff
path: root/compiler/rustc_middle/src/middle
AgeCommit message (Collapse)AuthorLines
2021-06-14Revert "Allow specifying alignment for functions"Felix S. Klock II-4/+0
This reverts commit 448d07683a6defd567996114793a09c9a8aef5df to address issue 85713 on beta.
2021-04-27Derived Eq no longer shows uncoveredRich Kadel-0/+4
The Eq trait has a special hidden function. MIR `InstrumentCoverage` would add this function to the coverage map, but it is never called, so the `Eq` trait would always appear uncovered. Fixes: #83601 The fix required creating a new function attribute `no_coverage` to mark functions that should be ignored by `InstrumentCoverage` and the coverage `mapgen` (during codegen). While testing, I also noticed two other issues: * spanview debug file output ICEd on a function with no body. The workaround for this is included in this PR. * `assert_*!()` macro coverage can appear covered if followed by another `assert_*!()` macro. Normally they appear uncovered. I submitted a new Issue #84561, and added a coverage test to demonstrate this issue.
2021-04-25Rollup merge of #83519 - oli-obk:assign_shrink_your_normal_code, r=pnkfelixYuki Okushi-5/+10
Implement a lint that highlights all moves larger than a configured limit Tracking issue: #83518 [MCP 420](https://github.com/rust-lang/compiler-team/issues/420) still ~blazing~ in progress r? ```@pnkfelix``` The main open issue I see with this minimal impl of the feature is that the lint is immediately "stable" (so it can be named on stable), even if it is never executed on stable. I don't think we have the concept of unstable lint names or hiding lint names without an active feature gate, so that would be a bigger change.
2021-04-20Add an attribute to be able to configure the limitOli Scherer-5/+10
2021-04-19Remove closure_treeCameron Steffen-31/+0
2021-04-06Auto merge of #81234 - repnop:fn-alignment, r=lcnrbors-0/+4
Allow specifying alignment for functions Fixes #75072 This allows the user to specify alignment for functions, which can be useful for low level work where functions need to necessarily be aligned to a specific value. I believe the error cases not covered in the match are caught earlier based on my testing so I had them just return `None`.
2021-04-05Allow specifying alignment for functionsWesley Norris-0/+4
2021-04-03Move SanitizerSet to rustc_targetSimonas Kazlauskas-1/+1
2021-03-31Add var to BoundRegion. Add query to get bound vars for applicable items.Jack Huey-0/+2
2021-03-31Make late and late_anon regions track the bound var positionJack Huey-2/+7
2021-03-27Remove (lots of) dead codeJoshua Nelson-6/+2
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-24resolve late lifetimes by itemJack Huey-5/+0
This reverts commit 22ae20733515d710c1134600bc1e29cdd76f6b9b.
2021-01-16Enforce that query results implement DebugAaron Hill-6/+6
2020-12-23Rollup merge of #80302 - pierwill:fix-80287, r=lcnrGuillaume Gomez-4/+2
docs: Update rustc_middle::middle::region::ScopeTree Correct return type in docs for [`yield_in_source`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/middle/region/struct.ScopeTree.html#method.yield_in_scope) method. Closes #80287.
2020-12-22docs: Update rustc_middle::middle::region::ScopeTreepierwill-4/+2
This corrects the return type in docs for yield_in_source method. Closes #80287.
2020-12-21docs: Edit rustc_middle::middle::privacypierwill-4/+6
Add descriptions of `AccessLevel` and `AccessLevels`. Add missing punctuation.
2020-12-16Allow `since="TBD"` for rustc_deprecatedbstrie-35/+40
2020-12-03rustc_metadata: Remove some dead codeVadim Petrochenkov-2/+0
2020-12-01Rollup merge of #79509 - GuillaumeGomez:improve-attr-spans, r=oli-obkGuillaume Gomez-2/+1
Improve attribute message error spans I got the idea while working on https://github.com/rust-lang/rust/pull/79464
2020-12-01Created NestedMetaItem::name_value_literal_span methodGuillaume Gomez-2/+1
2020-11-25Lazy DefPath decoding for incremental compilationAaron Hill-0/+6
2020-11-12stability: More precise location for deprecation lint on macrosVadim Petrochenkov-2/+3
2020-11-09Rollup merge of #77640 - ethanboxx:int_error_matching_attempt_2, r=KodrAusDylan DPC-2/+4
Refactor IntErrorKind to avoid "underflow" terminology This PR is a continuation of #76455 # Changes - `Overflow` renamed to `PosOverflow` and `Underflow` renamed to `NegOverflow` after discussion in #76455 - Changed some of the parsing code to return `InvalidDigit` rather than `Empty` for strings "+" and "-". https://users.rust-lang.org/t/misleading-error-in-str-parse-for-int-types/49178 - Carry the problem `char` with the `InvalidDigit` variant. - Necessary changes were made to the compiler as it depends on `int_error_matching`. - Redid tests to match on specific errors. r? ```@KodrAus```
2020-11-04fix a couple of clippy warnings:Matthias Krüger-1/+1
filter_next manual_strip redundant_static_lifetimes single_char_pattern unnecessary_cast unused_unit op_ref redundant_closure useless_conversion
2020-10-26Fix typoEthan Brierley-1/+1
2020-10-26Apply suggested changesEthan Brierley-2/+4
2020-10-24Compute proper module parent during resolutionAaron Hill-0/+2
Fixes #75982 The direct parent of a module may not be a module (e.g. `const _: () = { #[path = "foo.rs"] mod foo; };`). To find the parent of a module for purposes of resolution, we need to walk up the tree until we hit a module or a crate root.
2020-10-23Rollup merge of #78098 - camelid:fixup-docs, r=steveklabnikYuki Okushi-11/+11
Clean up and improve some docs * compiler docs * Don't format list as part of a code block * Clean up some other formatting * rustdoc book * Update CommonMark spec version to latest (0.28 -> 0.29) * Clean up some various wording and formatting
2020-10-21Clean up and improve some docsCamelid-11/+11
* compiler docs * Don't format list as part of a code block * Clean up some other formatting * rustdoc book * Update CommonMark spec version to latest (0.28 -> 0.29) * Clean up some various wording and formatting
2020-10-19Calculate visibilities once in resolveVadim Petrochenkov-17/+5
Then use them through a query based on resolver outputs
2020-10-14Remove unused code from rustc_middleest31-5/+0
2020-10-14documentation fixDing Xiang Fei-3/+7
2020-10-08Implement the instruction_set attributexd009642-1/+6
2020-10-06remove OnlySign in favour of InvalidDigitEthan Brierley-3/+1
2020-10-06Bring char along with InvalidDigitEthan Brierley-1/+1
2020-10-06Fill in things needed to stabilize int_error_matchingEthan Brierley-3/+5
2020-09-30Add support for cmse_nonsecure_entry attributeHugues de Valon-0/+3
This patch adds support for the LLVM cmse_nonsecure_entry attribute. This is a target-dependent attribute that only has sense for the thumbv8m Rust targets. You can find more information about this attribute here: https://developer.arm.com/documentation/ecm0359818/latest/ Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-22Update src/librustc_middle/middle/stability.rsAvi Dessauer-10/+4
Co-authored-by: varkor <github@varkor.com>
2020-09-22Add documentationAvi Dessauer-2/+5
2020-09-22Remove now unneeded check_stability argumentAvi Dessauer-15/+8
2020-09-22Stability annotations on generic trait parametersAvi Dessauer-8/+32
2020-09-20Rollup merge of #76891 - lcnr:less-ref, r=ecstatic-morseRalf Jung-3/+3
don't take `TyCtxt` by reference small cleanup
2020-09-18don't take `TyCtxt` by referenceBastian Kauschke-3/+3
2020-09-18use matches!() macro for simple if let conditionsMatthias Krüger-1/+1
2020-09-02pretty: trim paths of unique symbolsDan Aloni-1/+2
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-30mv compiler to compiler/mark-0/+1678