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

syntax: Keep token span as a part of Token #61541

Merged
merged 14 commits into from
Jun 7, 2019
Merged

Conversation

petrochenkov
Copy link
Contributor

In the world with proc macros and edition hygiene Token without a span is not self-contained.
In practice this means that tokens and spans are always stored and passed somewhere along with each other.
This PR combines them into a single struct by doing the next renaming/replacement:

  • Token -> TokenKind
  • TokenAndSpan -> Token
  • (Token, Span) -> Token

Some later commits (fb6e2fe and 1cdee86) remove duplicate spans in token::Ident and token::Lifetime.
Those spans were supposed to be identical to token spans, but could easily go out of sync, as was noticed in #60965 (comment).
The (Token, Span) -> Token change is a soft pre-requisite for this de-duplication since it allows to avoid some larger churn (passing spans to most of functions classifying identifiers).

@rust-highfive

This comment has been minimized.

src/librustdoc/html/highlight.rs Show resolved Hide resolved
src/libsyntax/parse/lexer/mod.rs Outdated Show resolved Hide resolved
src/libsyntax/ext/tt/macro_rules.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/literal.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/parser.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/parser.rs Outdated Show resolved Hide resolved
src/libsyntax/parse/token.rs Outdated Show resolved Hide resolved
src/libsyntax/mut_visit.rs Show resolved Hide resolved
@rust-highfive

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 6, 2019

r=me with visit_ident fixed and a comment on prev_span

@bors
Copy link
Contributor

bors commented Jun 6, 2019

☔ The latest upstream changes (presumably #57428) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 6, 2019
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 6, 2019
@bors
Copy link
Contributor

bors commented Jun 6, 2019

⌛ Testing commit 3a31f06 with merge 03d5df4e519af16adb22146dbccabfda5f4db633...

@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 bstr v0.1.4
[00:03:48]    Compiling quote v0.6.12
[00:03:49]    Compiling clap v2.33.0
[00:03:49]    Compiling tar v0.4.26
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:55:6
[00:03:50]    |
[00:03:50] 55 | impl SeedableRng for StdRng {
[00:03:50]    |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
[00:03:50]    |
[00:03:50]    |
[00:03:50] 50 | impl SeedableRng for IsaacRng {
[00:03:50]    |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]    |
[00:03:50]    |
[00:03:50] 96 | impl SeedableRng for Isaac64Rng {
[00:03:50]    |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 198 | impl SeedableRng for Hc128Rng {
[00:03:50]     |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 239 | impl SeedableRng for XorShiftRng {
[00:03:50]     |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 279 | impl SeedableRng for StdRng {
[00:03:50]     |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:73:5
[00:03:50]    |
[00:03:50] 73 |     rng: *mut ReseedingRng<Hc128Core, EntropyRng>,
[00:03:50]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:73:5
[00:03:50]    |
[00:03:50] 73 |     rng: *mut ReseedingRng<Hc128Core, EntropyRng>,
[00:03:50]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
[00:03:50] 76 | / thread_local!(
[00:03:50] 76 | / thread_local!(
[00:03:50] 77 | |     static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
[00:03:50] 78 | |         let mut entropy_source = EntropyRng::new();
[00:03:50] 79 | |         let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
[00:03:50] 85 | |     }
[00:03:50] 86 | | );
[00:03:50] 86 | | );
[00:03:50]    | |__^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
[00:03:50]    |
[00:03:50] note: required by `rngs::adapter::reseeding::ReseedingRng`
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
[00:03:50]    |
[00:03:50] 88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
[00:03:50] 89 | | where R: BlockRngCore + SeedableRng,
[00:03:50] 90 | |       Rsdr: RngCore;
[00:03:50]    = 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:50] 
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:56:5
[00:03:50]    |
[00:03:50] 56 |     type Seed = <Hc128Rng as SeedableRng>::Seed;
[00:03:50]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]   --> /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:58:5
[00:03:50]    |
[00:03:50] 58 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:50] 59 | |         StdRng(Hc128Rng::from_seed(seed))
[00:03:50] 60 | |     }
[00:03:50]    | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
[00:03:50]    |
[00:03:50]    |
[00:03:50] 51 |     type Seed = <rand_isaac::IsaacRng as SeedableRng>::Seed;
[00:03:50]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
[00:03:50]    |
[00:03:50]    |
[00:03:50] 53 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:50] 54 | |         IsaacRng(rand_isaac::IsaacRng::from_seed(seed))
[00:03:50] 55 | |     }
[00:03:50]    | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]    |
[00:03:50]    |
[00:03:50] 97 |     type Seed = <rand_isaac::Isaac64Rng as SeedableRng>::Seed;
[00:03:50]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 99  | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:50] 100 | |         Isaac64Rng(rand_isaac::Isaac64Rng::from_seed(seed))
[00:03:50] 101 | |     }
[00:03:50]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 199 |     type Seed = <rand_hc::Hc128Rng as SeedableRng>::Seed;
[00:03:50]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 201 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:50] 202 | |         Hc128Rng(rand_hc::Hc128Rng::from_seed(seed))
[00:03:50] 203 | |     }
[00:03:50]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 240 |     type Seed = <::rand_xorshift::XorShiftRng as SeedableRng>::Seed;
[00:03:50]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 242 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:50] 243 | |         XorShiftRng(::rand_xorshift::XorShiftRng::from_seed(seed))
[00:03:50] 244 | |     }
[00:03:50]     | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 280 |     type Seed = <rngs::StdRng as SeedableRng>::Seed;
[00:03:50]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
[00:03:50] 
[00:03:50] error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
[00:03:50]     |
[00:03:50]     |
[00:03:50] 282 | /     fn from_seed(seed: Self::Seed) -> Self {
[00:03:50] 283 | |         StdRng(rngs::StdRng::from_seed(seed))
[00:03:50] 284 | |     }
[00:03:50]     | |_____^ 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:44
---
travis_time:end:17d3e890:start=1559838006442776570,finish=1559838006448734402,duration=5957832
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1ece8eb4
$ 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:02aff458
travis_time:start:02aff458
$ 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:0b477f4c
$ 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
@bors
Copy link
Contributor

bors commented Jun 7, 2019

⌛ Testing commit 3a31f06 with merge ca1bcfd...

bors added a commit that referenced this pull request Jun 7, 2019
syntax: Keep token span as a part of `Token`

In the world with proc macros and edition hygiene `Token` without a span is not self-contained.
In practice this means that tokens and spans are always stored and passed somewhere along with each other.
This PR combines them into a single struct by doing the next renaming/replacement:

- `Token` -> `TokenKind`
- `TokenAndSpan` -> `Token`
- `(Token, Span)` -> `Token`

Some later commits (fb6e2fe and 1cdee86) remove duplicate spans in `token::Ident` and `token::Lifetime`.
Those spans were supposed to be identical to token spans, but could easily go out of sync, as was noticed in #60965 (comment).
The `(Token, Span)` -> `Token` change is a soft pre-requisite for this de-duplication since it allows to avoid some larger churn (passing spans to most of functions classifying identifiers).
@bors
Copy link
Contributor

bors commented Jun 7, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing ca1bcfd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 7, 2019
@bors bors merged commit 3a31f06 into rust-lang:master Jun 7, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 7, 2019
parser: Remove `Deref` impl from `Parser`

Follow up to rust-lang#61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank
Centril added a commit to Centril/rust that referenced this pull request Jun 7, 2019
parser: Remove `Deref` impl from `Parser`

Follow up to rust-lang#61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank
Centril added a commit to Centril/rust that referenced this pull request Jun 7, 2019
parser: Remove `Deref` impl from `Parser`

Follow up to rust-lang#61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank
Centril added a commit to Centril/rust that referenced this pull request Jun 8, 2019
parser: Remove `Deref` impl from `Parser`

Follow up to rust-lang#61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank
@petrochenkov petrochenkov deleted the tsp branch June 8, 2019 15:47
Centril added a commit to Centril/rust that referenced this pull request Jun 8, 2019
 syntax: Remove `Deref` impl from `Token`

Follow up to rust-lang#61541

r? @oli-obk
}
}

impl PartialEq<TokenKind> for Token {
Copy link
Member

@matklad matklad Jul 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This impl is technically "wrong": it's not symmetric, and, if we made it symmetric, it would not be transitive.

I've tried to remove it, but got a dozen of screen-fulls of errors :D So I guess it's better to leave it as is: seems harmless, even if surprising a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants