-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #93593 - JulianKnodt:master, r=oli-obk
Fix ret > 1 bound if shadowed by const Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present. cc ``````@compiler-errors`````` Should Fix #93553
- Loading branch information
Showing
4 changed files
with
63 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Checking that none of these ICE, which was introduced in | ||
// https://github.com/rust-lang/rust/issues/93553 | ||
trait Foo { | ||
type Bar; | ||
} | ||
|
||
trait Baz: Foo { | ||
const Bar: Self::Bar; | ||
} | ||
|
||
trait Baz2: Foo { | ||
const Bar: u32; | ||
|
||
fn foo() -> Self::Bar; | ||
} | ||
|
||
trait Baz3 { | ||
const BAR: usize; | ||
const QUX: Self::BAR; | ||
//~^ ERROR found associated const | ||
} | ||
|
||
fn main() {} |
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,8 @@ | ||
error: found associated const `BAR` when type was expected | ||
--> $DIR/shadowed-const.rs:19:14 | ||
| | ||
LL | const QUX: Self::BAR; | ||
| ^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|