Skip to content

regression: error[E0658]: use of unstable library feature proc_macro_totokens #134707

Open
@cuviper

Description

Two logs failed to compile sqlx-models-proc-macro:

  1. https://crater-reports.s3.amazonaws.com/beta-1.84.0-4-retry2/beta-2024-12-08/reg/sql_from_models-proc-macro-0.1.2/log.txt
  2. https://crater-reports.s3.amazonaws.com/beta-1.84.0-4-retry2/beta-2024-12-08/reg/sqlx-models-proc-macro-0.0.3/log.txt
[INFO] [stdout] warning: `ToTokens` is ambiguous
[INFO] [stdout]   --> src/model/mod.rs:59:6
[INFO] [stdout]    |
[INFO] [stdout] 59 | impl ToTokens for Model {
[INFO] [stdout]    |      ^^^^^^^^ ambiguous name
[INFO] [stdout]    |
[INFO] [stdout]    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[INFO] [stdout]    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
[INFO] [stdout]    = note: ambiguous because of multiple glob imports of a name in the same module
[INFO] [stdout] note: `ToTokens` could refer to the trait imported here
[INFO] [stdout]   --> src/prelude.rs:2:35
[INFO] [stdout]    |
[INFO] [stdout] 2  | pub use proc_macro::{TokenStream, *};
[INFO] [stdout]    |                                   ^
[INFO] [stdout]    = help: consider adding an explicit import of `ToTokens` to disambiguate
[INFO] [stdout] note: `ToTokens` could also refer to the trait imported here
[INFO] [stdout]   --> src/prelude.rs:4:24
[INFO] [stdout]    |
[INFO] [stdout] 4  | pub use quote::{quote, *};
[INFO] [stdout]    |                        ^
[INFO] [stdout]    = help: consider adding an explicit import of `ToTokens` to disambiguate
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0658]: use of unstable library feature `proc_macro_totokens`
[INFO] [stdout]   --> src/model/mod.rs:60:5
[INFO] [stdout]    |
[INFO] [stdout] 60 | /     fn to_tokens(&self, tokens: &mut TokenStream2) {
[INFO] [stdout] 61 | |         let name = &self.name;
[INFO] [stdout] 62 | |         let name_lowercase = &self.name_lowercase;
[INFO] [stdout] 63 | |         let columns = &self.get_columns();
[INFO] [stdout] ...  |
[INFO] [stdout] 75 | |         tokens.extend(template);
[INFO] [stdout] 76 | |     }
[INFO] [stdout]    | |_____^
[INFO] [stdout]    |
[INFO] [stdout]    = note: see issue #130977 <https://github.com/rust-lang/rust/issues/130977> for more information

So it appears to be globbing the unstable proc_macro::ToTokens before the desired quote::ToTokens.

Version it worked on

It most recently worked on: 1.83.0

Version with regression

Using rustc 1.84.0-beta.4 in crater #134138.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions