forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#68399 - Centril:check-match-unify, r=oli-obk
check_match: misc unifications and ICE fixes These are some unifications made as a by-product of working on `hir::ExprKind::Let`. Fixes rust-lang#68396. Fixes rust-lang#68394. Fixes rust-lang#68393. r? @oli-obk @matthewjasper
- Loading branch information
Showing
13 changed files
with
198 additions
and
95 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
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,26 @@ | ||
pub enum EFoo { | ||
A, | ||
} | ||
|
||
pub trait Foo { | ||
const X: EFoo; | ||
} | ||
|
||
struct Abc; | ||
|
||
impl Foo for Abc { | ||
const X: EFoo = EFoo::A; | ||
} | ||
|
||
struct Def; | ||
impl Foo for Def { | ||
const X: EFoo = EFoo::A; | ||
} | ||
|
||
pub fn test<A: Foo, B: Foo>(arg: EFoo, A::X: EFoo) { | ||
//~^ ERROR associated consts cannot be referenced in patterns | ||
let A::X = arg; | ||
//~^ ERROR associated consts cannot be referenced in patterns | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.