Skip to content

Skip long type files for expected lints - #166357

Open
LusterSourav wants to merge 8 commits into
rust-lang:mainfrom
LusterSourav:wee
Open

LusterSourav wants to merge 8 commits into
rust-lang:mainfrom
LusterSourav:wee

Conversation

@LusterSourav

@LusterSourav LusterSourav commented Nov 22, 2026 •

Copy link
Copy Markdown

View all comments

#166293
P=thee expected lint is never shown but its diagnostic was still built,building it wrote a long type file to disk
F+=Diagnostics for expected lints now carry an empty path marker. short_string_namespace sees the marker and returns the short string without writing a file
T+=new run make test checks that no long type file is created for an expected lint. It also checks that a shown lint still creates one

i cheked ;)
./x check compiler
and tests/run-make/expect-lint-no-long-type-file it cheekc that no long-type file pikabo ...
./x test tidy

full tests/ui and the rest of the compiler suite not run or else my lap gona cry -_-

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 22, 2026
@rustbot

rustbot commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @oli-obk (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 79 candidates
  • Random selection from 20 candidates

@JonathanBrouwer JonathanBrouwer added the A-diagnostics Area: Messages for errors, warnings, and lints label Nov 22, 2026
Comment thread compiler/rustc_errors/src/diagnostic.rs Resolved
Comment thread compiler/rustc_errors/src/diagnostic.rs Resolved
is_lint: None,
long_ty_path: None,
// Expected lints are never shown, so they must not write long type files.
long_ty_path: matches!(level, Level::Warning(Some(EmissionOverride::Expected { .. })))

@JonathanBrouwer JonathanBrouwer Nov 22, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually could we make this a custom enum rather than an option? I think that's clearer
Like

enum LongTyPath {
    None,
    Surpressed,
    Some(PathBuf)
}

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree a enum with none, suppresed and some(PathBuf) states the intent directl & its removes the empty path trick and makes it hard to forget the suppresed case here cost is that every place that uses the field need updting hmhmhm

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the q is i have to changes it one many file like 40+

The trait IntoDiagArg has a method that takes &mut option PathBuf ,it is declared in rustc_error_messages.
and every typ that implments this trait has to repeat that exact sigature. About 30 types across about 20 crates implemnt it, in rustc_abi, rustc_hir, rustc_target and others..... and the change option PathBuf to LongTyPath, evry one of those signatues stops compiling...so more and more line edts

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this enum get me more edits... ???????

@LusterSourav LusterSourav Nov 22, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could u please suggest me what to doooo plsss

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2026
@rustbot

rustbot commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

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

@LusterSourav

LusterSourav commented Nov 22, 2026 •

Copy link
Copy Markdown
Author

so i will updates the test files means rename it & add the allow case then the overwrite sites onee and i will switch to enum
good stuff right ;)
i will update it after dinner

@oli-obk

This comment was marked as resolved.

@oli-obk

This comment was marked as resolved.

@oli-obk oli-obk closed this Nov 23, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 23, 2026
@oli-obk oli-obk reopened this Nov 23, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 23, 2026
@LusterSourav

Copy link
Copy Markdown
Author

@rustbot ready
but the q is the enum will make more changes pls read mine comments for your suggestion after reviewing it pls suggest what to do but eventually its actually work means mine one

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/expect-lint-no-long-type-file stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/expect-lint-no-long-type-file/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED -u __STD_REMAP_DEBUGINFO_ENABLED AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64 -w" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64 -w" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH=":/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils abi aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cas cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dtlto dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes plugins powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support supportlsp symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_CODEGEN_BACKEND="gcc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" __BOOTSTRAP_JOBS="4" __RMAKE_VERBOSE_SUBPROCESS_OUTPUT="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/expect-lint-no-long-type-file/rmake"
stdout: none
--- stderr -------------------------------
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/expect-lint-no-long-type-file/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/expect-lint-no-long-type-file/rmake_out" "-Zcodegen-backend=gcc" "-Zthreads=1" "expected.rs" "--edition" "2024" "-Zwrite-long-types-to-disk=yes" "--diagnostic-width=60" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===



command failed at line 15
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/expect-lint-no-long-type-file/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/expect-lint-no-long-type-file/rmake_out" "-Zcodegen-backend=gcc" "-Zthreads=1" "allowed.rs" "--edition" "2024" "-Zwrite-long-types-to-disk=yes" "--diagnostic-width=60" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 1`
=== STDOUT ===



=== STDERR ===
error: couldn't find file `allowed.rs`

Important

For more information how to resolve CI failures of this job, visit this link.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnostics Area: Messages for errors, warnings, and lints A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants