{"push_id":2903765841,"size":10,"distinct_size":0,"ref":"refs/heads/master","head":"3a2190a9cd4e38a9543ff697dd51ca8b6b68f50d","before":"5c875d93855c6d577962b0f74f17374f37b219c9","commits":[{"sha":"ced5c2d08af52de40d104687c2b6066d9daedecf","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Add \"Shallow\" borrow kind\n\nThis allows treating the \"fake\" match borrows differently from shared\nborrows.","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/ced5c2d08af52de40d104687c2b6066d9daedecf"},{"sha":"b55bb2e918560509418a8b79f8ce5aa2c0d5aaff","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Better messages for errors from Shallow borrows","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/b55bb2e918560509418a8b79f8ce5aa2c0d5aaff"},{"sha":"a6fad3f620ac14f57da080863dabcdc6b78005b1","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Add more fake borrows to matches","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/a6fad3f620ac14f57da080863dabcdc6b78005b1"},{"sha":"46e247bcec13f3e1e850c3baffc23e64a8023ae4","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Don't check for conflicting borrows of `ReadForMatch`es","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/46e247bcec13f3e1e850c3baffc23e64a8023ae4"},{"sha":"c5047cb4944297566d236a663bbbba00f2f25cd0","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Add tests for new match borrows","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/c5047cb4944297566d236a663bbbba00f2f25cd0"},{"sha":"1a6ed0271e7cc8864e6030d945b92aaa850e4afe","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Update ui tests","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/1a6ed0271e7cc8864e6030d945b92aaa850e4afe"},{"sha":"f71f733d482d892b5bff021b3955435e7b3eee25","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Add a MIR transform to remove fake reads\n\nAs we are now creating borrows of places that may not be valid for\nborrow checking matches, these have to be removed to avoid generating\nbroken code.","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/f71f733d482d892b5bff021b3955435e7b3eee25"},{"sha":"531e98a0d80af18da51a0bec6a39b0c9d7e33fb4","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Update mir opt tests","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/531e98a0d80af18da51a0bec6a39b0c9d7e33fb4"},{"sha":"a830732090d49c799b3e97e70c1c4e5c011a784c","author":{"name":"Matthew Jasper","email":"9ec4e938755e2ac88d88ea856168edcfd817d028@gmail.com"},"message":"Rename places_conflict to borrow_conflicts_with_place\n\nThis name better reflects the asymmetry of this function.","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/a830732090d49c799b3e97e70c1c4e5c011a784c"},{"sha":"3a2190a9cd4e38a9543ff697dd51ca8b6b68f50d","author":{"name":"bors","email":"3a2c29237f73c7cf88424b80e427b1884f346b35@rust-lang.org"},"message":"Auto merge of #53438 - matthewjasper:permissive-match-access, r=pnkfelix\n\n[NLL] Be more permissive when checking access due to Match\n\nPartially addresses #53114. notably, we should now have parity with AST borrowck. Matching on uninitialized values is still forbidden.\n\n* ~~Give fake borrows for match their own `BorrowKind`~~\n* ~~Allow borrows with this kind to happen on values that are already mutably borrowed.~~\n* ~~Track borrows with this type even behind shared reference dereferences and consider all accesses to be deep when checking for conflicts with this borrow type. See [src/test/ui/issues/issue-27282-mutate-before-diverging-arm-3.rs](https://github.com/rust-lang/rust/commit/cb5c989598178af505fb215dd97afca8cc2b659f#diff-a2126cd3263a1f5342e2ecd5e699fbc6) for an example soundness issue this fixes (a case of #27282 that wasn't handled correctly).~~\n* Create a new `BorrowKind`: `Shallow` (name can be bike-shed)\n* `Shallow` borrows differ from shared borrows in that\n  * When we check for access we treat them as a `Shallow(Some(_))` read\n  * When we check for conflicts with them, if the borrow place is a strict prefix of the access place then we don't consider that a conflict.\n    * For example, a `Shallow` borrow of `x` does not conflict with any access or borrow of `x.0` or `*x`\n* Remove the current fake borrow in matches.\n* When building matches, we take a `Shallow` borrow of any `Place` that we switch on or bind in a match, and any prefix of those places. (There are some optimizations where we do fewer borrows, but this shouldn't change semantics)\n  * `match x { &Some(1) => (),  _ => (), }` would `Shallow` borrow `x`, `*x` and `(*x as Some).0` (the `*x` borrow is unnecessary, but I'm not sure how easy it would be to remove.)\n* Replace the fake discriminant read with a `ReadForMatch`.\n* Change ReadForMatch to only check for initializedness (to prevent `let x: !; match x {}`), but not conflicting borrows. It is still considered a use for liveness and `unsafe` checking.\n* Give special cased error messages for this kind of borrow.\n\nTable from the above issue after this PR\n\n| Thing | AST | MIR | Want | Example |\n| --- | --- | --- | --- |---|\n| `let _ = <unsafe-field>` | 💚  | 💚  | ❌ |  [playground](https://play.rust-lang.org/?gist=bb7843e42fa5318c1043d04bd72abfe4&version=nightly&mode=debug&edition=2015) |\n| `match <unsafe_field> { _ => () }` | ❌  | ❌ | ❌ | [playground](https://play.rust-lang.org/?gist=3e3af05fbf1fae28fab2aaf9412fb2ea&version=nightly&mode=debug&edition=2015) |\n| `let _ = <moved>` | 💚  | 💚 | 💚 | [playground](https://play.rust-lang.org/?gist=91a6efde8288558e584aaeee0a50558b&version=nightly&mode=debug&edition=2015) |\n| `match <moved> { _ => () }` | ❌ | ❌  | 💚 | [playground](https://play.rust-lang.org/?gist=804f8185040b2fe131f2c4a64b3048ca&version=nightly&mode=debug&edition=2015) |\n| `let _ = <borrowed>` | 💚  | 💚 | 💚 | [playground](https://play.rust-lang.org/?gist=0e487c2893b89cb772ec2f2b7c5da876&version=nightly&mode=debug&edition=2015) |\n| `match <borrowed> { _ => () }` | 💚  | 💚 | 💚 | [playground](https://play.rust-lang.org/?gist=0e487c2893b89cb772ec2f2b7c5da876&version=nightly&mode=debug&edition=2015) |\n\nr? @nikomatsakis","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-rust/commits/3a2190a9cd4e38a9543ff697dd51ca8b6b68f50d"}]}
{"actor":{"display_login":"fuchsia-infra-bot"}}