Skip to content

'Test with nightly rustc' job is failing. #29467

@mukilan

Description

@mukilan
Member

'Test with nightly rustc' job is failing due to API changes in most recent nightly rustc breaking the script_plugin crate.

error[E0308]: mismatched types
   --> components/script_plugins/lib.rs:220:54
    |
220 |                 if is_unrooted_ty(&self.symbols, cx, field_type, false) {
    |                    --------------                    ^^^^^^^^^^ expected `Ty<'_>`, found `EarlyBinder<Ty<'_>>`
    |                    |
    |                    arguments to this function are incorrect
    |
    = note: expected struct `rustc_middle::ty::Ty<'_>`
               found struct `EarlyBinder<rustc_middle::ty::Ty<'_>>`
note: function defined here
   --> components/script_plugins/lib.rs:96:4
    |
96  | fn is_unrooted_ty<'tcx>(
    |    ^^^^^^^^^^^^^^
...
99  |     ty: ty::Ty<'tcx>,
    |     ----------------

error[E0308]: mismatched types
   --> components/script_plugins/lib.rs:243:62
    |
243 |                         if is_unrooted_ty(&self.symbols, cx, field_type, false) {
    |                            --------------                    ^^^^^^^^^^ expected `Ty<'_>`, found `EarlyBinder<Ty<'_>>`
    |                            |
    |                            arguments to this function are incorrect
    |
    = note: expected struct `rustc_middle::ty::Ty<'_>`
               found struct `EarlyBinder<rustc_middle::ty::Ty<'_>>`
note: function defined here
   --> components/script_plugins/lib.rs:96:4
    |
96  | fn is_unrooted_ty<'tcx>(
    |    ^^^^^^^^^^^^^^
...
99  |     ty: ty::Ty<'tcx>,
    |     ----------------

error[E0599]: no method named `fn_sig` found for struct `EarlyBinder` in the current scope
   --> components/script_plugins/lib.rs:276:46
    |
276 |             let sig = cx.tcx.type_of(def_id).fn_sig(cx.tcx);
    |                                              ^^^^^^ method not found in `EarlyBinder<Ty<'_>>`
    |
help: one of the expressions' fields has a method of the same name
    |
276 |             let sig = cx.tcx.type_of(def_id).0.fn_sig(cx.tcx);
    |                                              ++

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `script_plugins` due to 3 previous errors

This PR is the corresponding change in rustc which introduced the API change.

The fix might be as simple as adding .skip_binder() to the Ty argument in the call sites of is_unrooted_ty function, but I'm not confident in my knowledge rustc internals to say if this will change the semantics of the lint. I'm currently looking into this, but appreciate any pointers.

Activity

self-assigned this
on Mar 6, 2023
added a commit that references this issue on Jun 4, 2023
8b197bc
added a commit that references this issue on Jun 24, 2023
a4ba9de
added a commit that references this issue on Jul 12, 2023
00a2cce
added 2 commits that reference this issue on Jul 12, 2023
7e6906b
cb5db21
added a commit that references this issue on Jul 13, 2023
6fed50a
added a commit that references this issue on Jul 13, 2023
8f951c4
added a commit that references this issue on Jul 14, 2023
6ca3b0b
added a commit that references this issue on Jul 14, 2023
f967d8a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @mrobinson@mukilan

    Issue actions

      'Test with nightly rustc' job is failing. · Issue #29467 · servo/servo