Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change visit api #61554

Merged
merged 2 commits into from
Jun 6, 2019
Merged

Change visit api #61554

merged 2 commits into from
Jun 6, 2019

Conversation

spastorino
Copy link
Member

@spastorino spastorino commented Jun 5, 2019

r? @oli-obk

In the first commit of this PR, I'm changing visit_place to be the function that traverses the Place and have only that responsibility. Then there are two other functions visit_place_base and visit_projection which are the ones in charge of visiting the base and the projection. Visitor implementors can implement any of those.

In the second commit we can already see some things that confuses me, which I think this division will make more clear. The old code, first checked if the place was a base, did something with it and then called super_place here. super_place checks again if it's a base here and in case is a local, visits the local and stuff like that. That's not very obvious on the code, and if I'm not wrong it's not needed. In this PR or we have this as I did or we can just do - => self.super_place_base(...) and that will be obvious that I'm letting the default implementation process the base.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 5, 2019
@spastorino spastorino changed the title [WIP] Change visit api Change visit api Jun 5, 2019
@spastorino
Copy link
Member Author

I've processed the rest of the visit_place implementations and most are unaffected because they do not even care about the default implementation and they roll their own way of traversing Place.

So this ends being a little change that I think it's a bit better but may not worth applying, unsure to be honest :).

@spastorino
Copy link
Member Author

spastorino commented Jun 5, 2019

In particular, having visit_place_base help in cases like 3754891#diff-e682b38b565035a82f29560c3b79144bR208. The code there could have been just self.visit_place_base(place_base, context, location)

@oli-obk
Copy link
Contributor

oli-obk commented Jun 6, 2019

The old code, first checked if the place was a base, did something with it and then called super_place here. super_place checks again if it's a base here and in case is a local, visits the local and stuff like that. That's not very obvious on the code, and if I'm not wrong it's not needed. In this PR or we have this as I did or we can just do - => self.super_place_base(...) and that will be obvious that I'm letting the default implementation process the base.

I think just leaving a comment on the _ => arm will clear up that logic way more than calling super_place_base without that actually being needed. Just leave a comment mentioning that Local has no relevance for the collector and a FIXME for StaticKind::Promoted as per https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/collector.20collects.20optimized.20out.20promoteds

@oli-obk
Copy link
Contributor

oli-obk commented Jun 6, 2019

So this ends being a little change that I think it's a bit better but may not worth applying, unsure to be honest :).

I like it, and we're going to "need it" (in some form) anyway when moving to slice projections.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 6, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Jun 6, 2019

📌 Commit 67197e2 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 6, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 6, 2019
Change visit api

r? @oli-obk

In the [first commit](rust-lang@37386d3) of this PR, I'm changing `visit_place` to be the function that traverses the `Place` and have only that responsibility. Then there are two other functions `visit_place_base` and `visit_projection` which are the ones in charge of visiting the base and the projection. Visitor implementors can implement any of those.

In the [second commit](rust-lang@e786f63) we can already see some things that confuses me, which I think this division will make more clear. The old code, first checked if the place was a base, did something with it and then called `super_place` [here](rust-lang@e786f63#diff-d583e4efe1a72516e274158e53223633L678). `super_place` checks again if it's a base [here](https://github.com/rust-lang/rust/blob/master/src/librustc/mir/visit.rs#L679-L684) and in case is a local, visits the local and stuff like that. That's not very obvious on the code, and if I'm not wrong it's not needed. In this PR or we have [this](rust-lang@e786f63#diff-d583e4efe1a72516e274158e53223633R673) as I did or we can just do `- => self.super_place_base(...)` and that will be obvious that I'm letting the default implementation process the base.
@bors
Copy link
Contributor

bors commented Jun 6, 2019

⌛ Testing commit 67197e2 with merge 8d380c4fe5c3cf00b5231cdd14d49bf50d9f5996...

@bors
Copy link
Contributor

bors commented Jun 6, 2019

💔 Test failed - checks-travis

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-distcheck of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:03:47]    Compiling aho-corasick v0.7.3
[00:03:47]    Compiling bstr v0.1.4
[00:03:47]    Compiling quote v0.6.12
[00:03:49]    Compiling clap v2.33.0
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:55:6
[00:03:49]    |
[00:03:49] 55 | impl SeedableRng for StdRng {
[00:03:49]    |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
[00:03:49]    |
[00:03:49]    |
[00:03:49] 50 | impl SeedableRng for IsaacRng {
[00:03:49]    |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]    |
[00:03:49]    |
[00:03:49] 96 | impl SeedableRng for Isaac64Rng {
[00:03:49]    |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 198 | impl SeedableRng for Hc128Rng {
[00:03:49]     |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 239 | impl SeedableRng for XorShiftRng {
[00:03:49]     |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 279 | impl SeedableRng for StdRng {
[00:03:49]     |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:73:5
[00:03:49]    |
[00:03:49] 73 |     rng: *mut ReseedingRng<Hc128Core, EntropyRng>,
[00:03:49]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:73:5
[00:03:49]    |
[00:03:49] 73 |     rng: *mut ReseedingRng<Hc128Core, EntropyRng>,
[00:03:49]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:49] 76 | / thread_local!(
[00:03:49] 76 | / thread_local!(
[00:03:49] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:49] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:49] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:49] 85 | |     }
[00:03:49] 86 | | );
[00:03:49] 86 | | );
[00:03:49]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:49]    |
[00:03:49] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:49]    |
[00:03:49] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:49] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:49] 90 | |       Rsdr: RngCore;
[00:03:49]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:03:49] 
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:56:5
[00:03:49]    |
[00:03:49] 56 |     type Seed = <Hc128Rng as SeedableRng>::Seed;
[00:03:49]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]   --> /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:58:5
[00:03:49]    |
[00:03:49] 58 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:49] 59 | |         StdRng(Hc128Rng::from_seed(seed))
[00:03:49] 60 | |     }
[00:03:49]    | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
[00:03:49]    |
[00:03:49]    |
[00:03:49] 51 |     type Seed = <rand_isaac::IsaacRng as SeedableRng>::Seed;
[00:03:49]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
[00:03:49]    |
[00:03:49]    |
[00:03:49] 53 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:49] 54 | |         IsaacRng(rand_isaac::IsaacRng::from_seed(seed))
[00:03:49] 55 | |     }
[00:03:49]    | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]    |
[00:03:49]    |
[00:03:49] 97 |     type Seed = <rand_isaac::Isaac64Rng as SeedableRng>::Seed;
[00:03:49]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 99  | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:49] 100 | |         Isaac64Rng(rand_isaac::Isaac64Rng::from_seed(seed))
[00:03:49] 101 | |     }
[00:03:49]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 199 |     type Seed = <rand_hc::Hc128Rng as SeedableRng>::Seed;
[00:03:49]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 201 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:49] 202 | |         Hc128Rng(rand_hc::Hc128Rng::from_seed(seed))
[00:03:49] 203 | |     }
[00:03:49]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 240 |     type Seed = <::rand_xorshift::XorShiftRng as SeedableRng>::Seed;
[00:03:49]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 242 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:49] 243 | |         XorShiftRng(::rand_xorshift::XorShiftRng::from_seed(seed))
[00:03:49] 244 | |     }
[00:03:49]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 280 |     type Seed = <rngs::StdRng as SeedableRng>::Seed;
[00:03:49]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:49] 
[00:03:49] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:49]     |
[00:03:49]     |
[00:03:49] 282 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:49] 283 | |         StdRng(rngs::StdRng::from_seed(seed))
[00:03:49] 284 | |     }
[00:03:49]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] error: aborting due to 28 previous errors
[00:03:50] 
[00:03:50] For more information about this error, try `rustc --explain E0277`.
[00:03:50] error: Could not compile `rand`.
[00:03:50] error: Could not compile `rand`.
[00:03:50] warning: build failed, waiting for other jobs to finish...
[00:03:57] error: failed to compile `cargo-vendor v0.1.22`, intermediate artifacts can be found at `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools`
[00:03:57] Caused by:
[00:03:57]   build failed
[00:03:57] 
[00:03:57] 
[00:03:57] 
[00:03:57] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "install" "-j" "4" "--locked" "--color" "always" "--force" "--debug" "--vers" "0.1.22" "cargo-vendor"
[00:03:57] 
[00:03:57] 
[00:03:57] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test distcheck
[00:03:57] Build completed unsuccessfully in 0:00:43
---
travis_time:end:17ec3135:start=1559838471267041825,finish=1559838471284599906,duration=17558081
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02dc8d00
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:2058126c
travis_time:start:2058126c
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:020e3d5d
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 6, 2019
@pietroalbini
Copy link
Member

The rand crate broke.
@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 6, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 6, 2019
Change visit api

r? @oli-obk

In the [first commit](rust-lang@37386d3) of this PR, I'm changing `visit_place` to be the function that traverses the `Place` and have only that responsibility. Then there are two other functions `visit_place_base` and `visit_projection` which are the ones in charge of visiting the base and the projection. Visitor implementors can implement any of those.

In the [second commit](rust-lang@e786f63) we can already see some things that confuses me, which I think this division will make more clear. The old code, first checked if the place was a base, did something with it and then called `super_place` [here](rust-lang@e786f63#diff-d583e4efe1a72516e274158e53223633L678). `super_place` checks again if it's a base [here](https://github.com/rust-lang/rust/blob/master/src/librustc/mir/visit.rs#L679-L684) and in case is a local, visits the local and stuff like that. That's not very obvious on the code, and if I'm not wrong it's not needed. In this PR or we have [this](rust-lang@e786f63#diff-d583e4efe1a72516e274158e53223633R673) as I did or we can just do `- => self.super_place_base(...)` and that will be obvious that I'm letting the default implementation process the base.
bors added a commit that referenced this pull request Jun 6, 2019
Rollup of 5 pull requests

Successful merges:

 - #61376 (Add Bound::cloned())
 - #61554 (Change visit api)
 - #61559 (Make visitors iterate)
 - #61585 (Update .mailmap with my name)
 - #61591 (Update .mailmap)

Failed merges:

r? @ghost
@bors bors merged commit 67197e2 into rust-lang:master Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants