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

Type inference regression affecting app_dirs on MacOS #48668

Closed
PlasmaPower opened this issue Mar 2, 2018 · 6 comments
Closed

Type inference regression affecting app_dirs on MacOS #48668

PlasmaPower opened this issue Mar 2, 2018 · 6 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@PlasmaPower
Copy link
Contributor

As seen in this Travis build, app_dirs currently builds on stable but not beta because of a type inference regression.

@nikomatsakis
Copy link
Contributor

The failure is a call to into():

error[E0619]: the type of this value must be known in this context
  --> /Users/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/app_dirs-1.1.1/src/imp/platform/macos.rs:10:40
   |
10 |         Ok(Component::RootDir.as_ref().into())
   |  

as_ref is not really meant to be used this kind of open-ended way, this is a common source of breakage -- that could be the problem.

cc @rust-lang/libs -- any new AsRef impls added recently?

@nikomatsakis nikomatsakis added 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. labels Mar 2, 2018
@nikomatsakis
Copy link
Contributor

Here is a minimized test case:

use std::path::Component;
use std::ffi::OsStr;

fn main() {
    let x: Box<OsStr> = Component::CurDir.as_ref().into();
}

@nikomatsakis
Copy link
Contributor

Tagging as T-compiler for now since I don't immediately see what new impl could have caused this.

@sfackler
Copy link
Member

sfackler commented Mar 2, 2018

Component implements AsRef<Path> in addition to the existing AsRef<OsStr> on beta.

@alexcrichton alexcrichton added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 2, 2018
@alexcrichton
Copy link
Member

Switching relevant team to T-libs as this is almost for sure a T-libs issue rather than a T-compiler issue

@Mark-Simulacrum
Copy link
Member

Closing in favor of #48716.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants