about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-10-31Update MIR tests for offset_ofGeorge Bateman-74/+48
2023-10-31Enums in offset_of: update based on est31, scottmcm & llogiq reviewGeorge Bateman-140/+150
2023-10-31Support enum variants in offset_of!George Bateman-75/+472
2023-10-31Auto merge of #117462 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 7 commits in 708383d620e183a9ece69b8fe930c411d83dee27..b4d18d4bd3db6d872892f6c87c51a02999b80802 2023-10-27 21:09:26 +0000 to 2023-10-31 18:19:10 +0000 - refactor(toml): Cleanup noticed on the way to rust-lang/cargo#12801 (rust-lang/cargo#12902) - feat(trim-paths): set env `CARGO_TRIM_PATHS` for build scripts (rust-lang/cargo#12900) - feat: implement RFC 3127 `-Ztrim-paths` (rust-lang/cargo#12625) - docs: clarify config to use vendored source is printed to stdout (rust-lang/cargo#12893) - Improve the margin calculation for the search command's UI (rust-lang/cargo#12890) - Add new packages to [workspace.members] automatically (rust-lang/cargo#12779) - refactor(toml): Decouple parsing from interning system (rust-lang/cargo#12881) r? ghost
2023-10-31Update cargoWeihang Lo-0/+0
2023-10-31Auto merge of #117450 - oli-obk:rustdoc_verify, r=estebankbors-127/+428
Accept less invalid Rust in rustdoc pulled out of https://github.com/rust-lang/rust/pull/117213 where this change was already approved This only affects rustdoc, and has up to [20% perf regressions in rustdoc](https://github.com/rust-lang/rust/pull/117213#issuecomment-1785776288). These are unavoidable, as we are simply doing more checks now, but it's part of the longer term plan of making rustdoc more resistant to ICEs by only accepting valid Rust code.
2023-10-31Auto merge of #117407 - compiler-errors:derive-clone, r=oli-obkbors-391/+50
Use derivative for `Clone`/`PartialOrd`/`Ord`/`Hash` in `rustc_type_ir` This uses `derivative` to derive `Clone`/`PartialOrd`/`Ord`/`Hash` for types in `rustc_type_ir`. This doesn't derive `PartialEq`/`Eq` yet, because I have no idea why those are generating slower implementations from derivative.
2023-10-31Accept less invalid Rust in rustdocOli Scherer-127/+428
2023-10-31Use derivative for HashMichael Goulet-168/+11
2023-10-31Use derivative for PartialOrd/ordMichael Goulet-123/+21
2023-10-31Use derivative for CloneMichael Goulet-109/+27
2023-10-31Auto merge of #117444 - matthiaskrgr:rollup-43s0spc, r=matthiaskrgrbors-212/+286
Rollup of 5 pull requests Successful merges: - #116267 (Some codegen cleanups around SIMD checks) - #116712 (When encountering unclosed delimiters during lexing, check for diff markers) - #117416 (Also consider TAIT to be uncomputable if the MIR body is tainted) - #117421 (coverage: Replace impossible `coverage::Error` with assertions) - #117438 (Do not ICE on constant evaluation failure in GVN.) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-31Rollup merge of #117438 - cjgillot:deterministic-error, r=oli-obkMatthias Krüger-5/+30
Do not ICE on constant evaluation failure in GVN. Fixes https://github.com/rust-lang/rust/issues/117362
2023-10-31Rollup merge of #117421 - Zalathar:error, r=oli-obk,SwatinemMatthias Krüger-77/+43
coverage: Replace impossible `coverage::Error` with assertions Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by #115962, so we can now simplify these methods by making them panic immediately when they detect a bug.
2023-10-31Rollup merge of #117416 - compiler-errors:tait-in-bad-body, r=oli-obkMatthias Krüger-3/+42
Also consider TAIT to be uncomputable if the MIR body is tainted Not totally sure if this is the best solution. We could, alternatively, look at the hir typeck results and try to take a type from there instead of just falling back to type error, inferring `u8` instead of `{type error}`. Not certain it really matters, though. Happy to iterate on this. Fixes #117413 r? ``@oli-obk`` cc ``@Nadrieril``
2023-10-31Rollup merge of #116712 - estebank:issue-116252, r=petrochenkovMatthias Krüger-27/+122
When encountering unclosed delimiters during lexing, check for diff markers Fix #116252.
2023-10-31Rollup merge of #116267 - oli-obk:simd_cleanups, r=petrochenkovMatthias Krüger-100/+49
Some codegen cleanups around SIMD checks See https://github.com/rust-lang/rust/pull/115933#discussion_r1337066849 for the reason. This PR essentially just deduplicates code by moving it into a macro
2023-10-31Merge simd size and type extraction into checking whether a type is simd, as ↵Oli Scherer-48/+26
these always go together.
2023-10-31Simplify all `require_simd` invocations by moving all of the shared ↵Oli Scherer-37/+19
invocation arguments into the macro
2023-10-31don't use the moral equivalent of `assert!(false, "foo")`Oli Scherer-33/+22
2023-10-31coverage: Replace impossible `coverage::Error` with assertionsZalathar-67/+33
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by #115962, so we can now simplify these methods by making them panic when they detect a bug.
2023-10-31coverage: Promote some debug-only checks to always runZalathar-12/+12
These checks should be cheap, so there's little reason for them to be debug-only.
2023-10-31Do not ICE on constant evaluation failure in GVN.Camille GILLOT-5/+30
2023-10-31Auto merge of #117377 - dtolnay:deprecatedsince, r=cjgillotbors-196/+166
Store #[deprecated] attribute's `since` value in parsed form This PR implements the first followup bullet listed in https://github.com/rust-lang/rust/pull/117148#issue-1960240108. We centralize error handling to the attribute parsing code in `compiler/rustc_attr/src/builtin.rs`, and thereby remove some awkward error codepaths from later phases of compilation that had to make sense of these #\[deprecated\] attributes, namely `compiler/rustc_passes/src/stability.rs` and `compiler/rustc_middle/src/middle/stability.rs`.
2023-10-31Auto merge of #117419 - compiler-errors:gen, r=oli-obkbors-76/+85
Some more coroutine renamings a few places where `gen_` names leaked through but should be coroutine. r? oli-obk
2023-10-31Auto merge of #117363 - saethlin:cross-crate-inline-when-inline, r=tmiaskobors-2/+7
Enable cross-crate-inlining when MIR inlining is enabled This would make https://github.com/rust-lang/rust/issues/117355 generally less obscure, and also seems like a good idea, even if for some reason someone wants MIR opts but no codegen opts.
2023-10-30Add method for checking if deprecation is a rustc versionDavid Tolnay-9/+7
2023-10-30Descriptive variant name deprecation versions outside the standard libraryDavid Tolnay-6/+8
2023-10-30Some more coroutine renamingsMichael Goulet-76/+85
2023-10-30Represent absence of 'since' attribute as a variant of DeprecatedSinceDavid Tolnay-30/+32
2023-10-30Preserve deprecation attribute even if 'since' version is missingDavid Tolnay-6/+14
2023-10-30Auto merge of #116405 - estebank:issue-103155, r=davidtwcobors-193/+249
Detect object safety errors when assoc type is missing When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
2023-10-30Add a DeprecatedSince::Err variant for versions that fail to parseDavid Tolnay-38/+36
2023-10-30Sort errorsEsteban Küber-13/+15
2023-10-30Add testEsteban Küber-0/+25
2023-10-30Detect object safety errors when assoc type is missingEsteban Küber-194/+223
When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
2023-10-30Auto merge of #117415 - matthiaskrgr:rollup-jr2p1t2, r=matthiaskrgrbors-149/+286
Rollup of 7 pull requests Successful merges: - #116862 (Detect when trait is implemented for type and suggest importing it) - #117389 (Some diagnostics improvements of `gen` blocks) - #117396 (Don't treat closures/coroutine types as part of the public API) - #117398 (Correctly handle nested or-patterns in exhaustiveness) - #117403 (Poison check_well_formed if method receivers are invalid to prevent typeck from running on it) - #117411 (Improve some diagnostics around `?Trait` bounds) - #117414 (Don't normalize to an un-revealed opaque when we hit the recursion limit) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-30Also consider TAIT to be uncomputable if the MIR body is taintedMichael Goulet-3/+42
2023-10-30Rollup merge of #117414 - compiler-errors:tait-forevert, r=oli-obkMatthias Krüger-7/+21
Don't normalize to an un-revealed opaque when we hit the recursion limit Currently, we will normalize `Opaque := Option<&Opaque>` to something like `Option<&Option<&Option<&...Opaque>>>`, hitting a limit and bottoming out in an unnormalized opaque after the recursion limit gets hit. Unfortunately, during `layout_of`, we'll simply recurse and try again if the type normalizes to something different than the type: https://github.com/rust-lang/rust/blob/e6e931dda5fffbae0fd87c5b1af753cc95556880/compiler/rustc_ty_utils/src/layout.rs#L58-L60 That means then we'll try to normalize `Option<&Option<&Option<&...Opaque>>>` again, substituting `Opaque` into itself even deeper. Eventually this will get to the point that we're just stack-overflowing on a really deep type before even hitting an opaque again. To fix this, we just bottom out into `ty::Error` instead of the unrevealed opaque type. Fixes #117412 r? `@oli-obk`
2023-10-30Rollup merge of #117411 - oli-obk:query_merge_immobile_game, ↵Matthias Krüger-58/+63
r=compiler-errors,Nilstrieb Improve some diagnostics around `?Trait` bounds * uses better spans * clarifies a message that was only talking about generic params, but applies to `dyn ?Trait` and `impl ?Trait` as well
2023-10-30Rollup merge of #117403 - oli-obk:the_gift_that_keeps_on_giving_116849, ↵Matthias Krüger-17/+41
r=compiler-errors Poison check_well_formed if method receivers are invalid to prevent typeck from running on it fixes #117379 Though if some code invokes typeck without having first invoked `check_well_formed` then we'll encounter this ICE again. This can happen in const and const fn bodies if they are evaluated due to other `check_well_formed` checks or similar
2023-10-30Rollup merge of #117398 - Nadrieril:fix-117378, r=compiler-errorsMatthias Krüger-1/+7
Correctly handle nested or-patterns in exhaustiveness I had assumed nested or-patterns were flattened, and they mostly are but not always. Fixes https://github.com/rust-lang/rust/issues/117378
2023-10-30Rollup merge of #117396 - oli-obk:privacy_visitor_types, r=compiler-errorsMatthias Krüger-28/+56
Don't treat closures/coroutine types as part of the public API Fixes a regression from https://github.com/rust-lang/rust/pull/117076 r? `@compiler-errors`
2023-10-30Rollup merge of #117389 - oli-obk:gen_fn, r=compiler-errorsMatthias Krüger-10/+49
Some diagnostics improvements of `gen` blocks These are leftovers from https://github.com/rust-lang/rust/pull/116447
2023-10-30Rollup merge of #116862 - estebank:issue-57457, r=oli-obkMatthias Krüger-28/+49
Detect when trait is implemented for type and suggest importing it Fix #57457.
2023-10-30Don't super-fold types when we hit the recursion limitMichael Goulet-7/+21
2023-10-30Auto merge of #117405 - GuillaumeGomez:rollup-i3jxtwh, r=GuillaumeGomezbors-1079/+1651
Rollup of 11 pull requests Successful merges: - #112463 (rustdoc: elide cross-crate default generic arguments) - #117068 (Clean up `compiler/rustc*/Cargo.toml`) - #117132 (On object safety error, mention new enum as alternative) - #117317 (share some track_caller logic between interpret and codegen) - #117356 (Add support for mipsel-unknown-netbsd, 32-bit LE mips.) - #117357 (Rename a few remaining references to abort terminator) - #117370 (C-variadic error improvements) - #117376 (More `rustc_interface` cleanups) - #117383 (improve and fix `x install`) - #117390 (Fix unused variables lint issue for args in macro) - #117395 (Fix missing leading space in suggestion) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-30Improve some diagnostics around `?Trait` boundsOli Scherer-58/+63
2023-10-30Detect when trait is implemented for type and suggest importing itEsteban Küber-28/+49
Fix #57457.
2023-10-30Rollup merge of #117395 - gurry:117380-wrong-parent-sugg, r=NilstriebGuillaume Gomez-2/+90
Fix missing leading space in suggestion For a local pattern with no space between `let` and `(` e.g.: ```rust let(_a) = 3; ``` we were previously suggesting this illegal code: ```rust let_a = 3; ``` After this change the suggestion will instead be: ```rust let _a = 3; ``` Fixes #117380