-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #93892 - compiler-errors:issue-92917, r=jackh726,niko…
…matsakis Only mark projection as ambiguous if GAT substs are constrained A slightly more targeted version of #92917, where we only give up with ambiguity if we infer something about the GATs substs when probing for a projection candidate. fixes #93874 also note (but like the previous PR, does not fix) #91762 r? `@jackh726` cc `@nikomatsakis` who reviewed #92917
- Loading branch information
Showing
6 changed files
with
101 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// check-pass | ||
|
||
#![feature(generic_associated_types)] | ||
|
||
pub trait Build { | ||
type Output<O>; | ||
fn build<O>(self, input: O) -> Self::Output<O>; | ||
} | ||
|
||
pub struct IdentityBuild; | ||
impl Build for IdentityBuild { | ||
type Output<O> = O; | ||
fn build<O>(self, input: O) -> Self::Output<O> { | ||
input | ||
} | ||
} | ||
|
||
fn a() { | ||
let _x: u8 = IdentityBuild.build(10); | ||
} | ||
|
||
fn b() { | ||
let _x: Vec<u8> = IdentityBuild.build(Vec::new()); | ||
} | ||
|
||
fn c() { | ||
let mut f = IdentityBuild.build(|| ()); | ||
(f)(); | ||
} | ||
|
||
pub fn main() { | ||
a(); | ||
b(); | ||
c(); | ||
} |