about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-11-02Remove support for alias `-Z symbol-mangling-version`Zalathar-1/+1
2023-11-02Add UI tests for values accepted by `-C symbol-mangling-version`Zalathar-0/+25
2023-11-02Always do all the pattern checksNadrieril-4/+22
2023-11-02Add regression test for pattern checksNadrieril-0/+72
2023-11-02Tweak diagnostic for consistencyNadrieril-57/+109
2023-11-02Hint optimizer about reserved capacityKornel-1/+15
2023-11-01Auto merge of #117498 - matthiaskrgr:rollup-z7mg4ck, r=matthiaskrgrbors-19/+489
Rollup of 4 pull requests Successful merges: - #117298 (Recover from missing param list in function definitions) - #117373 (Avoid the path trimming ICE lint in error reporting) - #117441 (Do not assert in op_to_const.) - #117488 (Update minifier-rs version to 0.3.0) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-01Rollup merge of #117441 - cjgillot:diag-noassert, r=oli-obk,RalfJungMatthias Krüger-0/+445
Do not assert in op_to_const. `op_to_const` is used in `try_destructure_mir_constant_for_diagnostics`, which may encounter invalid constants created by optimizations and debugging. r? ``@oli-obk`` Fixes https://github.com/rust-lang/rust/issues/117368
2023-11-01Rollup merge of #117298 - clubby789:fn-missing-params, r=petrochenkovMatthias Krüger-19/+44
Recover from missing param list in function definitions Addresses the other issue mentioned in #108109
2023-11-01Auto merge of #117029 - rmehri01:mir_opt_filecheck_inline_tests, r=cjgillotbors-51/+156
Add FileCheck annotations to MIR-opt inlining tests Part of #116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`. I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop. r? cjgillot
2023-11-01Remove a false statement from Unsize docs, add a testMichael Goulet-0/+29
2023-11-01Auto merge of #117289 - estebank:issue-72298, r=cjgillotbors-0/+94
Account for `ref` and `mut` in the wrong place for pattern ident renaming If the user writes `S { ref field: name }` instead of `S { field: ref name }`, we suggest the correct code. Fix #72298.
2023-11-01Rebase fallout.Camille GILLOT-10/+2
2023-11-01Make ui into mir-opt test.Camille GILLOT-11/+453
2023-11-01Do not assert in op_to_const.Camille GILLOT-0/+11
2023-11-01Give a better diagnostic for missing parens in Fn* boundsclubby789-0/+27
2023-11-01fix spans for inline_couroutine panic-abortRyan Mehri-11/+11
2023-11-01Recover from missing param list in function definitionsclubby789-19/+44
2023-11-01Auto merge of #114208 - GKFX:offset_of_enum, r=wesleywiserbors-47/+294
Support enum variants in offset_of! This MR implements support for navigating through enum variants in `offset_of!`, placing the enum variant name in the second argument to `offset_of!`. The RFC placed it in the first argument, but I think it interacts better with nested field access in the second, as you can then write things like ```rust offset_of!(Type, field.Variant.field) ``` Alternatively, a syntactic distinction could be made between variants and fields (e.g. `field::Variant.field`) but I'm not convinced this would be helpful. [RFC 3308 # Enum Support](https://rust-lang.github.io/rfcs/3308-offset_of.html#enum-support-offset_ofsomeenumstructvariant-field_on_variant) Tracking Issue #106655.
2023-11-01Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomccMatthias Krüger-2/+2
Clean up unchecked_math, separate out unchecked_shifts Tracking issue: #85122 Changes: 1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised. 2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result. 3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO. The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-11-01Auto merge of #116692 - Nadrieril:half-open-ranges, r=cjgillotbors-198/+215
Match usize/isize exhaustively with half-open ranges The long-awaited finale to the saga of [exhaustiveness checking for integers](https://github.com/rust-lang/rust/pull/50912)! ```rust match 0usize { 0.. => {} // exhaustive! } match 0usize { 0..usize::MAX => {} // helpful error message! } ``` Features: - Half-open ranges behave as expected for `usize`/`isize`; - Trying to use `0..usize::MAX` will tell you that `usize::MAX..` is missing and explain why. No more unhelpful "`_` is missing"; - Everything else stays the same. This should unblock https://github.com/rust-lang/rust/issues/37854. Review-wise: - I recommend looking commit-by-commit; - This regresses perf because of the added complexity in `IntRange`; hopefully not too much; - I measured each `#[inline]`, they all help a bit with the perf regression (tho I don't get why); - I did not touch MIR building; I expect there's an easy PR there that would skip unnecessary comparisons when the range is half-open.
2023-11-01Auto merge of #113970 - cjgillot:assume-all-the-things, r=nikicbors-324/+390
Replace switch to unreachable by assume statements `UnreachablePropagation` currently keeps some switch terminators alive in order to ensure codegen can infer the inequalities on the discriminants. This PR proposes to encode those inequalities as `Assume` statements. This allows to simplify MIR further by removing some useless terminators.
2023-11-01Stabilize C string literalsJohn Millikin-56/+15
2023-10-31Update based on wesleywiser reviewGeorge Bateman-3/+10
2023-10-31Update MIR tests for offset_ofGeorge Bateman-44/+44
2023-10-31Enums in offset_of: update based on est31, scottmcm & llogiq reviewGeorge Bateman-2/+27
2023-10-31Support enum variants in offset_of!George Bateman-29/+244
2023-10-31Auto merge of #117459 - matthiaskrgr:rollup-t3osb3c, r=matthiaskrgrbors-0/+182
Rollup of 5 pull requests Successful merges: - #113241 (rustdoc: Document lack of object safety on affected traits) - #117388 (Turn const_caller_location from a query to a hook) - #117417 (Add a stable MIR visitor) - #117439 (prepopulate opaque ty storage before using it) - #117451 (Add support for pre-unix-epoch file dates on Apple platforms (#108277)) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-31FileCheck const_prop_miscompile.Camille GILLOT-24/+41
2023-10-31FileCheck const_debuginfo.Camille GILLOT-42/+66
2023-10-31FileCheck while_storage.Camille GILLOT-53/+200
2023-10-31change inline_retag to after.mirRyan Mehri-66/+60
2023-10-31Rollup merge of #117417 - celinval:smir-visitor, r=oli-obkMatthias Krüger-0/+148
Add a stable MIR visitor This change also adds a few utility functions as well and extend most `mir` and `ty` ADTs to implement `PartialEq` and `Eq`. Fixes https://github.com/rust-lang/project-stable-mir/issues/32 r? `@oli-obk`
2023-10-31Rollup merge of #113241 - poliorcetics:85138-doc-object-safety, r=GuillaumeGomezMatthias Krüger-0/+34
rustdoc: Document lack of object safety on affected traits Closes #85138 I saw the issue didn't have any recent activity, if there is another MR for it I missed it. I want the issue to move forward so here is my proposition. It takes some space just before the "Implementors" section and only if the trait is **not** object safe since it is the only case where special care must be taken in some cases and this has the benefit of avoiding generation of HTML in (I hope) the common case.
2023-10-31Auto merge of #117450 - oli-obk:rustdoc_verify, r=estebankbors-106/+423
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-31Accept less invalid Rust in rustdocOli Scherer-106/+423
2023-10-31Auto merge of #117444 - matthiaskrgr:rollup-43s0spc, r=matthiaskrgrbors-3/+116
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-3/+26
Do not ICE on constant evaluation failure in GVN. Fixes https://github.com/rust-lang/rust/issues/117362
2023-10-31Rollup merge of #117416 - compiler-errors:tait-in-bad-body, r=oli-obkMatthias Krüger-0/+31
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-0/+59
When encountering unclosed delimiters during lexing, check for diff markers Fix #116252.
2023-10-31FileCheck uninhabited_enum_branching.Camille GILLOT-245/+126
2023-10-31Only emit `!=` assumptions if the otherwise target is reachable.Camille GILLOT-51/+142
2023-10-31Refactor UninhabitedEnumBranching to mark targets unreachable.Camille GILLOT-6/+37
2023-10-31Simplify assume of a constant.Camille GILLOT-84/+62
2023-10-31Replace SwitchInt to unreachable by an assumption.Camille GILLOT-38/+93
2023-10-31Reorder passes.Camille GILLOT-33/+63
2023-10-31Do not ICE on constant evaluation failure in GVN.Camille GILLOT-3/+26
2023-10-31Auto merge of #117377 - dtolnay:deprecatedsince, r=cjgillotbors-26/+30
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-30Preserve deprecation attribute even if 'since' version is missingDavid Tolnay-3/+11
2023-10-30Auto merge of #116405 - estebank:issue-103155, r=davidtwcobors-181/+206
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.