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

romaji fails to build on beta, #55810

Closed
Mark-Simulacrum opened this issue Nov 9, 2018 · 8 comments
Closed

romaji fails to build on beta, #55810

Mark-Simulacrum opened this issue Nov 9, 2018 · 8 comments
Assignees
Labels
P-high High priority 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.

Comments

@Mark-Simulacrum
Copy link
Member

romaji, cc @uzimith

With a few minutes of time invested I wasn't able to narrow this down to a smaller example that still succeeded on stable.

! 
Nov 02 07:32:11.418 INFO kablam! error[E0282]: type annotations needed
Nov 02 07:32:11.418 INFO kablam!   --> src/romaji.rs:80:24
Nov 02 07:32:11.418 INFO kablam!    |
Nov 02 07:32:11.418 INFO kablam! 80 |                 x if x.is_youon() && buffer.is_katakana() => {
Nov 02 07:32:11.419 INFO kablam!    |                        ^^^^^^^^ cannot infer type for `T`
Nov 02 07:32:11.419 INFO kablam!    |
Nov 02 07:32:11.419 INFO kablam!    = note: type must be known at this point

cc @rust-lang/libs

@Mark-Simulacrum Mark-Simulacrum added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Nov 9, 2018
@dtolnay
Copy link
Member

dtolnay commented Nov 9, 2018

Minimized:

struct S;

impl S {
    fn method(&self) -> bool {
        unimplemented!()
    }
}

fn get<T>() -> T {
    unimplemented!()
}

fn main() {
    match get() {
        x if x.method() => {}
        &S => {}
    }
}

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

dtolnay commented Nov 9, 2018

@rust-lang/compiler because this doesn't look to be caused by a library change.

@pnkfelix
Copy link
Member

pnkfelix commented Nov 9, 2018

Hmm I wonder if this is some sort of bad interaction between 1. the new way to do pat variables in guards (which is activated by NLL) and 2. Method lookup and/or autoref...

... but this test isn’t asking for the 2018 edition, right? (I think we are still building the old style MIR if you don’t request NLL. But maybe that changed ...)

@pnkfelix pnkfelix self-assigned this Nov 9, 2018
@pnkfelix pnkfelix added the P-high High priority label Nov 9, 2018
@eddyb
Copy link
Member

eddyb commented Nov 9, 2018

This can be caused by the typeck order. To make this work, all arms' patterns must be checked before any guards are.

@pnkfelix
Copy link
Member

pnkfelix commented Nov 9, 2018

This was injected between rustc 1.31.0-nightly (46880f4 2018-10-15) and rustc 1.31.0-nightly (bef62cc 2018-10-16)

Log of bors commits in that time in the details block

% git log 46880f4..bef62cc --author bors --format=oneline
bef62cc Auto merge of #54486 - orium:obligation-forest-graphviz, r=nikomatsakis
8a7048b Auto merge of #54251 - varkor:silence-bad_style, r=Manishearth
99ab2f4 Auto merge of #54937 - alexcrichton:update-stdsimd, r=nikomatsakis
5ea8eb5 Auto merge of #55067 - ljedrz:generic_iterator_related_improvements, r=petrochenkov
df0d6ad Auto merge of #55023 - euclio:llvm-error-handler, r=cuviper

@pnkfelix
Copy link
Member

pnkfelix commented Nov 9, 2018

Hmm this line in the description of #55067 set off some alarm bells in my head:

typeck: don't collect into a vector when unnecessary

pietroalbini added a commit to pietroalbini/rust that referenced this issue Nov 10, 2018
…ts-eagerly, r=oli-obk

Typecheck patterns of all match arms first, so we get types for bindings

Fix eventually (after backport to beta) the issue rust-lang#55810
bors added a commit that referenced this issue Nov 12, 2018
…, r=estebank

[beta] backport rollup (typeck match arms eagerly; add rustc_promotable to unsigneds)

Backport of 5f91373 from (beta-accepted) PR #55819

Fix #55810
Fix #55806
@goffrie
Copy link
Contributor

goffrie commented Nov 14, 2018

Fixed by #55893?

@dtolnay
Copy link
Member

dtolnay commented Nov 14, 2018

Confirmed fixed as of nightly-2018-11-12 -- rustc 1.32.0-nightly (ca79ecd 2018-11-11) -- and rustc 1.31.0-beta.9 (c341a59 2018-11-12).

@dtolnay dtolnay closed this as completed Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-high High priority 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

5 participants