- 08 3月, 2022 1 次提交
-
-
由 b-naber 提交于
-
- 02 3月, 2022 1 次提交
-
-
由 mark 提交于
-
- 25 2月, 2022 1 次提交
-
-
由 Aaron Hill 提交于
These links never worked, but the lint was suppressed due to the fact that the span was pointing into the macro. With the new macro implementation, the span now points directly to the doc comment in the macro invocation, so it's no longer suppressed.
-
- 21 2月, 2022 2 次提交
-
-
由 Mark Rousskov 提交于
This reverts commit a240ccd8, reversing changes made to 393fdc10. This PR was likely responsible for a relatively large regression in dist-x86_64-msvc-alt builder times, from approximately 1.7 to 2.8 hours, bringing that builder into the pool of the slowest builders we currently have. This seems to be limited to the alt builder due to needing parallel-compiler enabled, likely leading to slow LLVM compilation for some reason.
-
由 Mark Rousskov 提交于
This avoids monomorphizing for different parameters, decreasing generic code instantiated downstream from rustc_middle.
-
- 18 2月, 2022 2 次提交
-
-
由 Mizobrook-kan 提交于
-
由 Mizobrook-kan 提交于
-
- 16 2月, 2022 1 次提交
-
-
由 b-naber 提交于
-
- 15 2月, 2022 3 次提交
-
-
由 Deadbeef 提交于
-
由 Nicholas Nethercote 提交于
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
-
由 Nicholas Nethercote 提交于
Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
-
- 12 2月, 2022 1 次提交
-
-
由 Michael Goulet 提交于
-
- 02 2月, 2022 1 次提交
-
-
由 Frank Steffahn 提交于
-
- 22 1月, 2022 1 次提交
-
-
由 Nicholas Nethercote 提交于
`Decoder` has two impls: - opaque: this impl is already partly infallible, i.e. in some places it currently panics on failure (e.g. if the input is too short, or on a bad `Result` discriminant), and in some places it returns an error (e.g. on a bad `Option` discriminant). The number of places where either happens is surprisingly small, just because the binary representation has very little redundancy and a lot of input reading can occur even on malformed data. - json: this impl is fully fallible, but it's only used (a) for the `.rlink` file production, and there's a `FIXME` comment suggesting it should change to a binary format, and (b) in a few tests in non-fundamental ways. Indeed #85993 is open to remove it entirely. And the top-level places in the compiler that call into decoding just abort on error anyway. So the fallibility is providing little value, and getting rid of it leads to some non-trivial performance improvements. Much of this commit is pretty boring and mechanical. Some notes about a few interesting parts: - The commit removes `Decoder::{Error,error}`. - `InternIteratorElement::intern_with`: the impl for `T` now has the same optimization for small counts that the impl for `Result<T, E>` has, because it's now much hotter. - Decodable impls for SmallVec, LinkedList, VecDeque now all use `collect`, which is nice; the one for `Vec` uses unsafe code, because that gave better perf on some benchmarks.
-
- 19 1月, 2022 1 次提交
-
-
由 pierwill 提交于
Removes `Ord` and `PartialOrd` from middle::mir::mirsource, inlineasmoperand, terminatorkind, operand, constant, constantkind, and place
-
- 16 1月, 2022 1 次提交
-
-
由 Camille GILLOT 提交于
-
- 15 1月, 2022 1 次提交
-
-
由 Ellen 提交于
-
- 13 1月, 2022 1 次提交
-
-
由 Tomasz Miąsko 提交于
-
- 11 1月, 2022 1 次提交
-
-
由 Aaron Hill 提交于
The field is also renamed from `ident` to `name. In most cases, we don't actually need the `Span`. A new `ident` method is added to `VariantDef` and `FieldDef`, which constructs the full `Ident` using `tcx.def_ident_span()`. This method is used in the cases where we actually need an `Ident`. This makes incremental compilation properly track changes to the `Span`, without all of the invalidations caused by storing a `Span` directly via an `Ident`.
-
- 02 1月, 2022 1 次提交
-
-
由 Josh Triplett 提交于
Continue supporting -Z instrument-coverage for compatibility for now, but show a deprecation warning for it. Update uses and documentation to use the -C option. Move the documentation from the unstable book to stable rustc documentation.
-
- 23 12月, 2021 1 次提交
-
-
由 Aaron Hill 提交于
The `AggregateKind` enum ends up in the final mir `Body`. Currently, any changes to `AdtDef` (regardless of how significant they are) will legitimately cause the overall result of `optimized_mir` to change, invalidating any codegen re-use involving that mir. This will get worse once we start hashing the `Span` inside `FieldDef` (which is itself contained in `AdtDef`). To try to reduce these kinds of invalidations, this commit changes `AggregateKind::Adt` to store just the `DefId`, instead of the full `AdtDef`. This allows the result of `optimized_mir` to be unchanged if the `AdtDef` changes in a way that doesn't actually affect any of the MIR we build.
-
- 16 12月, 2021 1 次提交
-
-
由 Aaron Hill 提交于
See #91867 This was mostly straightforward. In several places, I take advantage of the fact that lifetimes are non-hygenic: a macro declares the 'tcx' lifetime, which is then used in types passed in as macro arguments.
-
- 15 12月, 2021 2 次提交
-
-
由 Nicholas Nethercote 提交于
-
由 Nicholas Nethercote 提交于
-
- 11 12月, 2021 1 次提交
-
-
由 Noah Lev 提交于
In Rust, nesting method calls with both require `&mut` access to `self` produces a borrow-check error: error[E0499]: cannot borrow `*self` as mutable more than once at a time --> src/lib.rs:7:14 | 7 | self.foo(self.bar()); | ---------^^^^^^^^^^- | | | | | | | second mutable borrow occurs here | | first borrow later used by call | first mutable borrow occurs here That's because Rust has a left-to-right evaluation order, and the method receiver is passed first. Thus, the argument to the method cannot then mutate `self`. There's an easy solution to this error: just extract a local variable for the inner argument: let tmp = self.bar(); self.foo(tmp); However, the error doesn't give any suggestion of how to solve the problem. As a result, new users may assume that it's impossible to express their code correctly and get stuck. This commit adds a (non-structured) suggestion to extract a local variable for the inner argument to solve the error. The suggestion uses heuristics that eliminate most false positives, though there are a few false negatives (cases where the suggestion should be emitted but is not). Those other cases can be implemented in a future change.
-
- 03 12月, 2021 3 次提交
-
-
由 Dylan MacKenzie 提交于
-
由 Alan Egerton 提交于
-
由 Alan Egerton 提交于
-
- 01 12月, 2021 1 次提交
-
-
由 Dylan MacKenzie 提交于
-
- 27 11月, 2021 1 次提交
-
-
由 Scott McMurray 提交于
Hopefully-non-controversial changes from some not-ready-yet work that I'd figured I'd submit on their own.
-
- 26 11月, 2021 1 次提交
-
-
由 LeSeulArtichaut 提交于
Co-authored-by: NAlan Egerton <eggyal@gmail.com>
-
- 24 11月, 2021 1 次提交
-
-
由 Ralf Jung 提交于
-
- 07 11月, 2021 2 次提交
- 21 10月, 2021 1 次提交
-
-
由 Gary Guo 提交于
-
- 03 10月, 2021 1 次提交
-
-
由 Camille GILLOT 提交于
-
- 25 9月, 2021 1 次提交
-
-
由 Gary Guo 提交于
-
- 17 9月, 2021 1 次提交
-
-
由 Aaron Hill 提交于
In some cases, we emit borrowcheck diagnostics pointing at a particular field expression in a struct expression (e.g. `MyStruct { field: my_expr }`). However, this behavior currently relies on us choosing the `ConstraintCategory::Boring` with the 'correct' span. When adding additional variants to `ConstraintCategory`, (or changing existing usages away from `ConstraintCategory::Boring`), the current behavior can easily get broken, since a non-boring constraint will get chosen over a boring one. To make the diagnostic output less fragile, this commit adds a `ConstraintCategory::Usage` variant. We use this variant for the temporary assignments created for each field of an aggregate we are constructing. Using this new variant, we can emit a message mentioning "this usage", emphasizing the fact that the error message is related to the specific use site (in the struct expression). This is preparation for additional work on improving NLL error messages (see #57374)
-
- 13 9月, 2021 1 次提交
-
-
由 Gary Guo 提交于
-
- 09 9月, 2021 1 次提交
-
-
由 Ellen 提交于
-