rust icon indicating copy to clipboard operation
rust copied to clipboard

contracts: clean up feature flag warning duplicated across tests

Open dawidl022 opened this issue 1 month ago • 2 comments

There is no need for every contracts test to assert the same warning for using the contracts feature flag, as such use #![expect(incomplete_features)] in the tests, and add one test to specifically check for the warning.

Making this change has been discussed in the comments of rust-lang/rust#149722.

Contracts tracking issue: https://github.com/rust-lang/rust/issues/128044

r? Kivooeo

dawidl022 avatar Dec 07 '25 15:12 dawidl022

Reminder, once the PR becomes ready for a review, use @rustbot ready.

rustbot avatar Dec 07 '25 16:12 rustbot

@rustbot ready

dawidl022 avatar Dec 07 '25 16:12 dawidl022

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args contracts/internal_machinery/lowering/basics.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/contracts/internal_machinery/lowering/basics.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/contracts/internal_machinery/lowering/basics/a" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
stderr: none

---- [ui] tests/ui/contracts/internal_machinery/lowering/basics.rs stdout end ----

rust-log-analyzer avatar Dec 07 '25 16:12 rust-log-analyzer

@bors r=Kivooeo,jieyouxu rollup

Kivooeo avatar Dec 07 '25 19:12 Kivooeo

:pushpin: Commit 0bd9a2fafc1e041b3fcf030264b19912f7dda0d3 has been approved by Kivooeo,jieyouxu

It is now in the queue for this repository.

bors avatar Dec 07 '25 19:12 bors