about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-07-06Also stop emitting BTI prologues for naked functionsJubilee Young-0/+21
Same idea but for AArch64.
2022-07-06Stop emitting CET prologues for naked functionsJubilee Young-1/+25
We can apply nocf_check as a hack for now.
2022-07-07suggest adding a derive for #[default] applied to variantsDeadbeef-5/+5
2022-07-07Auto merge of #98827 - aDotInTheVoid:suggest-extern-block, r=nagisabors-0/+38
Suggest using block for `extern "abi" fn` with no body `@rustbot` modify labels: +A-diagnostics
2022-07-07add a test for #80471Takayuki Maeda-0/+31
2022-07-06update testMiguel Guarniz-6/+6
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-06Auto merge of #98831 - RalfJung:no-more-unsized-locals, r=oli-obkbors-7/+7
interpret: remove support for unsized_locals I added support for unsized_locals in https://github.com/rust-lang/rust/pull/59780 but the current implementation is a crude hack and IMO definitely not the right way to have unsized locals in MIR. It also [causes problems](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Missing.20Layout.20Check.20in.20.60interpret.2Foperand.2Ers.60.3F). and what codegen does is unsound and has been for years since clearly nobody cares (so I hope nobody actually relies on that implementation and I'll be happy if Miri ensures they do not). I think if we want to have unsized locals in Miri/MIR we should add them properly, either by having a `StorageLive` that takes metadata or by having an `alloca` that returns a pointer (making the ptr indirection explicit) or something like that. So, this PR removes the `LocalValue::Unallocated` hack. It adds `Immediate::Uninit`, for several reasons: - This lets us still do fairly little work in `push_stack_frame`, in particular we do not actually have to create any allocations. - If/when I remove `ScalarMaybeUninit`, we will need something like this to have an "optimized" representation of uninitialized locals. Without this we'd have to put uninitialized integers into the heap! - const-prop needs some way to indicate "I don't know the value of this local'; it used to use `LocalValue::Unallocated` for that, now it can use `Immediate::Uninit`. There is still a fundamental difference between `LocalValue::Unallocated` and `Immediate::Uninit`: the latter is considered a regular local that you can read from and write to, it just has a more optimized representation when compared with an actual `Allocation` that is fully uninit. In contrast, `LocalValue::Unallocated` had this really odd behavior where you would write to it but not read from it. (This is in fact what caused the problems mentioned above.) While at it I also did two drive-by cleanups/improvements: - In `pop_stack_frame`, do the return value copying and local deallocation while the frame is still on the stack. This leads to better error locations being reported. The old errors were [sometimes rather confusing](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Cron.20Job.20Failure.202022-06-24/near/287445522). - Deduplicate `copy_op` and `copy_op_transmute`. r? `@oli-obk`
2022-07-06Auto merge of #98987 - GuillaumeGomez:rollup-bcy32bp, r=GuillaumeGomezbors-117/+135
Rollup of 7 pull requests Successful merges: - #96935 (Allow arithmetic and certain bitwise ops on AtomicPtr) - #98519 (Replace some `guess_head_span` with `def_span`) - #98911 (rustdoc: filter '_ lifetimes from ty::Generics) - #98939 (rustdoc: Add more semantic information to impl IDs) - #98971 (Fix typo in file descriptor docs) - #98983 (docs: Add overview of `rustc_middle::mir::TerminatorKind`) - #98984 (Remove erroneous doc comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-06Fix ui-fulldep testChris Denton-6/+11
2022-07-06Rollup merge of #98939 - GuillaumeGomez:rustdoc-disamb-impls, r=notriddleGuillaume Gomez-62/+73
rustdoc: Add more semantic information to impl IDs Take over of #92745. I fixed the last remaining issue for the links in the sidebar (mentioned by `@jsha)` and fixed the few links broken in the std/core docs. cc `@camelid` r? `@notriddle`
2022-07-06Rollup merge of #98911 - notriddle:notriddle/rustdoc-string-impl, ↵Guillaume Gomez-0/+12
r=GuillaumeGomez rustdoc: filter '_ lifetimes from ty::Generics Fixes a weirdly-rendered section of the std::string::String docs. Before: ![image](https://user-images.githubusercontent.com/1593513/177256873-20b9cf6e-2429-4865-853b-b269d74672f4.png) After: ![image](https://user-images.githubusercontent.com/1593513/177256900-ef3efd17-f624-40c5-af90-fe709ec034f2.png)
2022-07-06Rollup merge of #98519 - TaKO8Ki:add-head-span-field-to-item-and-impl-item, ↵Guillaume Gomez-55/+50
r=cjgillot Replace some `guess_head_span` with `def_span` This patch fixes a part of #97417. r? `@cjgillot`
2022-07-06blessRalf Jung-7/+7
2022-07-06Auto merge of #98959 - cjgillot:late-bound-order, r=michaelwoeristerbors-0/+19
Return a FxIndexSet in is_late_bound query. This return value is iterated upon by borrowck, hence the need to preserve a deterministic iteration order. Fixes https://github.com/rust-lang/rust/issues/98890 Affects https://github.com/rust-lang/rust/issues/96655 I don't know if this supersedes https://github.com/rust-lang/rust/pull/98924 or fixes an unrelated bug. r? `@michaelwoerister` This may deserve a backport.
2022-07-06fix ICE in ConstPropRalf Jung-0/+18
2022-07-06session: `output-width` -> `diagnostic-width`David Wood-7/+7
Rename the `--output-width` flag to `--diagnostic-width` as this appears to be the preferred name within the compiler team. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06Tests for unsound Windows file methodsChris Denton-0/+76
2022-07-06session: `terminal-width` -> `output-width`David Wood-24/+24
Rename the `--terminal-width` flag to `--output-width` as the behaviour doesn't just apply to terminals (and so is slightly less accurate). Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06sess: stabilize `--terminal-width`David Wood-3/+26
Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06interpret: use AllocRange in UninitByteAccessRalf Jung-1/+1
also use nice new format string syntax in interpret/error.rs
2022-07-06experiment: trying to encode the end-to-end test as a ui test via ↵Felix S. Klock II-0/+50
rust_test_helpers. This instance is almost certainly insufficient because we need to force optimization flags for both the C and Rust sides of the code. but lets find out for sure.
2022-07-06End-to-end regression test for 97463.Felix S. Klock II-0/+74
incorporated review feedback, with comment explaining why this is calling CC instead of COMPILE_OBJ or NATIVE_STATICLIB. As drive-by, removed some other unnecessary commands from the recipe.
2022-07-06unit tests that inspect LLVM output directly. This relies on a human being ↵Felix S. Klock II-0/+204
to confirm that the entries actually correspond to what is specified in each of the respective ABIs... updated to incorporate feedback: fix x86_64/i686 tests to use correct name for the corresponding llvm component.
2022-07-06Add test for inherent impls anchorsGuillaume Gomez-0/+56
2022-07-06Suggest using block for `extern "abi" fn` with no bodyNixon Enraght-Moony-0/+38
2022-07-06suggest adding a missing zero to a floating point numberTakayuki Maeda-0/+50
2022-07-06incr: cache dwarf objects in work productsDavid Wood-0/+25
Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06fix miri-opt testsTakayuki Maeda-10/+10
2022-07-06use `named_span` in case of tuple variantTakayuki Maeda-24/+24
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-21/+16
2022-07-06Add link to issue for src/test/incremental/async-lifetimes.rsMichael Woerister-0/+2
2022-07-06Rollup merge of #98968 - RalfJung:scalar-sanity, r=oli-obkDylan DPC-0/+15
assert Scalar sanity With https://github.com/rust-lang/rust/pull/96814 having landed, finally our `Scalar` layouts have the invariants they deserve. :)
2022-07-06Rollup merge of #98967 - ↵Dylan DPC-0/+44
ClementTsang:fix_inaccessible_type_alias_plural_typo, r=lcnr fix typo in note about multiple inaccessible type aliases Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope but there are multiple inaccessible type aliases that match the missing type. In general this change would use the correct plural form in this scenario for base words that end with 's'.
2022-07-06Rollup merge of #98884 - davidtwco:translation-on-lints-derive, r=oli-obkDylan DPC-2/+41
macros: `LintDiagnostic` derive - Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it. - Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning). - Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`). - Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery. ~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~ r? `@oli-obk`
2022-07-06fix projectionelem validationDrMeepster-2/+2
2022-07-06Add regression test.Camille GILLOT-0/+17
2022-07-05add testRalf Jung-0/+15
2022-07-05fix typo in note about multiple inaccessible type aliasesClementTsang-0/+44
Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope, and there are multiple inaccessible type aliases that match the missing type. In general this change would use the correct plural form in this scenario for words that end with 's'.
2022-07-05Rollup merge of #98256 - GuillaumeGomez:whitespace-where-clause, r=notriddleGuillaume Gomez-0/+111
Fix whitespace handling after where clause Fixes #97733. You can see the result [here](https://rustdoc.crud.net/imperio/whitespace-where-clause/doc/foo/index.html). r? `@jsha`
2022-07-05Rollup merge of #96814 - RalfJung:enum-repr-align, r=oli-obkGuillaume Gomez-1/+202
Fix repr(align) enum handling `enum`, for better or worse, supports `repr(align)`. That has already caused a bug in https://github.com/rust-lang/rust/issues/92464, which was "fixed" in https://github.com/rust-lang/rust/pull/92932, but it turns out that that fix is wrong and caused https://github.com/rust-lang/rust/issues/96185. So this reverts #92932 (which fixes #96185), and attempts another strategy for fixing #92464: special-case enums when doing a cast, re-using the code to load the discriminant rather than assuming that the enum has scalar layout. This works fine for the interpreter. However, #92464 contained another testcase that was previously not in the test suite -- and after adding it, it ICEs again. This is not surprising; codegen needs the same patch that I did in the interpreter. Probably this has to happen [around here](https://github.com/rust-lang/rust/blob/d32ce37a171663048a4c4a536803434e40f52bd6/compiler/rustc_codegen_ssa/src/mir/rvalue.rs#L276). Unfortunately I don't know how to do that -- the interpreter can load a discriminant from an operand, but codegen can only do that from a place. `@oli-obk` `@eddyb` `@bjorn3` any idea?
2022-07-05Add test for invalid whitespace display after where clauseGuillaume Gomez-0/+111
2022-07-05Update rustdoc testsGuillaume Gomez-23/+34
2022-07-05rustdoc: improve scroll locking in the rustdoc mobile sidebarsMichael Howell-0/+42
This commit ports the scroll locking behavior from the source sidebar to the regular sidebar, and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck. This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content.
2022-07-05rustdoc: Add more semantic information to impl idspierwill-41/+41
Instead of generating `#impl`, `#impl-1`, etc., generate IDs like `#impl-Foo<M>`. Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2022-07-05add assertsRalf Jung-0/+2
2022-07-05fix the layout of repr(align) enumsRalf Jung-1/+200
2022-07-05Rollup merge of #98920 - krasimirgg:llvm-15-issue-37945, r=nikicMatthias Krüger-2/+6
adapt issue-37945 codegen test to accept any order of ops Adapt this test to accept `icmp` operands in any order as a follow-up to https://github.com/rust-lang/rust/commit/cbbf06b0cd39dc93033568f1e65f5363cbbdebcd#commitcomment-77670922.
2022-07-05Rollup merge of #98889 - TaKO8Ki:add-regression-test-for-79467, r=Dylan-DPCMatthias Krüger-0/+17
Add regression test for #79467 closes #79467
2022-07-05Rollup merge of #98860 - RalfJung:dangling-int-ptr, r=davidtwcoMatthias Krüger-32/+32
adjust dangling-int-ptr error message based on suggestions by `@saethlin` in https://github.com/rust-lang/miri/issues/2163 Fixes https://github.com/rust-lang/miri/issues/2163 I also did a bit of refactoring on this, so we have a helper method to create a `Pointer` with `None` provenance.
2022-07-05macros: add diagnostic derive for lintsDavid Wood-2/+41
`SessionDiagnostic` isn't suitable for use on lints as whether or not it creates an error or a warning is decided at compile-time by the macro, whereas lints decide this at runtime based on the location of the lint being reported (as it will depend on the user's `allow`/`deny` attributes, etc). Re-using most of the machinery for `SessionDiagnostic`, this macro introduces a `LintDiagnostic` derive which implements a `DecorateLint` trait, taking a `LintDiagnosticBuilder` and adding to the lint according to the diagnostic struct.