forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#133521 - compiler-errors:structurally-resolve-cat-proj, r=lcnr Structurally resolve before matching on type of projection Another missing structural resolve in closure upvar analysis. I think it's better to place the normalization here rather than trying to guarantee that all types returned by the expr use visitor are structurally normalized, which I don't think we do now. Thoughts? r? lcnr
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 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
20 changes: 20 additions & 0 deletions
20
tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs
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,20 @@ | ||
//@ check-pass | ||
//@ compile-flags: -Znext-solver | ||
|
||
trait Mirror { | ||
type Assoc; | ||
} | ||
impl<T> Mirror for T { | ||
type Assoc = T; | ||
} | ||
|
||
struct Place { | ||
field: <&'static [u8] as Mirror>::Assoc, | ||
} | ||
|
||
fn main() { | ||
let local = Place { field: &[] }; | ||
let z = || { | ||
let y = &local.field[0]; | ||
}; | ||
} |