Skip to content

Adjust run-make-support::symbols helpers #143837

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jul 12, 2025

Massage the symbols helpers to fill out {match all, match any} x {substring match, exact match}:

Substring match Exact match
Match any object_contains_any_symbol_substring object_contains_any_symbol
Match all object_contains_all_symbol_substring object_contains_all_symbols

As I'd like to use object_contains_all_symbols for #143669.

As part of this:

  • Rename any_symbol_contains to object_contains_any_symbol_substring for accuracy, as any_symbol_contains is actually "contains any matching substring".
  • Remove with_symbol_iter.

Noticed while working on #143669.

r? @ChrisDenton (or compiler)

jieyouxu added 2 commits July 12, 2025 21:19
Massage the `symbols` helpers to fill out {match all, match any} x
{substring match, exact match}:

|           | Substring match                        | Exact match                   |
|-----------|----------------------------------------|-------------------------------|
| Match any | `object_contains_any_symbol_substring` | `object_contains_any_symbol`  |
| Match all | `object_contains_all_symbol_substring` | `object_contains_all_symbols` |

As part of this, rename `any_symbol_contains` to
`object_contains_any_symbol_substring` for accuracy.
@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 Jul 12, 2025
Copy link
Member Author

Choose a reason for hiding this comment

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

(Obviously still broken)

@jieyouxu
Copy link
Member Author

... I should add a meta test for this.

@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 Jul 12, 2025
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

error[E0277]: can't compare `&[u8]` with `std::str::Bytes<'_>`
   --> src/tools/run-make-support/src/symbols.rs:178:42
    |
178 |             if sym.name_bytes().unwrap() == unmatched_symbol.bytes() {
    |                                          ^^ no implementation for `&[u8] == std::str::Bytes<'_>`
    |
    = help: the trait `PartialEq<std::str::Bytes<'_>>` is not implemented for `&[u8]`
    = help: the following other types implement trait `PartialEq<Rhs>`:
              `&[u8]` implements `PartialEq<BStr>`
              `&[u8]` implements `PartialEq<BString>`
              `&[u8]` implements `PartialEq<ByteStr>`
              `&[u8]` implements `PartialEq<ByteString>`
              `[u8]` implements `PartialEq<BStr>`
              `[u8]` implements `PartialEq<BString>`
              `[u8]` implements `PartialEq<ByteStr>`
              `[u8]` implements `PartialEq<ByteString>`

error[E0308]: mismatched types
   --> src/tools/run-make-support/src/symbols.rs:187:9
    |
165 | pub fn object_contains_all_symbols<P, S>(path: P, candidate_symbols: &[S]) -> bool
    |                                                                               ---- expected `bool` because of return type
...
187 |         ContainsAllSymbolsOutcome::Ok
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `ContainsAllSymbolsOutcome<'_>`

error[E0308]: mismatched types
   --> src/tools/run-make-support/src/symbols.rs:189:9
    |
165 | pub fn object_contains_all_symbols<P, S>(path: P, candidate_symbols: &[S]) -> bool
    |                                                                               ---- expected `bool` because of return type
...
189 |         ContainsAllSymbolsOutcome::MissingSymbols(unmatched_symbols)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `ContainsAllSymbolsOutcome<'_>`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
[RUSTC-TIMING] run_make_support test:false 0.295
error: could not compile `run_make_support` (lib) due to 4 previous errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants