about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-12-05Auto merge of #91555 - matthiaskrgr:rollup-pq0iaq7, r=matthiaskrgrbors-141/+190
Rollup of 4 pull requests Successful merges: - #90529 (Skip reborrows in AbstractConstBuilder) - #91437 (Pretty print empty blocks as {}) - #91450 (Don't suggest types whose inner type is erroneous) - #91535 (Stabilize `-Z emit-future-incompat` as `--json future-incompat`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-05Rollup merge of #91535 - Aaron1011:stabilize-future-incompat, r=nagisaMatthias Krüger-2/+3
Stabilize `-Z emit-future-incompat` as `--json future-incompat` The FCP was completed in https://github.com/rust-lang/rust/issues/71249
2021-12-05Rollup merge of #91450 - hkmatsumoto:hide-type-error, r=estebankMatthias Krüger-0/+28
Don't suggest types whose inner type is erroneous Currently, we check if the returned type equals to `tcx.ty_error()` not to emit erroneous types, but this has a pitfall; for example, `Option<[type error]> != tcx.ty_error()` holds. Fixes #91371.
2021-12-05Rollup merge of #91437 - dtolnay:emptybrace, r=nagisaMatthias Krüger-138/+136
Pretty print empty blocks as {} **Example:** ```rust macro_rules! p { ($e:expr) => { println!("{}", stringify!($e)); }; ($i:item) => { println!("{}", stringify!($i)); }; } fn main() { p!(if true {}); p!(struct S {}); } ``` **Before:** ```console if true { } struct S { } ``` **After:** ```console if true {} struct S {} ``` This affects [`dbg!`](https://doc.rust-lang.org/std/macro.dbg.html), as well as ecosystem uses of stringify such as in [`anyhow::ensure!`](https://docs.rs/anyhow/1/anyhow/macro.ensure.html). Printing a `{ }` in today's heavily rustfmt'd world comes out looking jarring/sloppy.
2021-12-05Rollup merge of #90529 - b-naber:reborrows-consts, r=lcnrMatthias Krüger-1/+23
Skip reborrows in AbstractConstBuilder Fixes https://github.com/rust-lang/rust/issues/90455 Temporary fix to prevent confusing diagnostics that refer to implicit borrows and derefs until we allow borrows and derefs on constant expressions. r? `@oli-obk`
2021-12-05Auto merge of #88611 - m-ou-se:array-into-iter-new-deprecate, r=joshtriplettbors-4/+4
Deprecate array::IntoIter::new.
2021-12-05bless testsb-naber-1/+1
2021-12-05add testb-naber-0/+22
2021-12-05Auto merge of #91510 - camelid:two-cleanups, r=GuillaumeGomezbors-33/+14
rustdoc: Cleanup two things in `clean::types` Explanations are in the individual commits.
2021-12-05Auto merge of #91229 - Aaron1011:dist-lld, r=Mark-Simulacrumbors-0/+7
Include `lld` in `rust-dev` package Fixes #88941 This will allow using `download-ci-llvm` while still having LLD available.
2021-12-05Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obkbors-1/+1
Add a MIR pass manager (Taylor's Version) The final draft of #91386 and #77665. While the compile-time constraints in #91386 are cool, I decided on a more minimal approach for now. I want to explore phase constraints and maybe relative-ordering constraints in the future, though. This should preserve existing behavior **exactly** (please let me know if it doesn't) while making the following changes to the way we organize things today: - Each `MirPhase` now corresponds to a single MIR pass. `run_passes` is not responsible for listing the correct MIR phase. - `run_passes` no longer silently skips passes if the declared MIR phase is greater than or equal to the body's. This has bitten me multiple times. If you want this behavior, you can always branch on `body.phase` yourself. - If your pass is solely to emit errors, you can use the `MirLint` interface instead, which gets a shared reference to `Body` instead of a mutable one. By differentiating the two, I hope to make it clearer in the short term where lints belong in the pipeline. In the long term perhaps we could enforce this at compile-time? - MIR is no longer dumped for passes that aren't enabled, or for lints. I tried to check that `-Zvalidate` still works correctly, since the MIR phase is now updated as soon as the associated pass is done, instead of at the end of all the passes in `run_passes`. However, it looks like `-Zvalidate` is broken with current nightlies anyways :cry: (it spits out a bunch of errors). cc `@oli-obk` `@wesleywiser` r? rust-lang/wg-mir-opt
2021-12-05Rollup merge of #91528 - piegamesde:master, r=cuviperMatthias Krüger-0/+0
LLVM support .insn directive Closes #90558. See also https://github.com/rust-lang/llvm-project/pull/121.
2021-12-05Rollup merge of #91355 - alexcrichton:stabilize-thread-local-const, r=m-ou-seMatthias Krüger-19/+0
std: Stabilize the `thread_local_const_init` feature This commit is intended to follow the stabilization disposition of the FCP that has now finished in #84223. This stabilizes the ability to flag thread local initializers as `const` expressions which enables the macro to generate more efficient code for accessing it, notably removing runtime checks for initialization. More information can also be found in #84223 as well as the tests where the feature usage was removed in this PR. Closes #84223
2021-12-05Rollup merge of #90023 - b-naber:postpone_const_eval_infer_vars, r=nikomatsakisMatthias Krüger-3/+239
Postpone the evaluation of constant expressions that depend on inference variables Previously `delay_span_bug` calls were triggered once an inference variable was included in the substs of a constant that was to be evaluated. Some of these would merely have resulted in trait candidates being rejected, hence no real error was ever encountered, but the triggering of the `delay_span_bug` then caused an ICE in later stages of the compiler due to no error ever occurring. We now postpone the evaluation of these constants, so any trait obligation fulfillment will simply stall on this constant and the existing type inference machinery of the compiler handles any type errors if present. Fixes https://github.com/rust-lang/rust/issues/89320 Fixes https://github.com/rust-lang/rust/issues/89146 Fixes https://github.com/rust-lang/rust/issues/87964 Fixes https://github.com/rust-lang/rust/issues/87470 Fixes https://github.com/rust-lang/rust/issues/83288 Fixes https://github.com/rust-lang/rust/issues/83249 Fixes https://github.com/rust-lang/rust/issues/90654 I want to thank `@BoxyUwU` for cooperating on this and for providing some help. r? `@lcnr` maybe?
2021-12-05Rollup merge of #90022 - hkmatsumoto:self-upper-as-generic-parameter, r=jackh726Matthias Krüger-13/+22
Explain why `Self` is invalid in generic parameters Close #89985. r? `@estebank`
2021-12-04Include `lld` in `rust-dev` packageAaron Hill-0/+7
Fixes #88941 This will allow using `download-ci-llvm` while still having LLD available.
2021-12-04Stabilize `-Z emit-future-incompat` as `--json future-incompat`Aaron Hill-2/+3
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-4/+4
2021-12-04LLVM support .insn directivepiegames-0/+0
2021-12-04Don't suggest types whose inner type is erroneousHirochika Matsumoto-0/+28
Currently, we check if the returned type equals to `tcx.ty_error()` not to emit erroneous types, but this has a pitfall; for example, `Option<[type error]> != tcx.ty_error()` holds.
2021-12-04Rollup merge of #90519 - estebank:issue-84003, r=petrochenkovMatthias Krüger-16/+287
Keep spans for generics in `#[derive(_)]` desugaring Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-04Rollup merge of #89701 - tom7980:issue-89566-fix, r=petrochenkovMatthias Krüger-7/+183
Updated error message for accidental uses of derive attribute as a crate attribute This partially fixes the original issue #89566 by adding derive to the list of invalid crate attributes and then providing an updated error message however I'm not sure how to prevent the resolution error message from emitting without causing the compiler to just abort when it finds an invalid crate attribute (which I'd prefer not to do so we can find and emit other errors). `@petrochenkov` I have been told you may have some insight on why it's emitting the resolution error though honestly I'm not sure if we need to worry about fixing it as long as we can provide the invalid crate attribute error also (which happens first anyway)
2021-12-04Auto merge of #88439 - cynecx:unwind_asm, r=Amanieubors-50/+179
Unwinding support for inline assembly r? `@Amanieu`
2021-12-03Remove single-use `GenericParamDef::get_type` functionNoah Lev-28/+13
Rationale: * The name was confusing. * It was only used in one place. * That place didn't actually need all the functionality of `get_type`; rather, removing `get_type` makes that code clearer.
2021-12-03rustdoc: Remove single-use `Lifetime::get_ref()` functionNoah Lev-5/+1
2021-12-04Auto merge of #91505 - matthiaskrgr:rollup-orxgsxo, r=matthiaskrgrbors-36/+136
Rollup of 7 pull requests Successful merges: - #90538 (Document how recursion is handled for `ty::Ty`) - #90851 (Add unchecked downcast methods) - #91209 (Implement ``@snapshot`` check for htmldocck) - #91385 (Suggest the `pat_param` specifier before `|` on 2021 edition ) - #91478 (Remove incorrect newline from float cast suggestion) - #91481 (Use let_else in some more places in rustc_lint) - #91488 (Fix ICE when `yield`ing in function returning `impl Trait`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-04Rollup merge of #91488 - compiler-errors:issue-91477, r=estebankMatthias Krüger-0/+16
Fix ICE when `yield`ing in function returning `impl Trait` Change an assert to a `delay_span_bug` and remove an unwrap, that should fix it. Fixes #91477
2021-12-04Rollup merge of #91478 - estebank:fix-newline-in-cast-suggestion, r=camelidMatthias Krüger-10/+10
Remove incorrect newline from float cast suggestion
2021-12-04Rollup merge of #91385 - ecstatic-morse:pat-param-spec-suggest, r=estebankMatthias Krüger-6/+18
Suggest the `pat_param` specifier before `|` on 2021 edition Ran into this today after writing some Rust for the first time in a while. r? `@estebank`
2021-12-04Rollup merge of #91209 - camelid:snapshot, r=jyn514Matthias Krüger-20/+92
Implement `@snapshot` check for htmldocck This form of check allows performing snapshot tests (à la `src/test/ui`) on rustdoc HTML output, making it easier to create and update tests. See [this Zulip thread][1] for more information about the motivation for this change. [1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142 r? `@GuillaumeGomez`
2021-12-03Auto merge of #91501 - camelid:rm-tuple-impls-2, r=GuillaumeGomezbors-414/+428
rustdoc: Remove Clean impls for tuples This PR removes all nine Clean impls on tuples, converting them to functions instead. The fact that these are impls causes several problems: 1. They are nameless, so it's unclear what they do. 2. It's hard to find where they're used apart from removing them and seeing what errors occur (this applies to all Clean impls, not just the tuple ones). 3. Rustc doesn't currently warn when impls are unused, so dead code can accumulate easily (all Clean impls). 4. Their bodies often use tuple field indexing syntax (e.g., `self.1`) to refer to their "arguments", which makes reading the code more difficult. As I noted, some of these problems apply to all Clean impls, but even those problems are exacerbated by the tuple impls since they make general understanding of the code harder. Converting the impls to functions solves all four of these problems. r? `@GuillaumeGomez`
2021-12-03limit may_unwind codegen test to x86_64cynecx-0/+1
2021-12-03fix feature-gate test for may_unwindcynecx-1/+3
2021-12-03fix inline asm test by not hardcoding symbol namescynecx-6/+18
2021-12-03fix inline asm test because of missing attributecynecx-1/+1
2021-12-03add clobber_abi("C") to may_unwind inline-asm testscynecx-2/+2
2021-12-03add tests for asm's options(may_unwind)cynecx-0/+95
2021-12-03add `unwind_asm` feature gate for `may_unwind` optioncynecx-0/+20
2021-12-03Update unstable-book with recent asm changes (`may_unwind`)cynecx-1/+2
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-49/+47
2021-12-03Remove a Clean impl for a tuple (9)Noah Lev-43/+48
This was the last one!
2021-12-03Remove a Clean impl for a tuple (8)Noah Lev-86/+89
2021-12-03Remove a Clean impl for a tuple (7)Noah Lev-26/+28
2021-12-03Remove a Clean impl for a tuple (6)Noah Lev-16/+17
2021-12-03Remove a Clean impl for a tuple (5)Noah Lev-19/+20
2021-12-03Remove a Clean impl for a tuple (4)Noah Lev-14/+17
2021-12-03Clean up definition of `clean_ty_generics` a bitNoah Lev-5/+3
2021-12-03Remove a Clean impl for a tuple (3)Noah Lev-165/+172
2021-12-03Remove a Clean impl for a tuple (2)Noah Lev-27/+28
2021-12-03Remove a Clean impl for a tuple (1)Noah Lev-25/+18
This commit removes the first of nine Clean impls on tuples, converting it to a function instead. The fact that these are impls causes several problems: 1. They are nameless, so it's unclear what they do. 2. It's hard to find where they're used apart from removing them and seeing what errors occur (this applies to all Clean impls, not just the tuple ones). 3. Rustc doesn't currently warn when impls are unused, so dead code can accumulate easily (all Clean impls). 4. Their bodies often use tuple field indexing syntax (e.g., `self.1`) to refer to their "arguments", which makes reading the code more difficult. As I noted, some of these problems apply to all Clean impls, but even those problems are exacerbated by the tuple impls since they make general understanding of the code harder. Converting the impls to functions solves all four of these problems.