Improve -Zls diagnostic message on .rs files#158859
Conversation
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
f6dbcdc to
dada58c
Compare
This comment has been minimized.
This comment has been minimized.
|
cc @bjorn3 for -Zls expertise |
|
|
|
Seems that I've misinterpreted how to use the |
dada58c to
5af51d2
Compare
This comment has been minimized.
This comment has been minimized.
…iles instead of .rs files
5af51d2 to
ae82b10
Compare
-Zls unstable opt-Zls diagnostic message on .rs files
|
It'd be great to also expand the unstable book documentation for -Zls, so other people in the future are not also confused by this option. |
|
Done! |
This comment has been minimized.
This comment has been minimized.
Update unstable book with ls valid values
6d521fe to
bbba496
Compare
error if file ends in .rs
This comment has been minimized.
This comment has been minimized.
extension. Fix tests and update docs.
|
@bors r+ |
Improve `-Zls` diagnostic message on `.rs` files Refer the user to use `rustc -Zls` on `.rmeta` files instead of `.rs` files. And if they're using cargo, warn them to use rustc directly. > [!IMPORTANT] > First few comments in this pull request refer to changing the flag itself to work on source files. This was instead overruled to warn the user about executing on `.rmeta` files instead of `.rs` files. <details><summary>Old description</summary> <p> This unstable option has been broken since forever (more than 2.5 years, at least), but it's exactly what I need for debugging the new incremental system, so rather than removing it I opted for fixing it. The issue was that we were feeding the source file like, `src/lib.rs` instead of the `.rmeta` file. So literally every use of `-Zls=..` was returning `invalid metadata version found: ..` This PR also includes some testing. Relevant for rust-lang/rust-project-goals#641. </p> </details>
Improve `-Zls` diagnostic message on `.rs` files Refer the user to use `rustc -Zls` on `.rmeta` files instead of `.rs` files. And if they're using cargo, warn them to use rustc directly. > [!IMPORTANT] > First few comments in this pull request refer to changing the flag itself to work on source files. This was instead overruled to warn the user about executing on `.rmeta` files instead of `.rs` files. <details><summary>Old description</summary> <p> This unstable option has been broken since forever (more than 2.5 years, at least), but it's exactly what I need for debugging the new incremental system, so rather than removing it I opted for fixing it. The issue was that we were feeding the source file like, `src/lib.rs` instead of the `.rmeta` file. So literally every use of `-Zls=..` was returning `invalid metadata version found: ..` This PR also includes some testing. Relevant for rust-lang/rust-project-goals#641. </p> </details>
…uwer Rollup of 21 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #155429 (Support `u128`/`i128` c-variadic arguments) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes) - #159005 (Use `as_lang_item` instead of repeatedly matching)
Improve `-Zls` diagnostic message on `.rs` files Refer the user to use `rustc -Zls` on `.rmeta` files instead of `.rs` files. And if they're using cargo, warn them to use rustc directly. > [!IMPORTANT] > First few comments in this pull request refer to changing the flag itself to work on source files. This was instead overruled to warn the user about executing on `.rmeta` files instead of `.rs` files. <details><summary>Old description</summary> <p> This unstable option has been broken since forever (more than 2.5 years, at least), but it's exactly what I need for debugging the new incremental system, so rather than removing it I opted for fixing it. The issue was that we were feeding the source file like, `src/lib.rs` instead of the `.rmeta` file. So literally every use of `-Zls=..` was returning `invalid metadata version found: ..` This PR also includes some testing. Relevant for rust-lang/rust-project-goals#641. </p> </details>
…uwer Rollup of 24 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #156027 (Consider captured regions for opaque type region liveness.) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #157561 (rustdoc: do not include extra stuff in span) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158995 (Use REST API in linkchecker script) - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes)
Improve `-Zls` diagnostic message on `.rs` files Refer the user to use `rustc -Zls` on `.rmeta` files instead of `.rs` files. And if they're using cargo, warn them to use rustc directly. > [!IMPORTANT] > First few comments in this pull request refer to changing the flag itself to work on source files. This was instead overruled to warn the user about executing on `.rmeta` files instead of `.rs` files. <details><summary>Old description</summary> <p> This unstable option has been broken since forever (more than 2.5 years, at least), but it's exactly what I need for debugging the new incremental system, so rather than removing it I opted for fixing it. The issue was that we were feeding the source file like, `src/lib.rs` instead of the `.rmeta` file. So literally every use of `-Zls=..` was returning `invalid metadata version found: ..` This PR also includes some testing. Relevant for rust-lang/rust-project-goals#641. </p> </details>
Rollup of 24 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158541 (Move `std::io::Write` to `core::io`) - #156027 (Consider captured regions for opaque type region liveness.) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #157561 (rustdoc: do not include extra stuff in span) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158960 (Fix bootstrap submodule path prefix matching) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158995 (Use REST API in linkchecker script) - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes) - #159036 (bootstrap: expand '@argfile' arguments to rustc shim)
Rollup merge of #158859 - blyxyas:fix-ls-unstable-opt, r=bjorn3 Improve `-Zls` diagnostic message on `.rs` files Refer the user to use `rustc -Zls` on `.rmeta` files instead of `.rs` files. And if they're using cargo, warn them to use rustc directly. > [!IMPORTANT] > First few comments in this pull request refer to changing the flag itself to work on source files. This was instead overruled to warn the user about executing on `.rmeta` files instead of `.rs` files. <details><summary>Old description</summary> <p> This unstable option has been broken since forever (more than 2.5 years, at least), but it's exactly what I need for debugging the new incremental system, so rather than removing it I opted for fixing it. The issue was that we were feeding the source file like, `src/lib.rs` instead of the `.rmeta` file. So literally every use of `-Zls=..` was returning `invalid metadata version found: ..` This PR also includes some testing. Relevant for rust-lang/rust-project-goals#641. </p> </details>
View all comments
Refer the user to use
rustc -Zlson.rmetafiles instead of.rsfiles. And if they're using cargo, warn them to use rustc directly.Important
First few comments in this pull request refer to changing the flag itself to work on source files. This was instead overruled to warn the user about executing on
.rmetafiles instead of.rsfiles.Old description
This unstable option has been broken since forever (more than 2.5 years, at least), but it's exactly what I need for debugging the new incremental system, so rather than removing it I opted for fixing it.
The issue was that we were feeding the source file like,
src/lib.rsinstead of the.rmetafile. So literally every use of-Zls=..was returninginvalid metadata version found: ..This PR also includes some testing.
Relevant for rust-lang/rust-project-goals#641.