about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-04-22add known-bug test for unsound issue 104005whtahy-0/+37
2023-04-22add known-bug test for unsound issue 100051whtahy-0/+31
2023-04-22add known-bug test for unsound issue 100041whtahy-0/+19
2023-04-22add known-bug test for unsound issue 98117whtahy-0/+23
2023-04-22add known-bug test for unsound issue 85099whtahy-0/+68
2023-04-22add known-bug test for unsound issue 84591whtahy-0/+39
2023-04-22add known-bug test for unsound issue 84533whtahy-0/+37
2023-04-22add known-bug test for unsound issue 84366whtahy-0/+15
2023-04-22add known-bug test for unsound issue 57893whtahy-0/+25
2023-04-22add known-bug test for unsound issue 49206whtahy-0/+38
2023-04-22add known-bug test for unsound issue 25860whtahy-0/+16
2023-04-22Auto merge of #106934 - DrMeepster:offset_of, r=WaffleLapkinbors-0/+576
Add offset_of! macro (RFC 3308) Implements https://github.com/rust-lang/rfcs/pull/3308 (tracking issue #106655) by adding the built in macro `core::mem::offset_of`. Two of the future possibilities are also implemented: * Nested field accesses (without array indexing) * DST support (for `Sized` fields) I wrote this a few months ago, before the RFC merged. Now that it's merged, I decided to rebase and finish it. cc `@thomcc` (RFC author)
2023-04-21Auto merge of #110648 - Dylan-DPC:rollup-em3ovcq, r=Dylan-DPCbors-0/+60
Rollup of 5 pull requests Successful merges: - #110333 (rustc_metadata: Split `children` into multiple tables) - #110501 (rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence) - #110608 (Specialize some `io::Read` and `io::Write` methods for `VecDeque<u8>` and `&[u8]`) - #110632 (Panic instead of truncating if the incremental on-disk cache is too big) - #110633 (More `mem::take` in `library`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-21Auto merge of #110107 - cjgillot:const-prop-lint-junk, r=oli-obkbors-39/+38
Ensure mir_drops_elaborated_and_const_checked when requiring codegen. mir_drops_elaborated_and_const_checked may emit errors while codegen has started, and the compiler would exit leaving object code files around. Found by `@cuviper` in https://github.com/rust-lang/rust/issues/109731
2023-04-21Do not rely on exact error code.Camille GILLOT-1/+1
2023-04-21Ensure mir_drops_elaborated_and_const_checked when requiring codegen.Camille GILLOT-39/+38
2023-04-21Auto merge of #110569 - saethlin:mir-pass-cooperation, r=cjgillotbors-1/+44
Deduplicate unreachable blocks, for real this time In https://github.com/rust-lang/rust/pull/106428 (in particular https://github.com/rust-lang/rust/pull/106428/commits/41eda69516dd3ee217ae07c0efa369d31f630405) we noticed that inlining `unreachable_unchecked` can produce duplicate unreachable blocks. So we improved two MIR optimizations: `SimplifyCfg` was given a simplify to deduplicate unreachable blocks, then `InstCombine` was given a combiner to deduplicate switch targets that point at the same block. The problem is that change doesn't actually work. Our current pass order is ``` SimplifyCfg (does nothing relevant to this situation) Inline (produces multiple unreachable blocks) InstCombine (doesn't do anything here, oops) SimplifyCfg (produces the duplicate SwitchTargets that InstCombine is looking for) ``` So in here, I have factored out the specific function from `InstCombine` and placed it inside the simplify that produces the case it is looking for. This should ensure that it runs in the scenario it was designed for. Fixes https://github.com/rust-lang/rust/issues/110551 r? `@cjgillot`
2023-04-21Rollup merge of #110501 - notriddle:notriddle/ice-110495, r=petrochenkovDylan DPC-0/+60
rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence Fixes #110495
2023-04-21major test improvementsDrMeepster-10/+240
2023-04-21blessDrMeepster-6/+6
2023-04-21fmtDrMeepster-6/+8
2023-04-21fix incorrect param env in dead code lintDrMeepster-0/+40
2023-04-21test improvementsDrMeepster-23/+121
2023-04-21offset_ofDrMeepster-0/+206
2023-04-21Auto merge of #96840 - cjgillot:query-feed, r=oli-obkbors-18/+112
Allow to feed a value in another query's cache and remove `WithOptConstParam` I used it to remove `WithOptConstParam` queries, as an example. The idea is that a query (here `typeck(function)`) can write into another query's cache (here `type_of(anon const)`). The dependency node for `type_of` would depend on all the current dependencies of `typeck`. There is still an issue with cycles: if `type_of(anon const)` is accessed before `typeck(function)`, we will still have the usual cycle. The way around this issue is to `ensure` that `typeck(function)` is called before accessing `type_of(anon const)`. When replayed, we may the following cases: - `typeck` is green, in that case `type_of` is green too, and all is right; - `type_of` is green, `typeck` may still be marked as red (it depends on strictly more things than `type_of`) -> we verify that the saved value and the re-computed value of `type_of` have the same hash; - `type_of` is red, then `typeck` is red -> it's the caller responsibility to ensure `typeck` is recomputed *before* `type_of`. As `anon consts` have their own `DefPathData`, it's not possible to have the def-id of the anon-const point to something outside the original function, but the general case may have to be resolved before using this device more broadly. There is an open question about loading from the on-disk cache. If `typeck` is loaded from the on-disk cache, the side-effect does not happen. The regular `type_of` implementation can go and fetch the correct value from the decoded `typeck` results, and the dep-graph will check that the hashes match, but I'm not sure we want to rely on this behaviour. I specifically allowed to feed the value to `type_of` from inside a call to `type_of`. In that case, the dep-graph will check that the fingerprints of both values match. This implementation is still very sensitive to cycles, and requires that we call `typeck(function)` before `typeck(anon const)`. The reason is that `typeck(anon const)` calls `type_of(anon const)`, which calls `typeck(function)`, which feeds `type_of(anon const)`, and needs to build the MIR so needs `typeck(anon const)`. The latter call would not cycle, since `type_of(anon const)` has been set, but I'd rather not remove the cycle check.
2023-04-21Rollup merge of #110611 - ↵Matthias Krüger-0/+24
GuillaumeGomez:regression-test-pub-reexport-pub-reexport, r=notriddle Add regression test for #46506 Fixes #46506. This issue was fixed very likely alongside the others when we cleaned up the re-exports code. r? `@notriddle`
2023-04-21Rollup merge of #110578 - bvanjoi:fix-issue-110547, r=jackh726Matthias Krüger-0/+36
fix(error): normalize whitespace during msg_to_buffer close https://github.com/rust-lang/rust/issues/110547
2023-04-21Rollup merge of #110555 - compiler-errors:subst-missing-trait-items, r=cjgillotMatthias Krüger-51/+68
Substitute missing trait items suggestion correctly Properly substitute missing item suggestions, so that when they reference generics from their parent trait they actually have the right time for the impl. Also, some other minor tweaks like using `/* Type */` to signify a GAT's type is actually missing, and fixing generic arg suggestions for GATs in general.
2023-04-21Auto merge of #110370 - c410-f3r:dqewdas, r=petrochenkovbors-98/+0
Move test files r? `@petrochenkov`
2023-04-20Run combine_duplicate_switch_targets after the simplification that produces themBen Kimock-2/+2
2023-04-21fix(error): normalize whitespace during msg_to_bufferbohan-0/+36
2023-04-20Bless coverage.Camille GILLOT-5/+5
2023-04-20Move test filesCaio-98/+0
2023-04-20Bless run-make-fulldeps test.Camille GILLOT-6/+3
2023-04-20Bless mir-opt.Camille GILLOT-1/+1
2023-04-20Add incremental tests.Camille GILLOT-0/+97
2023-04-20Give more descriptive names to queries.Camille GILLOT-5/+5
2023-04-20Remove WithOptconstParam.Camille GILLOT-1/+1
2023-04-20Add regression test for #46506Guillaume Gomez-0/+24
2023-04-20Add Call terminator to SMIRSantiago Pastorino-1/+9
2023-04-20Auto merge of #109993 - scottmcm:transmute-niches, r=oli-obkbors-11/+304
`assume` value ranges in `transmute` Fixes #109958
2023-04-20Rollup merge of #110575 - Ezrashaw:fix-regression-110573, r=compiler-errorsYuki Okushi-0/+12
fix lint regression in `non_upper_case_globals` Fixes #110573 The issue also exists for inherent associated types (where I copied my impl from). `EarlyContext` is more involved to fix in this way, so I'll leave it be for now (note it's unstable so that's not urgent). r? `@compiler-errors`
2023-04-20Rollup merge of #102341 - jmillikin:nonzero-impl-neg, r=dtolnayYuki Okushi-0/+12
Implement `Neg` for signed non-zero integers. Negating a non-zero integer currently requires unpacking to a primitive and re-wrapping. Since negation of non-zero signed integers always produces a non-zero result, it is safe to implement `Neg` for `NonZeroI{N}`. The new `impl` is marked as stable because trait impls for two stable types can't be marked unstable. See discussion on https://github.com/rust-lang/libs-team/issues/105 for additional context.
2023-04-19Add transmute optimization tests and some extra commentsScott McMurray-0/+109
2023-04-20Implement `Neg` for signed non-zero integers.John Millikin-0/+12
Negating a non-zero integer currently requires unpacking to a primitive and re-wrapping. Since negation of non-zero signed integers always produces a non-zero result, it is safe to implement `Neg` for `NonZeroI{N}`. The new `impl` is marked as stable because trait implementations for two stable types can't be marked unstable.
2023-04-20reimpl `make non_upper_case_globals lint not report trait impls`Ezra Shaw-0/+12
2023-04-20Auto merge of #110399 - cjgillot:infer-variance, r=aliemjaybors-0/+51
Account for opaque variance in outlives Fixes https://github.com/rust-lang/rust/issues/108591 Fixes https://github.com/rust-lang/rust/issues/108592 cc `@aliemjay`
2023-04-19Demonstrate the bugBen Kimock-0/+43
2023-04-19Auto merge of #110061 - WaffleLapkin:duality_of_myself_and_this, r=cjgillotbors-61/+233
Add suggestion to use closure argument instead of a capture on borrowck error Fixes #109271 r? `@compiler-errors` This should probably be refined a bit, but opening a PR so that I don't forget anything.
2023-04-19Format missing GATs correctlyMichael Goulet-1/+28