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

Implement arbitrary_enum_discriminant #60732

Merged
merged 1 commit into from Jun 25, 2019

Conversation

@jswrenn
Copy link
Contributor

jswrenn commented May 11, 2019

Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented May 11, 2019

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

src/libsyntax/feature_gate.rs Outdated Show resolved Hide resolved
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented May 11, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:000ff1e0:start=1557579584667717974,finish=1557579671563465249,duration=86895747275
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:27:37] 34 |     Nan,
[00:27:37]    |     ^^^
[00:27:37]    |
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]   --> src/libcore/num/dec2flt/parse.rs:40:5
[00:27:37] 40 |     ShortcutToInf,
[00:27:37]    |     ^^^^^^^^^^^^^
[00:27:37]    |
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]    --> src/libcore/ops/range.rs:696:5
[00:27:37]     |
[00:27:37] 696 |     Unbounded,
[00:27:37] 696 |     Unbounded,
[00:27:37]     |     ^^^^^^^^^
[00:27:37]     |
[00:27:37]     = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]     = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]    --> src/libcore/char/mod.rs:246:5
[00:27:37]     |
[00:27:37] 246 |     Done,
[00:27:37] 246 |     Done,
[00:27:37]     |     ^^^^
[00:27:37]     |
[00:27:37]     = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]     = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]    --> src/libcore/char/mod.rs:436:5
[00:27:37]     |
[00:27:37] 436 |     Zero,
[00:27:37] 436 |     Zero,
[00:27:37]     |     ^^^^
[00:27:37]     |
[00:27:37]     = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]     = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]    --> src/libcore/option.rs:153:5
[00:27:37]     |
[00:27:37] 153 |     None,
[00:27:37] 153 |     None,
[00:27:37]     |     ^^^^
[00:27:37]     |
[00:27:37]     = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]     = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]   --> src/libcore/str/pattern.rs:79:5
[00:27:37]    |
[00:27:37] 79 |     Done
[00:27:37] 79 |     Done
[00:27:37]    |     ^^^^
[00:27:37]    |
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]   --> src/libcore/fmt/rt/v1.rs:40:5
[00:27:37] 40 |     NextParam,
[00:27:37]    |     ^^^^^^^^^
[00:27:37]    |
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]   --> src/libcore/fmt/rt/v1.rs:46:5
[00:27:37] 46 |     Next,
[00:27:37]    |     ^^^^
[00:27:37]    |
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37] error[E0658]: discriminator values can only be used with a field-less enum
[00:27:37]   --> src/libcore/task/poll.rs:25:5
[00:27:37] 25 |     Pending,
[00:27:37]    |     ^^^^^^^
[00:27:37]    |
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[00:27:37]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[00:27:39]    Compiling compiler_builtins v0.1.12
[00:27:39]    Compiling cmake v0.1.38
[00:27:39]    Compiling backtrace-sys v0.1.27
[00:27:41]    Compiling std v0.0.0 (/checkout/src/libstd)
---
travis_time:end:0d073066:start=1557581358570226031,finish=1557581358576864611,duration=6638580
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:149f940c
$ 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:015bde90
travis_time:start:015bde90
$ 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:186ba8ce
$ 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)

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented May 11, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:0a83cb57:start=1557583605861592557,finish=1557583693864257711,duration=88002665154
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[01:14:25] .................................................................................................... 3600/5524
[01:14:29] .................................................................................................... 3700/5524
[01:14:32] ......................................................................................ii............ 3800/5524
[01:14:35] .................................................................................................... 3900/5524
[01:14:38] ........i............................................................F.............................. 4000/5524
[01:14:40] .......................................................................i............................ 4100/5524
[01:14:42] ........................................................F........................................... 4200/5524
[01:14:57] .................................................................................................... 4400/5524
[01:15:01] .................................................................................................... 4500/5524
[01:15:04] .................................................................................................... 4600/5524
[01:15:09] .................................................................................................... 4700/5524
---
[01:15:40] ---- [ui] ui/parser/issue-17383.rs stdout ----
[01:15:40] 
[01:15:40] error: ui test compiled successfully!
[01:15:40] status: exit code: 0
[01:15:40] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/issue-17383.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issue-17383" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issue-17383/auxiliary" "-A" "unused"
[01:15:40] ------------------------------------------
[01:15:40] 
[01:15:40] ------------------------------------------
[01:15:40] stderr:
---
[01:15:40] ---- [ui] ui/parser/tag-variant-disr-non-nullary.rs stdout ----
[01:15:40] 
[01:15:40] error: ui test compiled successfully!
[01:15:40] status: exit code: 0
[01:15:40] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/tag-variant-disr-non-nullary.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/tag-variant-disr-non-nullary" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/tag-variant-disr-non-nullary/auxiliary" "-A" "unused"
[01:15:40] ------------------------------------------
[01:15:40] 
[01:15:40] ------------------------------------------
[01:15:40] stderr:
---
[01:15:40] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:512:22
[01:15:40] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:15:40] 
[01:15:40] 
[01:15:40] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:15:40] 
[01:15:40] 
[01:15:40] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:40] Build completed unsuccessfully in 0:04:48
[01:15:40] Build completed unsuccessfully in 0:04:48
[01:15:40] Makefile:48: recipe for target 'check' failed
[01:15:40] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:01414c8c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat May 11 15:24:04 UTC 2019
---
travis_time:end:04c79209:start=1557588245415754153,finish=1557588245422937059,duration=7182906
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0cbda388
$ 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:02551a73
$ 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)

src/libsyntax/feature_gate.rs Outdated Show resolved Hide resolved
@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented May 12, 2019

Would be nice to get a test case that has some CTFE code involving the new discriminants, just to make sure that works, too.

Cc @oli-obk do you know if this needs adjustments in Miri (specifically in read_discriminant and write_discriminant)?

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented May 13, 2019

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

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented May 13, 2019

do you know if this needs adjustments in Miri (specifically in read_discriminant and write_discriminant)?

No, this requires no changes for anything beyond the AST. Everything else is already setup to handle this.

Some const eval tests would be nice though.

src/libsyntax/parse/parser.rs Outdated Show resolved Hide resolved
@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented May 13, 2019

So... there's this fun comment in the layouting source:

// The current code for niche-filling relies on variant indices
// instead of actual discriminants, so dataful enums with
// explicit discriminants (RFC #2363) would misbehave.
let no_explicit_discriminants = def.variants.iter_enumerated()
.all(|(i, v)| v.discr == ty::VariantDiscr::Relative(i.as_u32()));

I'm guessing you can observe this as follows:

enum Foo {
    A(&'static i32),
    B,
}
enum Bar {
    A(&'static i32) = 0,
    B = 1,
}
assert_eq!(std::mem::size_of::<Foo>() == std::mem::size_of::<usize>());
assert_eq!(std::mem::size_of::<Bar>() > std::mem::size_of::<usize>());
@jswrenn

This comment has been minimized.

Copy link
Contributor Author

jswrenn commented May 13, 2019

@ralph

Would be nice to get a test case that has some CTFE code involving the new discriminants, just to make sure that works, too.

Would something like this fit the bill?

#![feature(arbitrary_enum_discriminant,const_raw_ptr_deref)]

#[allow(dead_code)]
#[repr(u8)]
enum Enum {
    Unit = 3,
    Tuple(u16) = 2,
    Struct {
        a: u8,
        b: u16,
    } = 1,
}

impl Enum {
    const unsafe fn tag(&self) -> u8 {
        *(self as *const Self as *const u8)
    }
}

const UNIT_TAG:   u8 = unsafe { Enum::Unit.tag() };
const TUPLE_TAG:  u8 = unsafe { Enum::Tuple(5).tag() };
const STRUCT_TAG: u8 = unsafe { Enum::Struct{a: 7, b: 11}.tag() };

fn main() {
    assert_eq!(3, UNIT_TAG);
    assert_eq!(2, TUPLE_TAG);
    assert_eq!(1, STRUCT_TAG);
}
@jswrenn

This comment has been minimized.

Copy link
Contributor Author

jswrenn commented May 13, 2019

@oli-obk To be sure I understand correctly: is the expected behavior that both Foo and Bar (being #[repr(Rust)]) should have the same size in that example?

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented May 13, 2019

No, it is perfectly fine for them to have different sizes for now, it's just an implementation detail that we can fix in the future. Maybe add my code as a canary test?

One thing that I'm wondering: the RFC states that the only legal way to get the discriminant back is to start out with a repr(some_int) enum. Would it make sense to forbid arbitrary enum discriminants on other repr enums for now?

One thing that I think should also have a test, too: code matching on an enum with both fields and explicit discriminants.

@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented May 13, 2019

Would something like this fit the bill?

Looks great!
Aren't there also safe conversion casts (x as i32)?

@jswrenn

This comment has been minimized.

Copy link
Contributor Author

jswrenn commented May 13, 2019

@oli-obk

One thing that I'm wondering: the RFC states that the only legal way to get the discriminant back is to start out with a repr(some_int) enum. Would it make sense to forbid arbitrary enum discriminants on other repr enums for now?

I think you're referring to the stipulation that:

enumerations with fields still can't be casted to numeric types with the as operator

As it stands, the functionality enabled by this PR forbids you from as-casting a variant of an enum if any variant has data associated with it. For instance, this is already forbidden:

#![feature(arbitrary_enum_discriminant)]

#[repr(u8)]
#[allow(dead_code)]
enum Enum {
  Unit = 3,
  Tuple(()) = 2,
  Struct {
    a: (),
    b: (),
  } = 1,
}

fn main() {
  println!("{:?}", Enum::Unit as u8);
}

and produces this error:

(Click to Expand)
error[E0605]: non-primitive cast: `Enum` as `u8`
  --> src/main.rs:21:20
   |
21 |   println!("{:?}", Enum::Unit as u8);
   |                    ^^^^^^^^^^^^^^^^
   |
   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait

But this is permitted:

#![feature(arbitrary_enum_discriminant)]

#[allow(dead_code)]
enum Enum {
  Unit = 3,
  Tuple() = 2,
  Struct {} = 1,
}

fn main() {
  assert_eq!(3, Enum::Unit as u8);
  assert_eq!(2, Enum::Tuple() as u8);
  assert_eq!(1, Enum::Struct{} as u8);
}

...and I think it's reasonable and consistent to permit that, since rust already permits writing:

#[allow(dead_code)]
enum Enum {
  Unit,
  Tuple(),
  Struct{},
}

fn main() {
  assert_eq!(0, Enum::Unit as u8);
  assert_eq!(1, Enum::Tuple() as u8);
  assert_eq!(2, Enum::Struct{} as u8);
}

I can't think of a compelling reason to add an explicit repr requirement given the above restrictions.

However, although the RFC explicitly does not enable this functionality, it seems to me like as-casting variants with fields (or something analogous) should be permitted on enums with fields when an explicit repr(inttype) is provided. Since specifying a repr(inttype) enforces both the location and size of the discriminant, and the whole point of this RFC is to let the user explicitly enforce that the discriminant is a particular value, it really seems like there should be a safe, ergonomic mechanism for getting that value back out—unsafe { *(value as *const Self as *const u8) } is quite a mouthful!

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented May 13, 2019

unsafe { *(value as *const Self as *const u8) } is only valid if you are using repr(u8). This is mainly what I was referring to. Since the unsafe pointer magic is the only thing making it possible right now to extract he discriminant value, and it requires repr(u8), I was wondering if we may as well require repr(u8) (or other ints) for enums with variants with fields and explicit discriminants.

@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch from 086669f to 9f155ef May 13, 2019
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented May 13, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:0685591e:start=1557788898174783919,finish=1557788898978183551,duration=803399632
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:01:46] 
######################################################################## 100.0%
[00:01:46] extracting /checkout/obj/build/cache/2019-04-11/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:46]     Updating crates.io index
[00:02:03] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:03] Build completed unsuccessfully in 0:00:30
[00:02:03] make: *** [prepare] Error 1
[00:02:03] Makefile:69: recipe for target 'prepare' failed
[00:02:04] Command failed. Attempt 2/5:
[00:02:04] Command failed. Attempt 2/5:
[00:02:04] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:04] Build completed unsuccessfully in 0:00:00
[00:02:04] Makefile:69: recipe for target 'prepare' failed
[00:02:04] make: *** [prepare] Error 1
[00:02:06] Command failed. Attempt 3/5:
[00:02:06] Command failed. Attempt 3/5:
[00:02:07] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:07] Build completed unsuccessfully in 0:00:00
[00:02:07] make: *** [prepare] Error 1
[00:02:07] Makefile:69: recipe for target 'prepare' failed
[00:02:10] Command failed. Attempt 4/5:
[00:02:10] Command failed. Attempt 4/5:
[00:02:10] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:10] Build completed unsuccessfully in 0:00:00
[00:02:10] make: *** [prepare] Error 1
[00:02:10] Makefile:69: recipe for target 'prepare' failed
[00:02:14] Command failed. Attempt 5/5:
[00:02:14] Command failed. Attempt 5/5:
[00:02:14] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:14] Build completed unsuccessfully in 0:00:00
[00:02:14] Makefile:69: recipe for target 'prepare' failed
[00:02:14] The command has failed after 5 attempts.
[00:02:14] make: *** [prepare] Error 1
---
travis_time:end:007ec59d:start=1557789047435624083,finish=1557789047441760370,duration=6136287
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:22974524
$ 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:1b8482c5
travis_time:start:1b8482c5
$ 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:05c5233d
$ 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)

@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch from 9f155ef to 7d80563 May 14, 2019
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented May 14, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:15deab00:start=1557845082264275994,finish=1557845084734265316,duration=2469989322
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:06:41]    Compiling arena v0.0.0 (/checkout/src/libarena)
[00:06:54]    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
[00:07:05]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:07:09]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:07:19] error[E0425]: cannot find value `arbitrary_enum_discriminant` in module `sym`
[00:07:19]    --> src/libsyntax/feature_gate.rs:558:14
[00:07:19]     |
[00:07:19] 558 |     (active, arbitrary_enum_discriminant, "1.36.0", Some(60553), None),
[00:07:19]     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `sym`
[00:07:19] 
[00:07:19] error[E0425]: cannot find value `arbitrary_enum_discriminant` in module `sym`
[00:07:19]     --> src/libsyntax/feature_gate.rs:2016:25
[00:07:19] 2016 |                         arbitrary_enum_discriminant,
[00:07:19]      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `sym`
[00:07:19] 
[00:07:19] 
[00:07:19] error[E0425]: cannot find value `arbitrary_enum_discriminant` in module `sym`
[00:07:19]     --> src/libsyntax/feature_gate.rs:2028:29
[00:07:19] 2028 |                             arbitrary_enum_discriminant,
[00:07:19]      |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `sym`
[00:07:19] 

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)

@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch from 7d80563 to 8df54a2 May 14, 2019
@jswrenn

This comment has been minimized.

Copy link
Contributor Author

jswrenn commented May 20, 2019

@oli-obk

unsafe { *(value as *const Self as *const u8) } is only valid if you are using repr(u8). This is mainly what I was referring to. Since the unsafe pointer magic is the only thing making it possible right now to extract he discriminant value, and it requires repr(u8), I was wondering if we may as well require repr(u8) (or other ints) for enums with variants with fields and explicit discriminants.

I see your point. I think this is a good idea, and I'll take a stab at it in the next few days!

Implementation wise, I think rustc_typeck::check::check_enum is the best place to add this check.

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented May 22, 2019

(hmm, i'm sorry: I meant to post my change to your doc ( 6c09c00 ) as a suggestion, not as a commit on its own. Feel free to revise that as you like. I'll try to ensure my future suggestions are deployed as intended: i.e., as suggestions, not commits.)

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented May 22, 2019

I have one minor question about the diagnostic code; once that is addressed, r=me.

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Jun 11, 2019

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

@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch from 80cbd32 to d4d82af Jun 11, 2019
@jswrenn

This comment has been minimized.

Copy link
Contributor Author

jswrenn commented Jun 12, 2019

@Centril, github still lists you as 'Requesting Changes', but the unresolved suggestion isn't reachable (because of a rebase), so I cannot mark it as resolved. To the best of my knowledge, I've resolved all issues raised so far.

@Centril Centril dismissed their stale review Jun 12, 2019

done

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 16, 2019

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

@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch 2 times, most recently from 2e0b841 to 9792356 Jun 17, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jun 17, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:058c8c1b:start=1560792532644621900,finish=1560792533506075123,duration=861453223
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[01:00:17] ....................................................................ii...i..ii...................... 3600/5685
[01:00:21] .................................................................................................... 3700/5685
[01:00:25] .................................................................................................... 3800/5685
[01:00:28] ..............................................................................ii.................... 3900/5685
[01:00:31] ...................................................................................................i 4000/5685
[01:00:33] ..........................................................F......................................... 4100/5685
[01:00:35] ...............................................................i.................................... 4200/5685
[01:00:38] ................................................F................................................... 4300/5685
[01:00:56] .................................................................................................... 4500/5685
[01:00:59] .................................................................................................... 4600/5685
[01:01:03] .................................................................................................... 4700/5685
[01:01:07] .................................................................................................... 4800/5685
---
[01:01:43] 
[01:01:43] ---- [ui] ui/parser/issue-17383.rs stdout ----
[01:01:43] diff of stderr:
[01:01:43] 
[01:01:43] - error[E0658]: custom discriminant values are not allowed in enums with fields
[01:01:43] + error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
[01:01:43] 3    |
[01:01:43] 4 LL |     A = 3,
[01:01:43] 
[01:01:43] -    |         ^ invalid custom discriminant
[01:01:43] -    |         ^ invalid custom discriminant
[01:01:43] +    |         ^ disallowed custom discriminant
[01:01:43] 7 LL |     B(usize)
[01:01:43] -    |     -------- variant with a field defined here
[01:01:43] +    |     -------- tuple variant defined here
[01:01:43] 9    |
[01:01:43] 9    |
[01:01:43] 10    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43] 11    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[01:01:43] 
[01:01:43] The actual stderr differed from the expected stderr.
[01:01:43] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issue-17383/issue-17383.stderr
[01:01:43] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issue-17383/issue-17383.stderr
[01:01:43] To update references, rerun the tests and pass the `--bless` flag
[01:01:43] To only update this specific test, also pass `--test-args parser/issue-17383.rs`
[01:01:43] error: 1 errors occurred comparing output.
[01:01:43] status: exit code: 1
[01:01:43] status: exit code: 1
[01:01:43] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/issue-17383.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issue-17383" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/issue-17383/auxiliary" "-A" "unused"
[01:01:43] ------------------------------------------
[01:01:43] 
[01:01:43] ------------------------------------------
[01:01:43] stderr:
[01:01:43] stderr:
[01:01:43] ------------------------------------------
[01:01:43] error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
[01:01:43]   --> /checkout/src/test/ui/parser/issue-17383.rs:2:9
[01:01:43]    |
[01:01:43] LL |     A = 3,
[01:01:43]    |         ^ disallowed custom discriminant
[01:01:43] LL |     //~^ ERROR custom discriminant values are not allowed in enums with fields
[01:01:43] LL |     B(usize)
[01:01:43]    |     -------- tuple variant defined here
[01:01:43]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[01:01:43] error: aborting due to previous error
[01:01:43] 
[01:01:43] For more information about this error, try `rustc --explain E0658`.
[01:01:43] 
[01:01:43] 
[01:01:43] ------------------------------------------
[01:01:43] 
[01:01:43] 
[01:01:43] ---- [ui] ui/parser/tag-variant-disr-non-nullary.rs stdout ----
[01:01:43] diff of stderr:
[01:01:43] 
[01:01:43] - error[E0658]: custom discriminant values are not allowed in enums with fields
[01:01:43] + error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
[01:01:43] 3    |
[01:01:43] 4 LL |     Red = 0xff0000,
[01:01:43] 
[01:01:43] -    |           ^^^^^^^^ invalid custom discriminant
[01:01:43] -    |           ^^^^^^^^ invalid custom discriminant
[01:01:43] +    |           ^^^^^^^^ disallowed custom discriminant
[01:01:43] 6 LL |
[01:01:43] 7 LL |     Green = 0x00ff00,
[01:01:43] -    |             ^^^^^^^^ invalid custom discriminant
[01:01:43] +    |             ^^^^^^^^ disallowed custom discriminant
[01:01:43] 9 LL |     Blue = 0x0000ff,
[01:01:43] -    |            ^^^^^^^^ invalid custom discriminant
[01:01:43] +    |            ^^^^^^^^ disallowed custom discriminant
[01:01:43] 11 LL |     Black = 0x000000,
[01:01:43] -    |             ^^^^^^^^ invalid custom discriminant
[01:01:43] +    |             ^^^^^^^^ disallowed custom discriminant
[01:01:43] 13 LL |     White = 0xffffff,
[01:01:43] -    |             ^^^^^^^^ invalid custom discriminant
[01:01:43] +    |             ^^^^^^^^ disallowed custom discriminant
[01:01:43] 15 LL |     Other(usize),
[01:01:43] -    |     ------------ variant with a field defined here
[01:01:43] +    |     ------------ tuple variant defined here
[01:01:43] 17 LL |     Other2(usize, usize),
[01:01:43] -    |     -------------------- variant with fields defined here
[01:01:43] +    |     -------------------- tuple variant defined here
[01:01:43] 20    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43] 20    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43] 21    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[01:01:43] 
[01:01:43] The actual stderr differed from the expected stderr.
[01:01:43] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/tag-variant-disr-non-nullary/tag-variant-disr-non-nullary.stderr
[01:01:43] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/tag-variant-disr-non-nullary/tag-variant-disr-non-nullary.stderr
[01:01:43] To update references, rerun the tests and pass the `--bless` flag
[01:01:43] To only update this specific test, also pass `--test-args parser/tag-variant-disr-non-nullary.rs`
[01:01:43] error: 1 errors occurred comparing output.
[01:01:43] status: exit code: 1
[01:01:43] status: exit code: 1
[01:01:43] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/tag-variant-disr-non-nullary.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/tag-variant-disr-non-nullary" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/tag-variant-disr-non-nullary/auxiliary" "-A" "unused"
[01:01:43] ------------------------------------------
[01:01:43] 
[01:01:43] ------------------------------------------
[01:01:43] stderr:
[01:01:43] stderr:
[01:01:43] ------------------------------------------
[01:01:43] error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
[01:01:43]   --> /checkout/src/test/ui/parser/tag-variant-disr-non-nullary.rs:2:11
[01:01:43]    |
[01:01:43] LL |     Red = 0xff0000,
[01:01:43]    |           ^^^^^^^^ disallowed custom discriminant
[01:01:43] LL |     //~^ ERROR custom discriminant values are not allowed in enums with fields
[01:01:43] LL |     Green = 0x00ff00,
[01:01:43]    |             ^^^^^^^^ disallowed custom discriminant
[01:01:43] LL |     Blue = 0x0000ff,
[01:01:43]    |            ^^^^^^^^ disallowed custom discriminant
[01:01:43] LL |     Black = 0x000000,
[01:01:43]    |             ^^^^^^^^ disallowed custom discriminant
[01:01:43] LL |     White = 0xffffff,
[01:01:43]    |             ^^^^^^^^ disallowed custom discriminant
[01:01:43] LL |     Other(usize),
[01:01:43]    |     ------------ tuple variant defined here
[01:01:43] LL |     Other2(usize, usize),
[01:01:43]    |     -------------------- tuple variant defined here
[01:01:43]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43]    = note: for more information, see https://github.com/rust-lang/rust/issues/60553
[01:01:43]    = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable
[01:01:43] error: aborting due to previous error
[01:01:43] 
[01:01:43] For more information about this error, try `rustc --explain E0658`.
[01:01:43] 
---
[01:01:43] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:521:22
[01:01:43] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:01:43] 
[01:01:43] 
[01:01:43] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:01:43] 
[01:01:43] 
[01:01:43] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:43] Build completed unsuccessfully in 0:56:44
---
travis_time:end:02a5a270:start=1560796250145676851,finish=1560796250151208923,duration=5532072
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:05c1281a
$ 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:0afdf67c
travis_time:start:0afdf67c
$ 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:20e9186d
$ 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)

@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch from 9792356 to ff24521 Jun 17, 2019
@lucab

This comment has been minimized.

Copy link
Contributor

lucab commented Jun 19, 2019

(I think this may be waiting for another review round after updates, despite what the label says)

Copy link
Contributor

oli-obk left a comment

just some stylistic nits, then this lgtm

src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate.rs Outdated Show resolved Hide resolved
@jswrenn jswrenn force-pushed the jswrenn:arbitrary_enum_discriminant branch from ff24521 to ac98342 Jun 21, 2019
@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Jun 25, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 25, 2019

📌 Commit ac98342 has been approved by pnkfelix

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 25, 2019

⌛️ Testing commit ac98342 with merge 303f77e...

bors added a commit that referenced this pull request Jun 25, 2019
Implement arbitrary_enum_discriminant

Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 25, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: pnkfelix
Pushing 303f77e to master...

@bors bors added the merged-by-bors label Jun 25, 2019
@bors bors merged commit ac98342 into rust-lang:master Jun 25, 2019
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
pr Build #20190621.46 succeeded
Details
bors bot added a commit to intellij-rust/intellij-rust that referenced this pull request Jul 4, 2019
4056: INT: Fix creation of new module if no corresponding directory exists r=mchernyavsky a=mchernyavsky

Fixes #3995.


4069: Support for arbitrary enum discriminants r=mchernyavsky a=mibac138

Reference: rust-lang/rust#60732


Co-authored-by: mchernyavsky <chemike47@gmail.com>
Co-authored-by: mibac138 <5672750+mibac138@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

10 participants
You can’t perform that action at this time.