about summary refs log tree commit diff
path: root/src/test/ui/asm
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-8018/+0
2023-01-01Verbose suggestionsEsteban Küber-19/+17
2023-01-01Merge multiple mutable borrows of immutable binding errorsEsteban Küber-15/+10
Fix #53466.
2022-12-29Account for multiple multiline spans with empty paddingEsteban Küber-12/+2
Instead of ``` LL | fn oom( | __^ | | _| | || LL | || ) { | ||_- LL | | } | |__^ ``` emit ``` LL | // fn oom( LL | || ) { | ||_- LL | | } | |__^ ```
2022-12-20docs: add long error explanation for error E0472Ezra Shaw-0/+2
2022-11-11Print all labels, even if they have no span. Fall back to main item's span.Oli Scherer-1/+1
2022-11-05Auto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obkbors-1/+1
Stabilize the `instruction_set` feature Closes https://github.com/rust-lang/rust/issues/74727 FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253 r? `@pnkfelix` and/or `@nikomatsakis` cc `@xd009642` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-11-02asm: Work around LLVM bug on AArch64Amanieu d'Antras-0/+16
Upstream issue: https://github.com/llvm/llvm-project/issues/58384 LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
2022-10-19Fixup a few tests needing asm supportJosh Stone-0/+2
2022-10-17Stabilize asm_symAmanieu d'Antras-23/+18
2022-10-01bless ui testsMaybe Waffle-10/+10
2022-09-29Stabilize the `instruction_set` featureYuki Okushi-1/+1
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-09-26fix #102087, Suggest Default::default() when binding isn't initializedyukang-0/+20
2022-09-16Rollup merge of #101741 - andrewpollack:add-needs-unwind-ui-tests, r=tmandryMichael Howell-0/+1
Adding needs-unwind arg to applicable compiler ui tests Adding `needs-unwind` arg to applicable compiler ui tests
2022-09-16Adding needs-unwind arg to applicable compiler ui testsAndrew Pollack-0/+1
2022-09-09Rollup merge of #101253 - lyming2007:issue-101163, r=AmanieuMatthias Krüger-36/+36
fix the suggestion of format for asm_sub_register modified: compiler/rustc_typeck/src/check/intrinsicck.rs modified: src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr modified: src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr modified: src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr modified: src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr modified: src/test/ui/asm/type-check-1.rs modified: src/test/ui/asm/type-check-1.stderr modified: src/test/ui/asm/x86_64/type-check-3.stderr
2022-09-08fix the suggestion of format for asm_sub_registerYiming Lei-36/+36
modified: compiler/rustc_typeck/src/check/intrinsicck.rs modified: src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr modified: src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr modified: src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr modified: src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr modified: src/test/ui/asm/type-check-1.rs modified: src/test/ui/asm/type-check-1.stderr modified: src/test/ui/asm/x86_64/type-check-3.stderr
2022-09-03Fix global_asm macro pretty printingMichael Goulet-0/+12
2022-08-29Display raw pointer as `*{mut,const} T` instead of `*-ptr` in errorsnils-2/+2
The `*-ptr` is rather confusing, and we have the full information for properly displaying the information.
2022-08-14Update the minimum external LLVM to 13Josh Stone-4/+0
2022-08-08Auto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiaskobors-58/+45
Only fetch HIR for naked functions that have the attribute.
2022-08-03Bless ui tests.Camille GILLOT-58/+45
2022-08-02Properly reject the `may_unwind` option in `global_asm!`Amanieu d'Antras-36/+36
This was accidentally accepted even though it had no effect in `global_asm!`. The option only makes sense for `asm!` which runs within a function.
2022-07-21Auto merge of #99059 - Amanieu:fix-96797, r=Mark-Simulacrumbors-0/+26
Add test for #96797 This was fixed in LLVM which was updated in #98285. https://reviews.llvm.org/D127751 Fixes #96797
2022-07-21Add test for #96797Amanieu d'Antras-0/+26
This was fixed in LLVM which was updated in #98285. https://reviews.llvm.org/D127751 Fixes #96797
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-27/+27
r=cjgillot gather body owners Issue #96341
2022-07-14Rollup merge of #99192 - Amanieu:fix-asm-srcloc, r=petrochenkovDylan DPC-2/+40
Fix spans for asm diagnostics Line spans were incorrect if the first line of an asm statement was an empty string.
2022-07-14Fix spans for asm diagnosticsAmanieu d'Antras-2/+40
Line spans were incorrect if the first line of an asm statement was an empty string.
2022-07-13use gathered body_owners in par_body_ownersMiguel Guarniz-27/+27
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwcoDylan DPC-0/+29
Keep unstable target features for asm feature checking Inline assembly uses the target features to determine which registers are available on the current target. However it needs to be able to access unstable target features for this. Fixes #99071
2022-07-11Fix sized check ICE in intrisicckMichael Goulet-0/+45
2022-07-11Add test for issue 99071Amanieu d'Antras-0/+29
2022-07-08Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebankbors-2/+2
Shorten def_span of closures to just their header Continuation of https://github.com/rust-lang/rust/pull/93967.
2022-07-07fix arm testEsteban Küber-6/+10
2022-07-07Tweak wording and spansEsteban Küber-4/+4
2022-07-07On partial uninit error point at where we need initEsteban Küber-6/+10
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-07-07Bless aarch64 test.Camille GILLOT-1/+1
2022-07-07Shorten span for closures.Camille GILLOT-1/+1
2022-06-16diagnostics: fix trailing spaceklensy-1/+1
2022-06-12Fix some test annotationsbjorn3-3/+4
These are necessary for running the rustc test suite with cg_clif
2022-05-29Use type_is_copy_modulo_regions check in intrisicckMichael Goulet-0/+12
2022-05-27Update tests on aarch64Oli Scherer-127/+183
2022-05-24Update messagesOli Scherer-4/+4
2022-05-24Make a test independent of 64/32 bitOli Scherer-14/+4
2022-05-24Add the transmute and asm checks to typeck as deferred checksOli Scherer-214/+449
2022-05-07Permit asm_const and asm_sym to reference outer generic paramsGary Guo-13/+33
2022-04-19Rollup merge of #95740 - Amanieu:kreg0, r=nagisaDylan DPC-10/+10
asm: Add a kreg0 register class on x86 which includes k0 Previously we only exposed a kreg register class which excludes the k0 register since it can't be used in many instructions. However k0 is a valid register and we need to have a way of marking it as clobbered for clobber_abi. Fixes #94977
2022-04-19asm: Add a kreg0 register class on x86 which includes k0Amanieu d'Antras-10/+10
Previously we only exposed a kreg register class which excludes the k0 register since it can't be used in many instructions. However k0 is a valid register and we need to have a way of marking it as clobbered for clobber_abi. Fixes #94977
2022-04-16Update tests for sym support in global_asm!Amanieu d'Antras-57/+103
2022-04-03Rollup merge of #95553 - jam1garner:naked-function-compile-error, r=tmiaskoDylan DPC-1/+38
Don't emit non-asm contents error for naked function composed of errors ## Motivation For naked functions an error is emitted when they are composed of anything other than a single asm!() block. However, this error triggers in a couple situations in which it adds no additional information or is actively misleading. One example is if you do have an asm!() block but simply one with a syntax error: ```rust #[naked] unsafe extern "C" fn compiler_errors() { asm!(invalid_syntax) } ``` This results in two errors, one for the syntax error itself and another telling you that you need an asm block in your function: ```rust error[E0787]: naked functions must contain a single asm block --> src/main.rs:6:1 | 6 | / unsafe extern "C" fn naked_compile_error() { 7 | | asm!(blah) 8 | | } | |_^ ``` This issue also comes up when [utilizing `compile_error!()` for improving your diagnostics](https://twitter.com/steveklabnik/status/1509538243020218372), such as raising a compiler error when compiling for an unsupported target. ## Implementation The rules this PR implements are as follows: 1. If any non-erroneous non-asm statement is included, an error will still occur 2. If multiple asm statements are included, an error will still occur 3. If 0 or 1 asm statements are present, as well as any non-zero number of erroneous statements, then this error will *not* be raised as it is likely either redundant or incorrect The rule of thumb is effectively "if an error is present and its correction could change things, don't raise an error".