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

fix indoc::formatdoc error #3592

Closed
wants to merge 1 commit into from
Closed

Conversation

JeremyMoeglich
Copy link

This PR fixes two compile errors, by passing values to indoc::formatdoc! explicitly

error: there is no argument named `err_str`
   --> psl/psl-core/src/configuration/datasource.rs:130:44
    |
130 |                   let s = indoc::formatdoc! {"
    |  ____________________________________________^
131 | |                     {err_str}
132 | |
133 | |                     To use a URL with protocol `prisma://` the Data Proxy must be enabled via `prisma generate --data-proxy`.
134 | |
135 | |                     More information about Data Proxy: https://pris.ly/d/data-proxy
136 | |                 "};
    | |_________________^
    |
    = note: did you intend to capture a variable `err_str` from the surrounding scope?
    = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro

and

    error: there is no argument named `child_id`
   --> query-engine/connector-test-kit-rs/query-tests-setup/src/schema_gen/schema_with_relation.rs:167:64
    |
167 |   ...                   let datamodel = indoc::formatdoc! {"
    |  __________________________________________________________^
168 | | ...                       model Parent {{
169 | | ...                           p             String    @unique
170 | | ...                           p_1           String
...   |
188 | | ...                       }}
189 | | ...                   "};
    | |_______________________^
    |
    = note: did you intend to capture a variable `child_id` from the surrounding scope?
    = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
    ```

@JeremyMoeglich JeremyMoeglich requested a review from a team as a code owner January 12, 2023 04:49
@CLAassistant
Copy link

CLAassistant commented Jan 12, 2023

CLA assistant check
All committers have signed the CLA.

@JeremyMoeglich JeremyMoeglich changed the title fix indoc error fix indoc::formatdoc error Jan 12, 2023
@tomhoule
Copy link
Contributor

Hi @JeremyMoeglich , thanks for the PR! These formatdoc!() calls are working as intended, they're just using the implicit format args feature, that has been stable for a while. So I don't think we need to make this change. The error should disappear if you upgrade your rust toolchain.

@tomhoule tomhoule closed this Jan 12, 2023
@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 12, 2023

Hi @JeremyMoeglich , thanks for the PR! These formatdoc!() calls are working as intended, they're just using the implicit format args feature, that has been stable for a while. So I don't think we need to make this change. The error should disappear if you upgrade your rust toolchain.

The issue occurs on Nightly but not Stable. So the issue might appear in future stable versions.
Implicit format args are working fine in both versions
@tomhoule

@tomhoule
Copy link
Contributor

tomhoule commented Jan 12, 2023

Ah that's a different issue. It looks like it's a known problem, I don't know if it will make it to stable, and even then, if indoc doesn't fix it. I'd delay any action until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants