Repository navigation
Description
Hello
After upgrading nightly rustc, I'm getting a lot of type inference errors on code that was compiling fine previously. Moreover, these are not at the call site, but at the definition site, so there doesn't seem to be any place to put any type annotations, like this:
--> src/spirit.rs:996:1
|
996 | / impl<O, C> SpiritBuilder for Builder<O, C>
997 | | where
998 | | Self::Config: DeserializeOwned + Send + Sync + 'static,
999 | | Self::Opts: StructOpt + Sync + Send + 'static,
... |
1108 | | }
1109 | | }
| |_^ cannot infer type for type parameter `C`
It spills more kinds of errors that make little sense, but I have the impression these will have a common cause:
error[E0277]: `C` cannot be shared between threads safely
--> src/spirit.rs:998:45
|
998 | Self::Config: DeserializeOwned + Send + Sync + 'static,
| ^^^^ `C` cannot be shared between threads safely
The problematic code is both released on crates.io (crate spirit, version 0.4.16, but I expect that to be happening through most of the history of the crate), and in master (vorner/spirit@1495c1c).
I think this is a regression, as it was compiling previously.
It compiles fine with older nightly (and stable is fine way back, this particular code is looking mostly the same for some 2 years or more):
rustc 1.53.0-nightly (07e0e2ec2 2021-03-24)
Breaks with
rustc 1.53.0-nightly (6df26f897 2021-04-20)
binary: rustc
commit-hash: 6df26f897cffb2d86880544bb451c6b5f8509b2d
commit-date: 2021-04-20
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0
(Unfortunately, I haven't been keeping fully up to date recently, so I don't have a smaller range).
Activity
hameerabbasi commentedon Apr 21, 2021
Bisected:
searched nightlies: from nightly-2021-01-01 to nightly-2021-04-20
regressed nightly: nightly-2021-04-01
searched commits: from 74874a6 to 4fdac23
regressed commit: 4fdac23
bisected with cargo-bisect-rustc v0.6.0
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
Regressed PR is #76814, cc @jackh726.
jackh726 commentedon Apr 21, 2021
An MCVE would be extremely helpful here.
hameerabbasi commentedon Apr 21, 2021
@rustbot ping icebreakers-cleanup-crew
I've tried without success to reduce this, it's buried in layers of crates. Maybe one of you will have better luck.
rustbot commentedon Apr 21, 2021
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3
cc @AminArria @camelid @chrissimpkins @contrun @DutchGhost @elshize @h-michael @HallerPatrick @hdhoang @hellow554 @henryboisdequin @imtsuki @JamesPatrickGill @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @shekohex @sinato @smmalis37 @steffahn @Stupremee @tamuhey @turboladen @woshilapin @yerke
SNCPlay42 commentedon Apr 22, 2021
Reduced:
apiraino commentedon Apr 22, 2021
Assigning priority as discussed as part of the Prioritization Working Group and removing
I-prioritize.@rustbot label -I-prioritize +P-high
b-naber commentedon Apr 23, 2021
I can try to look into this over the weekend.
jackh726 commentedon Apr 23, 2021
So, a bit of info: We end up trying to prove
C: Sized. We end up with two candidates:and
that both evaluate to okay. This is ambiguous and WF checking fails.
emilyalbini commentedon May 4, 2021
This regression now slipped into beta 1.53.0.
Auto merge of rust-lang#84559 - jackh726:issue-84398, r=nikomatsakis