summary refs log tree commit diff
path: root/compiler/rustc_passes/src
AgeCommit message (Collapse)AuthorLines
2021-06-14Revert "Allow specifying alignment for functions"Felix S. Klock II-40/+6
This reverts commit 448d07683a6defd567996114793a09c9a8aef5df to address issue 85713 on beta.
2021-05-04Revert PR 81473 to resolve (on beta) issues 81626 and 81658.Felix S. Klock II-21/+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-04-29Implement RFC 1260 with feature_name `imported_main`.Charles Lew-24/+31
2021-04-26Auto merge of #84546 - CohenArthur:fix-liveness-typo, r=jyn514bors-3/+3
Fix typo in report_unsed_assign The function was called `report_unsed_assign`, which I assume is a typo, considering the rest of the file. This replaces `report_unsed_assign` with `report_unused_assign`.
2021-04-25liveness: Fix typo report_unsed_assign -> report_unused_assignCohenArthur-3/+3
2021-04-24Auto merge of #84310 - RalfJung:const-fn-feature-flags, r=oli-obkbors-1/+0
further split up const_fn feature flag This continues the work on splitting up `const_fn` into separate feature flags: * `const_fn_trait_bound` for `const fn` with trait bounds * `const_fn_unsize` for unsizing coercions in `const fn` (looks like only `dyn` unsizing is still guarded here) I don't know if there are even any things left that `const_fn` guards... at least libcore and liballoc do not need it any more. `@oli-obk` are you currently able to do reviews?
2021-04-22Rollup merge of #84343 - camsteffen:closure-tree, r=varkorDylan DPC-14/+1
Remove `ScopeTree::closure_tree` Seems to be dead code since #50649.
2021-04-19Remove closure_treeCameron Steffen-14/+1
2021-04-19Auto merge of #84091 - tmiasko:check-attrs-sym, r=davidtwcobors-49/+42
Match against attribute name when validating attributes Extract attribute name once and match it against symbols that are being validated, instead of using `Session::check_name` for each symbol individually. Assume that all validated attributes are used, instead of marking them as such, since the attribute check should be exhaustive.
2021-04-18fix feature use in rustc libsRalf Jung-1/+0
2021-04-16Remove #[main] attribute.Charles Lew-8/+5
2021-04-11Match against attribute name when validating attributesTomasz Miąsko-49/+42
Extract attribute name once and match it against symbols that are being validated, instead of using `Session::check_name` for each symbol individually. Assume that all validated attributes are used, instead of marking them as such, since the attribute check should be exhaustive.
2021-04-07Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkovDylan DPC-6/+7
Use AnonConst for asm! constants This replaces the old system which used explicit promotion. See #83169 for more background. The syntax for `const` operands is still the same as before: `const <expr>`. Fixes #83169 Because the implementation is heavily based on inline consts, we suffer from the same issues: - We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`. - We are hitting the same ICEs as inline consts, for example #78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.
2021-04-06Use AnonConst for asm! constantsAmanieu d'Antras-6/+7
2021-04-05Allow specifying alignment for functionsWesley Norris-6/+40
2021-04-02Auto merge of #80965 - camelid:rename-doc-spotlight, r=jyn514bors-5/+17
Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` Fixes #80936. "spotlight" is not a very specific or self-explaining name. Additionally, the dialog that it triggers is called "Notable traits". So, "notable trait" is a better name. * Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` * Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]` * Update documentation * Improve documentation r? `@Manishearth`
2021-03-30Remove hir::CrateItem.Camille GILLOT-3/+3
2021-03-26Use iter::zip in compiler/Josh Stone-4/+8
2021-03-25Auto merge of #83424 - cjgillot:noparam, r=lcnrbors-13/+0
GenericParam does not need to be a HIR owner. The special case is not required. Universal impl traits design to regular generic parameters, and their content is owned by the enclosing item. Existential (and opaque) impl traits generate their own enclosing item, and are collected through it.
2021-03-24Auto merge of #75384 - JulianKnodt:cg_def, r=varkor,lcnrbors-4/+3
implement `feature(const_generics_defaults)` Implements const generics defaults `struct Example<const N: usize=3>`, as well as a query for getting the default of a given const-parameter's def id. There are some remaining FIXME's but they were specified as not blocking for merging this PR. This also puts the defaults behind the unstable feature gate `#![feature(const_generics_defaults)]`. ~~This currently creates a field which is always false on `GenericParamDefKind` for future use when consts are permitted to have defaults. I'm not sure if this is exactly what is best for adding default parameters, but I mimicked the style of type defaults, so hopefully this is ok.~~ r? `@lcnr`
2021-03-24Rollup merge of #83313 - cjgillot:assert, r=michaelwoeristerDylan DPC-0/+20
Only enable assert_dep_graph when query-dep-graph is enabled. This is a debugging option. The only effect should be on rustc tests. r? ``@michaelwoerister``
2021-03-23GenericParam does not need to be a HIR owner.Camille GILLOT-13/+0
2021-03-23Some refactoringvarkor-4/+3
2021-03-23Fix comment.Camille GILLOT-1/+2
2021-03-22Err if the debugging options are not passed.Camille GILLOT-0/+19
2021-03-19stabilize or_patternsmark-1/+1
2021-03-19Auto merge of #82951 - sexxi-goose:wr-mir-replace-methods2, r=nikomatsakisbors-55/+54
Replace closures_captures and upvar_capture with closure_min_captures Removed all uses of closures_captures and upvar_capture and refactored code to work with closure_min_captures. This also involved removing functions that were no longer needed like the bridge. Closes https://github.com/rust-lang/project-rfc-2229/issues/18 r? `@nikomatsakis`
2021-03-19Rollup merge of #82846 - GuillaumeGomez:doc-alias-list, r=jyn514Dylan DPC-30/+83
rustdoc: allow list syntax for #[doc(alias)] attributes Fixes https://github.com/rust-lang/rust/issues/81205. It now allows to have: ```rust #[doc(alias = "x")] // and: #[doc(alias("y", "z"))] ``` cc ``@jplatte`` r? ``@jyn514``
2021-03-18Replace closures_captures and upvar_capture with closure_min_capturesJennifer Wills-55/+54
make changes to liveness to use closure_min_captures use different span borrow check uses new structures rename to CapturedPlace stop using upvar_capture in regionck remove the bridge cleanup from rebase + remove the upvar_capture reference from mutability_errors.rs remove line from livenes test make our unused var checking more consistent update tests adding more warnings to the tests move is_ancestor_or_same_capture to rustc_middle/ty update names to reflect the closures add FIXME check that all captures are immutable borrows before returning add surrounding if statement like the original move var out of the loop and rename Co-authored-by: Logan Mosier <logmosier@gmail.com> Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-18/+18
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
2021-03-15Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`Camelid-5/+17
"spotlight" is not a very specific or self-explaining name. Additionally, the dialog that it triggers is called "Notable traits". So, "notable trait" is a better name. * Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` * Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]` * Update documentation * Improve documentation
2021-03-15Rollup merge of #83098 - camelid:more-doc-attr-check, r=davidtwcoDylan DPC-46/+64
Find more invalid doc attributes - Lint on `#[doc(123)]`, `#[doc("hello")]`, etc. - Lint every attribute; e.g., will now report two warnings for `#[doc(foo, bar)]` - Add hyphen to "crate level" - Display paths like `#[doc(foo::bar)]` correctly instead of as an empty string
2021-03-14Use pretty-printer instead of `span_to_snippet`Camelid-7/+4
2021-03-14Tweak diagnosticsCamelid-6/+9
- Tweak lint message - Display multi-segment paths correctly
2021-03-13Add hyphen to "crate level"Camelid-2/+2
"crate level attribute" -> "crate-level attribute"
2021-03-13Report error for each invalid nested attributeCamelid-6/+9
2021-03-13Lint non-meta doc attributesCamelid-0/+10
E.g., `#[doc(123)]`.
2021-03-13Refactor `check_doc_attrs` bodyCamelid-36/+41
This change makes it easier to follow the control flow. I also moved the end-of-line comments attached to some symbols to before the symbol listing. This allows rustfmt to format the code; otherwise no formatting occurs (see rust-lang/rustfmt#4750).
2021-03-11Improve code by removing similar function calls and using loops instead for ↵Guillaume Gomez-59/+33
collecting iterators
2021-03-11Validate rustc_layout_scalar_valid_range_{start,end} attributesTomasz Miąsko-1/+36
2021-03-10Allow doc alias attributes to use both list and valueGuillaume Gomez-7/+86
2021-03-09Track HirId when visiting attributes.Camille GILLOT-3/+3
2021-03-09Remove hir::Item::attrs.Camille GILLOT-7/+10
2021-03-09Remove hir::ForeignItem::attrs.Camille GILLOT-1/+2
2021-03-09Remove hir::Crate::attrs.Camille GILLOT-2/+2
2021-03-09Do not store attrs in FnKind.Camille GILLOT-2/+3
2021-03-09Access attrs directly from HirId in rustc_passes::diagnostic_item.Camille GILLOT-6/+8
2021-03-09Access attrs directly from HirId in rustc_passes::lang_items.Camille GILLOT-14/+6
2021-03-09Access attrs directly from HirId in rustc_passes::dead.Camille GILLOT-23/+9
2021-03-09Access attrs directly from HirId in rustc_passes::stability.Camille GILLOT-12/+1