summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2021-03-23On stable, probe-stack=call everywhere again, for now.Felix S. Klock II-31/+64
To buy time on issue 83139, revert effect of PR 77885: We will not conditionally enable probe-stack=inline-asm on LLVM 11+ anymore on any of our targets that opted into doing so on PR #77885 (and were subsequently configured to do so in a fine grained manner on PR #80838). After we resolve 83139 (potentially by backporting a fix to LLVM, or potentially by deciding that one cannot rely on the quality of our DWARF output in the manner described in issue 83139), we can change this back. (Update: fixed formatting issue.)
2021-03-15Revert PR 81473 to resolve (on beta) issues 81626 and 81658.Felix S. Klock II-15/+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-03-10Substitute erased lifetimes on bad placeholder typeEsteban Küber-0/+12
Fix #82455. (cherry picked from commit 5ad60888275852136adea38aebc7fcce69b52474)
2021-03-10Fix popping singleton paths in when generating E0433Ömer Sinan Ağacan-6/+5
Fixes #82156 (cherry picked from commit 9889e44470cbc6ae3c8e2fcfb6016ed15ed8cf51)
2021-03-10rustdoc: treat edition 2021 as unstableEric Huss-1/+1
(cherry picked from commit ee0e841a2e949cba1dcf3a2fb04e9a673681e4fd)
2021-02-13parser: Fix panic in 'const impl' recoveryÖmer Sinan Ağacan-2/+12
The panic happens when in recovery parsing a full `impl` (`parse_item_impl`) fails and we drop the `DiagnosticBuilder` for the recovery suggestion and return the `parse_item_impl` error. We now raise the original error "expected identifier found `impl`" when parsing the `impl` fails. Note that the regression test is slightly simplified version of the original repro in #81806, to make the error output smaller and more resilient to unrelated changes in parser error messages. Fixes #81806
2021-02-06Auto merge of #81810 - m-ou-se:rollup-q3nborp, r=m-ou-sebors-60/+32
Rollup of 7 pull requests Successful merges: - #80011 (Stabilize `peekable_next_if`) - #81580 (Document how `MaybeUninit<Struct>` can be initialized.) - #81610 (BTreeMap: make Ord bound explicit, compile-test its absence) - #81664 (Avoid a hir access inside get_static) - #81675 (Make rustdoc respect `--error-format short` in doctests) - #81753 (Never MIR inline functions with a different instruction set) - #81795 (Small refactor with Iterator::reduce) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-06Rollup merge of #81795 - camsteffen:diagnostics-reduce, r=oli-obkMara Bos-3/+2
Small refactor with Iterator::reduce
2021-02-06Rollup merge of #81753 - tmiasko:inline-instruction-set, r=oli-obkMara Bos-1/+6
Never MIR inline functions with a different instruction set
2021-02-06Rollup merge of #81664 - bjorn3:no_codegen_hir, r=lcnrMara Bos-56/+24
Avoid a hir access inside get_static Together with #81056 this ensures that the codegen unit DepNode doesn't have a direct dependency on any part of the hir.
2021-02-05Auto merge of #79253 - rcvalle:fix-rustc-sysroot-cas, r=nagisabors-7/+45
Fix rustc sysroot in systems using CAS Change filesearch::get_or_default_sysroot() to check if sysroot is found using env::args().next() if rustc in argv[0] is a symlink; otherwise, or if it is not found, use env::current_exe() to imply sysroot. This makes the rustc binary able to locate Rust libraries in systems using content-addressable storage (CAS).
2021-02-05Auto merge of #81215 - cjgillot:defkey-mir, r=oli-obkbors-215/+103
Encode MIR metadata by iterating on DefId instead of traversing the HIR tree Split out of https://github.com/rust-lang/rust/pull/80347. This part only traverses `mir_keys` and encodes MIR according to the def kind. r? `@oli-obk`
2021-02-05Small refactor with Iterator::reduceCameron Steffen-3/+2
2021-02-05Auto merge of #81257 - ↵bors-295/+158
pnkfelix:issue-80949-short-term-resolution-via-revert-of-pr-78373, r=matthewjasper Revert 78373 ("dont leak return value after panic in drop") Short term resolution for issue #80949. Reopen #47949 after this lands. (We plan to fine-tune PR #78373 to not run into this problem.)
2021-02-05Auto merge of #81784 - m-ou-se:rollup-s23fow7, r=m-ou-sebors-187/+416
Rollup of 15 pull requests Successful merges: - #79554 (Generic associated types in trait paths) - #80726 (relax adt unsizing requirements) - #81307 (Handle `Span`s for byte and raw strings and add more detail ) - #81318 (rustdoc-json: Fix has_body) - #81456 (Make remote-test-server easier to use with new targets) - #81497 (rustdoc: Move `display_fn` struct inside `display_fn`) - #81500 (Remove struct_type from union output) - #81542 (Expose correct symlink API on WASI) - #81676 (Add more information to the error code for 'crate not found') - #81682 (Add additional bitset benchmarks) - #81730 (Make `Allocator` object-safe) - #81763 (Cleanup rustdoc pass descriptions a bit) - #81767 (Update LayoutError/LayoutErr stability attributes) - #81771 (Indicate change in RSS from start to end of pass in time-passes output) - #81781 (Fix `install-awscli.sh` error in CI) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-05Run x.py fmt to fix tidy issuesWesley Wiser-22/+19
2021-02-05Rollup merge of #81771 - tgnottingham:time-passes-rss-delta, r=oli-obkMara Bos-14/+11
Indicate change in RSS from start to end of pass in time-passes output Previously, this was omitted because it could be misleading, but the functionality seems too useful not to include. r? ``@oli-obk``
2021-02-05Rollup merge of #81682 - JulianKnodt:bit_set_iter_benchmarks, r=oli-obkMara Bos-0/+34
Add additional bitset benchmarks Add additional benchmarks for operations in bitset, I realize that it was a bit lacking when I intended to optimize it earlier, so I was hoping to put some in so I can verify my work later.
2021-02-05Rollup merge of #81676 - jyn514:crate-not-found, r=oli-obkMara Bos-0/+21
Add more information to the error code for 'crate not found' This comes up a lot when bootstrapping.
2021-02-05Rollup merge of #81307 - estebank:invalid-byte-str-span, r=petrochenkovMara Bos-80/+136
Handle `Span`s for byte and raw strings and add more detail CC #81208.
2021-02-05Rollup merge of #80726 - lcnr:unsize-query, r=oli-obkMara Bos-18/+60
relax adt unsizing requirements Changes unsizing of structs in case the last struct field shares generic params with other adt fields which do not change. This change is currently insta stable and changes the language, so it at least requires a lang fcp. I feel like the current state is fairly unintuitive. An example for what's now allowed would be https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6dd331d23f5c9ffc8c978175aae2e967 ```rust struct A<T, U: ?Sized>(T, B<T, U>); // previously ERR // struct A<T, U: ?Sized>(T, B<[u32; 1], U>); // ok struct B<T, U: ?Sized>(T, U); fn main() { let x = A([0; 1], B([0; 1], [0; 1])); let y: &A<[u32; 1], [u32]> = &x; assert_eq!(y.1.1.len(), 1); } ```
2021-02-05Rollup merge of #79554 - b-naber:generic-associated-types-in-trait-paths, ↵Mara Bos-75/+154
r=jackh726 Generic associated types in trait paths This is the second part of https://github.com/rust-lang/rust/pull/78978 This should fix: Fixes #67510 Fixes #68648 Fixes #68649 Fixes #68650 Fixes #68652 Fixes #74684 Fixes #76535 Fixes #79422 Fixes #80433 and implement the remaining functionality needed for https://github.com/rust-lang/rust/issues/44265 r? ``@matthewjasper``
2021-02-05Auto merge of #81736 - tgnottingham:tune-cgu-scheduling-for-memory, r=nagisabors-7/+20
rustc_codegen_ssa: tune codegen scheduling to reduce memory usage For better throughput during parallel processing by LLVM, we used to sort CGUs largest to smallest. This would lead to better thread utilization by, for example, preventing a large CGU from being processed last and having only one LLVM thread working while the rest remained idle. However, this strategy would lead to high memory usage, as it meant the LLVM-IR for all of the largest CGUs would be resident in memory at once. Instead, we can compromise by ordering CGUs such that the largest and smallest are first, second largest and smallest are next, etc. If there are large size variations, this can reduce memory usage significantly.
2021-02-05Indicate change in RSS from start to end of pass in time-passes outputTyson Nottingham-14/+11
Previously, this was omitted because it could be misleading, but the functionality seems too useful not to include.
2021-02-04Revert "Simplify unscheduling of drops after moves"Felix S. Klock II-13/+25
This reverts commit b766abc88f78f36193ddefb1079dbc832346b358.
2021-02-04Revert "Use `record_operands_moved` more aggresively"Felix S. Klock II-15/+3
This reverts commit 7f3e8551dde7f14641618cdb8fda2f99ff1d74b6.
2021-02-04Revert "Avoid leaking block expression values"Felix S. Klock II-284/+150
This reverts commit 4fef39113a514bb270f5661a82fdba17d3e41dbb.
2021-02-05Never MIR inline functions with a different instruction setTomasz Miąsko-1/+6
2021-02-04remove subst_supertrait callb-naber-3/+1
2021-02-04use generic arguments of associated item in trait_ref methodb-naber-1/+9
2021-02-04Rollup merge of #81727 - m-ou-se:unstabilize-bits, r=Mark-SimulacrumMara Bos-0/+3
Revert stabilizing integer::BITS. We agreed in the libs meeting just now to revert stablization, since the [breakage](https://github.com/rust-lang/rust/issues/81654) is significant throughout the ecosystem, through `lexical-core`. cc https://github.com/rust-lang/rust/issues/76904 Fixes https://github.com/rust-lang/rust/issues/81654
2021-02-04Rollup merge of #81645 - m-ou-se:panic-lint, r=estebank,flip1995Mara Bos-163/+205
Add lint for `panic!(123)` which is not accepted in Rust 2021. This extends the `panic_fmt` lint to warn for all cases where the first argument cannot be interpreted as a format string, as will happen in Rust 2021. It suggests to add `"{}",` to format the message as a string. In the case of `std::panic!()`, it also suggests the recently stabilized `std::panic::panic_any()` function as an alternative. It renames the lint to `non_fmt_panic` to match the lint naming guidelines. ![image](https://user-images.githubusercontent.com/783247/106520928-675ea680-64d5-11eb-81f7-d8fa48b93a0b.png) This is part of #80162. r? ```@estebank```
2021-02-04Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelixMara Bos-30/+137
introduce future-compatibility warning for forbidden lint groups We used to ignore `forbid(group)` scenarios completely. This changed in #78864, but that led to a number of regressions (#80988, #81218). This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect. r? ``@Mark-Simulacrum``
2021-02-04Encode less consts.Camille GILLOT-7/+16
2021-02-04substitutions in trait predicatesb-naber-62/+104
2021-02-04lowering of generic args in AssocTyConstraintb-naber-9/+37
2021-02-04hir pretty printingb-naber-0/+1
2021-02-04add generic args to hir::TypeBindingb-naber-0/+2
2021-02-04Stabilize feature(iterator_fold_self): Iterator::reduceMara Bos-2/+0
2021-02-04Rename Iterator::fold_first to reduce.Mara Bos-1/+1
2021-02-04Use is_local instead of as_localbjorn3-2/+2
2021-02-03rustc_codegen_ssa: tune codegen scheduling to reduce memory usageTyson Nottingham-7/+20
For better throughput during parallel processing by LLVM, we used to sort CGUs largest to smallest. This would lead to better thread utilization by, for example, preventing a large CGU from being processed last and having only one LLVM thread working while the rest remained idle. However, this strategy would lead to high memory usage, as it meant the LLVM-IR for all of the largest CGUs would be resident in memory at once. Instead, we can compromise by ordering CGUs such that the largest and smallest are first, second largest and smallest are next, etc. If there are large size variations, this can reduce memory usage significantly.
2021-02-04add `relaxed_struct_unsize` feature gateBastian Kauschke-15/+48
2021-02-04relax adt unsizing requirementsBastian Kauschke-8/+17
2021-02-03Make panic/assert calls in rustc compatible with Rust 2021.Mara Bos-5/+5
2021-02-03Add lint for `panic!(123)` which is not accepted in Rust 2021.Mara Bos-158/+200
This extends the `panic_fmt` lint to warn for all cases where the first argument cannot be interpreted as a format string, as will happen in Rust 2021. It suggests to add `"{}", ` to format the message as a string. In the case of `std::panic!()`, it also suggests the recently stabilized `std::panic::panic_any()` function as an alternative. It renames the lint to `non_fmt_panic` to match the lint naming guidelines.
2021-02-03Handle `Span`s for byte and raw strings and add more detailEsteban Küber-80/+136
2021-02-03Revert stabilizing integer::BITS.Mara Bos-0/+3
2021-02-03Auto merge of #81717 - Aaron1011:fix/closure-diag, r=estebankbors-2/+2
Fix panic when emitting diagnostic for closure mutable binding error Fixes #81700 The upvar borrow kind may be `ty::BorrowKind::UniqueImmBorrow`, which is still a mutable borrow for the purposes of this diagnostic code.
2021-02-03Auto merge of #81718 - m-ou-se:rollup-3ftbymt, r=m-ou-sebors-4/+7
Rollup of 5 pull requests Successful merges: - #80394 (make const_err a future incompat lint) - #81532 (Remove incorrect `delay_span_bug`) - #81692 (Update clippy) - #81715 (Reduce tab formatting assertions to debug only) - #81716 (Fix non-existent-field ICE for generic fields.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup