Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x test tidy --bless incorrectly duplicates a part of where #107610

Closed
peter-lyons-kehl opened this issue Feb 2, 2023 · 2 comments
Closed

x test tidy --bless incorrectly duplicates a part of where #107610

peter-lyons-kehl opened this issue Feb 2, 2023 · 2 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example

Comments

@peter-lyons-kehl
Copy link
Contributor

peter-lyons-kehl commented Feb 2, 2023

  • Background: Experimentation with addition of a const generic parameter to library/alloc and using macro_rules! for default values of those const generic params and also in new where bounds. Daring, of course.
  • checkout coop-rs@17d14cc
  • library/alloc builds well: RUST_BACKTRACE=full x build --stage 0 library/alloc. (Some (default) implementations are incorrect and they make 3rd party crates not build (when RUST_BACKTRACE=full x build --stage 0). It's work in progress. But that shouldn't affect the issue being reported here.)
  • run x test tidy --bless
  • git diff shows this incorrect change:
git diff
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 9d78818fdb5..a8b7d3b8cd7 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1880,6 +1880,8 @@ struct FillGapOnDrop<'a, T, A: core::alloc::Allocator, const CO_ALLOC_PREF: CoAl
         where
             [(); { crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:,
         {
+            crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:,
+            {
             /* Offset of the element we want to check if it is duplicate */
             read: usize,
  • Now RUST_BACKTRACE=full x build --stage 0 library/alloc fails. The above code (before tidy) is at https://github.com/coop-rs/rust/blob/17d14cca54391bc87b014976add4fb3ff59ef685/library/alloc/src/vec/mod.rs#L1878.
  • Unfortunately, I don't have skills, nor capacity, to "minimize" this. I admit I haven't run x test tidy --bless frequently. If I notice anything related, I'll update you.
  • This issue showed up only today (Feb 2, 2023) when I rebased my code on current master. However, I don't know if it's caused by anything new in master, or it only showed up by some constellation of my code, or a combination of both... My previous rebase on master was max. 30 hours earlier (but I don't have the previous commits, because I git push --force since I'm the only developer on this for now).
@peter-lyons-kehl peter-lyons-kehl added the C-bug Category: This is a bug. label Feb 2, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

@peter-kehl can you reproduce this with cargo fmt outside of rust-lang/rust? If so it's not a bug in bootstrap itself but in rustfmt.

@jyn514 jyn514 added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 13, 2023
@peter-lyons-kehl
Copy link
Contributor Author

Thank you. It's an fmt bug.
Closing; minimized and replaced by rust-lang/rustfmt#5691.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
Projects
None yet
Development

No branches or pull requests

2 participants