Skip to content

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

Closed as not planned
Closed as not planned
@mukilan

Description

@mukilan

'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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions