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

[1.30 beta] Unresolved import errors in a few crates #54471

Closed
pietroalbini opened this issue Sep 22, 2018 · 6 comments
Closed

[1.30 beta] Unresolved import errors in a few crates #54471

pietroalbini opened this issue Sep 22, 2018 · 6 comments
Assignees
Labels
A-resolve Area: Name resolution C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@pietroalbini
Copy link
Member

Some crates are failing in 1.30 beta with errors like this one:

 error[E0432]: unresolved import `geometry::Isometry`
   --> /cargo-home/registry/src/gh.neting.cc-1ecc6299db9ec823/nalgebra-0.15.3/src/base/cg.rs:15:16
    |
 15 | use geometry::{Isometry, IsometryMatrix3, Orthographic3, Perspective3, Point, Point3, Rotation2,
    |                ^^^^^^^^ no `Isometry` in `geometry`. Did you mean to use `isometry`?

cc @petrochenkov

@pietroalbini pietroalbini added A-resolve Area: Name resolution I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. C-bug Category: This is a bug. labels Sep 22, 2018
@pietroalbini pietroalbini added this to the 1.30 milestone Sep 22, 2018
@petrochenkov petrochenkov self-assigned this Sep 22, 2018
@petrochenkov
Copy link
Contributor

petrochenkov commented Sep 23, 2018

The root issue is in the nalgebra crate and it's something that was fixed between nalgebra 0.16.0 and nalgebra 0.16.1.

EDIT: nalgebra 0.16.1 removed use serde; imports, almost certainly as a response to this regression.

@icefoxen
Copy link
Contributor

icefoxen commented Sep 23, 2018

The ipfs-api crate does not use nlagebra at all. All of these build logs seem to have something wrong with serde involved; for example, ipfs-api gets a lot of errors associated with its use of #[serde(rename_all = "PascalCase")], along the lines of:


Sep 21 17:09:54.166 INFO kablam! error: cannot determine resolution for the attribute macro `serde`
Sep 21 17:09:54.166 INFO kablam!   --> /cargo-home/registry/src/gh.neting.cc-1ecc6299db9ec823/nalgebra-0.15.3/src/linalg/symmetric_tridiagonal.rs:16:5
Sep 21 17:09:54.166 INFO kablam!    |
Sep 21 17:09:54.166 INFO kablam! 16 |     serde(
Sep 21 17:09:54.166 INFO kablam!    |     ^^^^^
Sep 21 17:09:54.166 INFO kablam!    |
Sep 21 17:09:54.166 INFO kablam!    = note: import resolution is stuck, try simplifying macro imports

All the other build logs appear to have "undefined type or module" along with the error import resolution is stuck, try simplifying macro imports. Removing the serde annotations from ipfs-api lets it build successfully, though the protocol it speaks is then incorrect.

@petrochenkov
Copy link
Contributor

Yes, ipfs-api is a separate case (probably with the same underlying issue in rustc) and it's already tracked separately in #54386, the other regressed crates use nalgebra.

@icefoxen
Copy link
Contributor

Aha, thanks!

@petrochenkov
Copy link
Contributor

Minimized:

#![allow(unused)]

#[macro_use]
extern crate serde_derive;

use self::one::*;
use self::two::*;

mod serde {}

mod one {
    use serde;

    #[derive(Serialize)]
    #[serde]
    struct One;
}

mod two {
    use serde;

    #[derive(Serialize)]
    #[serde]
    struct Two;
}

fn main() {}

@petrochenkov
Copy link
Contributor

Fixed in #54518
All the crates listed in #54471 (comment) build successfully now.

pietroalbini added a commit to pietroalbini/rust that referenced this issue Sep 25, 2018
resolve: Do not block derive helper resolutions on single import resolutions

Derive helpers currently conflict with anything else, so if some resolution from a single import appears later, it will result in error anyway.

Fixes rust-lang#54471 (stable-to-beta regression)

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants