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

Use macro to make query providers greppable #117360

Closed
wants to merge 1 commit into from

Conversation

Noratrieb
Copy link
Member

@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 29, 2023
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-15 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_94f34e85-70b9-4e54-9a96-c98921ff973a
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=query-provider-find-me
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_94f34e85-70b9-4e54-9a96-c98921ff973a
GITHUB_REF=refs/pull/117360/merge
GITHUB_REF_NAME=117360/merge
GITHUB_REF_PROTECTED=false
---
   Compiling alloc v0.0.0 (/checkout/library/alloc)
   Compiling core v0.0.0 (/checkout/library/core)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcppd44b/symbols.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-bd51f4895a96bb41.std.3c4810ef4874a0ff-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-9ff442e4cae65b6f/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand_xorshift-d42eae1bdeb71e15.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand-83eb502136e26c9e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librand_core-e828244eb6a3757b.rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-ltest-c794e29347dd1e4d" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-292aad127b8c49ac" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcompiler_builtins-79afc0e4664abe47.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-bd51f4895a96bb41" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-Wl,-z,origin" "-Wl,-rpath,$ORIGIN/../lib"
  = note: /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-bd51f4895a96bb41.std.3c4810ef4874a0ff-cgu.0.rcgu.o: in function `std::panicking::try::cleanup':
          std.3c4810ef4874a0ff-cgu.0:(.text.unlikely._ZN3std9panicking3try7cleanup17hcd1b0a5e3401906cE+0x9): undefined reference to `__rust_panic_cleanup'
          /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/std-bd51f4895a96bb41.std.3c4810ef4874a0ff-cgu.0.rcgu.o: in function `std::panicking::rust_panic':
          std.3c4810ef4874a0ff-cgu.0:(.text._ZN3std9panicking10rust_panic17hbff004bfc3e600f7E+0x6): undefined reference to `__rust_start_panic'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `std` (lib test) due to previous error
Build completed unsuccessfully in 0:17:03
  local time: Sun Oct 29 14:49:49 UTC 2023
  network time: Sun, 29 Oct 2023 14:49:50 GMT

@oli-obk

This comment was marked as resolved.

@Noratrieb
Copy link
Member Author

Noratrieb commented Oct 29, 2023

rust analyzer works just fine on the RHS. I also made sure to make the macro contain valid rust exprs, letting rustfmt take care of formatting.

@bors
Copy link
Contributor

bors commented Oct 30, 2023

☔ The latest upstream changes (presumably #117405) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -116,7 +116,7 @@ impl<'tcx> TyCtxtConsts<'tcx> {
}

pub fn provide(providers: &mut Providers) {
*providers = Providers { mir_borrowck, ..*providers };
query_provider!(providers, provide(mir_borrowck) = mir_borrowck);
Copy link
Contributor

Choose a reason for hiding this comment

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

What about a simpler query_provide!(mir_borrowck, providers)?
If we need to provide a closure, we add a simple let binding just above.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with this opinion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Closure inference hates this idea and makes this all really annoying, needing type annotations all over the place. Probably makes more sense to just turn the closures into functions instead, but that's some annoying manual effort that I don't feel like doing right now. Gonna work on this at a later point.

@TaKO8Ki
Copy link
Member

TaKO8Ki commented Nov 12, 2023

@rustbot author

@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 12, 2023
@Dylan-DPC
Copy link
Member

@Noratrieb any updates on this? thanks

@Dylan-DPC
Copy link
Member

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

@Dylan-DPC Dylan-DPC closed this Sep 28, 2024
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants