about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src
AgeCommit message (Collapse)AuthorLines
2022-04-14Update issue-92893.stderrouz-a-4/+6
2022-04-14Reimplement lowering of sym operands for asm! so that it also works with ↵Amanieu d'Antras-88/+55
global_asm!
2022-04-13couple of clippy::complexity fixesMatthias Krüger-7/+3
2022-04-13couple of clippy::perf fixesMatthias Krüger-1/+1
2022-04-13Auto merge of #94255 - b-naber:use-mir-constant-in-thir, r=oli-obkbors-36/+46
Use mir constant in thir instead of ty::Const This is blocked on https://github.com/rust-lang/rust/pull/94059 (does include its changes, the first two commits in this PR correspond to those changes) and https://github.com/rust-lang/rust/pull/93800 being reinstated (which had to be reverted). Mainly opening since `@lcnr` offered to give some feedback and maybe also for a perf-run (if necessary). This currently contains a lot of duplication since some of the logic of `ty::Const` had to be copied to `mir::ConstantKind`, but with the introduction of valtrees a lot of that functionality will disappear from `ty::Const`. Only the last commit contains changes that need to be reviewed here. Did leave some `FIXME` comments regarding future implementation decisions and some things that might be incorrectly implemented. r? `@oli-obk`
2022-04-08dont make lit_to_mir_constant a queryb-naber-53/+56
2022-04-07interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internalRalf Jung-1/+1
2022-04-06get rid of visit_constant in thir visitorb-naber-4/+2
2022-04-05span: move `MultiSpan`David Wood-2/+2
`MultiSpan` contains labels, which are more complicated with the introduction of diagnostic translation and will use types from `rustc_errors` - however, `rustc_errors` depends on `rustc_span` so `rustc_span` cannot use types like `DiagnosticMessage` without dependency cycles. Introduce a new `rustc_error_messages` crate that can contain `DiagnosticMessage` and `MultiSpan`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-02rebase and remove dead codeb-naber-25/+2
2022-04-02try to evaluate in from_opt_const_arg_anon_constb-naber-2/+5
2022-04-02rebase and use ty::Const in patterns againb-naber-62/+55
2022-04-02do use ty::Const in patterns and abstract constsb-naber-96/+79
2022-04-02change thir to use mir::ConstantKind instead of ty::Constb-naber-76/+129
2022-03-31obligation cause: `RepeatVec` -> `RepeatValueCopy`lcnr-1/+1
2022-03-31Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errorsDylan DPC-8/+8
Spellchecking compiler comments This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30Auto merge of #95436 - cjgillot:static-mut, r=oli-obkbors-5/+5
Remember mutability in `DefKind::Static`. This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-30Addressed comments by @compiler-errors and @bjorn3Yuri Astrakhan-3/+3
2022-03-30Spellchecking compiler commentsYuri Astrakhan-9/+9
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30Auto merge of #95466 - Dylan-DPC:rollup-g7ddr8y, r=Dylan-DPCbors-1/+1
Rollup of 5 pull requests Successful merges: - #95294 (Document Linux kernel handoff in std::io::copy and std::fs::copy) - #95443 (Clarify how `src/tools/x` searches for python) - #95452 (fix since field version for termination stabilization) - #95460 (Spellchecking compiler code) - #95461 (Spellchecking some comments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-30Spellchecking some commentsYuri Astrakhan-1/+1
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-5/+5
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-2/+4
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-24Check if call return type is visibly uninhabited when building MIRTomasz Miąsko-5/+13
2022-03-23dont use a query for lit_to_constantb-naber-13/+8
2022-03-23use NonHirLiteral instead of ScalarLiteral, move pattern related code to ↵b-naber-9/+8
pat_is_poly in IsThirPolymorphic
2022-03-23use ParamConst in ExprKind::ConstParamb-naber-11/+7
2022-03-23remove thir::Visitor::visit_constb-naber-14/+3
2022-03-23change thir to lazily create constantsb-naber-117/+200
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-1/+1
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-16rustc_error: make ErrorReported impossible to constructmark-21/+42
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-1/+1
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-16Extend the irrefutable_let_patterns lint to let chainsest31-35/+180
Only look for complete suffixes or prefixes of irrefutable let patterns, so that an irrefutable let pattern in a chain surrounded by refutable ones is not linted, as it is an useful pattern.
2022-03-15fix typosDylan DPC-1/+1
2022-03-12Fix rebase conflicts with stderr filesDevin Ragotzy-1/+1
2022-03-12Only filter doc(hidden) fields/variants when not crate localDevin Ragotzy-3/+3
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-55/+53
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-03-10Auto merge of #94059 - b-naber:constantkind-val-transformation, r=lcnrbors-8/+11
Treat constant values as mir::ConstantKind::Val Another step that is necessary for the introduction of Valtrees: we don't want to treat `ty::Const` instances of kind `ty::ConstKind::Value` as `mir::ConstantKind::Ty` anymore. r? `@oli-obk`
2022-03-09Rollup merge of #94739 - estebank:suggest-let-else, r=oli-obkMatthias Krüger-7/+79
Suggest `if let`/`let_else` for refutable pat in `let` r? `````@oli-obk`````
2022-03-09treat all mir::Constant values as ConstantKind::Valb-naber-8/+11
2022-03-08Auto merge of #94702 - b-naber:static-refs-mir, r=lcnrbors-12/+9
Reinstate #93800 https://github.com/rust-lang/rust/pull/93800 caused a regression in an alt builder with parallel enabled. https://github.com/rust-lang/rust/pull/94205 reverted that PR because of the regression. For an unknown reason the regression has disappeared, so we reinstate the changes in https://github.com/rust-lang/rust/pull/93800 here. r? `@Mark-Simulacrum`
2022-03-08Do not suggest `let_else` if no bindings would be introducedEsteban Kuber-1/+1
2022-03-08Suggest `if let`/`let_else` for refutable pat in `let`Esteban Kuber-7/+79
2022-03-08treat literals in ExprKind::StaticRef as mir::ConstantKind::Valb-naber-12/+9
2022-03-08Change wording of suggestion to add missing `match` armEsteban Kuber-5/+24
2022-03-08Point at uncovered variants in enum definition in `note` instead of a ↵Esteban Kuber-7/+19
`span_label` This makes the order of the output always consistent: 1. Place of the `match` missing arms 2. The `enum` definition span 3. The structured suggestion to add a fallthrough arm
2022-03-08When finding a match expr with multiple arms that requires more, suggest itEsteban Kuber-0/+15
Given ```rust match Some(42) { Some(0) => {} Some(1) => {} } ``` suggest ```rust match Some(42) { Some(0) => {} Some(1) => {} None | Some(_) => todo!(), } ```
2022-03-08When finding a match expr with a single arm that requires more, suggest itEsteban Kuber-0/+15
Given ```rust match Some(42) { Some(0) => {} } ``` suggest ```rust match Some(42) { Some(0) => {} None | Some(_) => todo!(), } ```
2022-03-08When encountering a match expr with no arms, suggest itEsteban Kuber-12/+54
Given ```rust match Some(42) {} ``` suggest ```rust match Some(42) { None | Some(_) => todo!(), } ```
2022-03-02rename ErrorReported -> ErrorGuaranteedmark-4/+4