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 untagged_unions to not allow union fields with drop #56440

Closed
wants to merge 9 commits into from

Conversation

bluss
Copy link
Member

@bluss bluss commented Dec 2, 2018

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor.
This for example allows unions to use arbitrary field types only by wrapping
them in ManuallyDrop (or similar).

The stable rule remains, that union fields must be Copy. We use the new
rule for the untagged_union feature.

See RFC 2514, tracking issue #55149

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 2, 2018
@bluss
Copy link
Member Author

bluss commented Dec 2, 2018

cc @eddyb @RalfJung

As written, this is insta-stable, but we might want to change that. Nightly with the untagged_unions feature gate doesn't have the requirement we're loosening here, so for users of that feature, nothing changes.

@eddyb
Copy link
Member

eddyb commented Dec 2, 2018

r? @nikomatsakis

@rust-highfive

This comment has been minimized.

src/test/run-pass/union/union-manuallydrop.rs Outdated Show resolved Hide resolved
src/test/run-pass/union/union-manuallydrop.rs Outdated Show resolved Hide resolved
src/test/run-pass/union/union-manuallydrop.rs Show resolved Hide resolved
src/test/run-pass/union/union-manuallydrop.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

RalfJung commented Dec 2, 2018

As written, this is insta-stable, but we might want to change that. Nightly with the untagged_unions feature gate doesn't have the requirement we're loosening here, so for users of that feature, nothing changes.

I'd suggest we change the behavior of the feature gate only. So behavior of stable does not change, but we can test on nightly how these unions behave (e.g. the behavior of drop on assignment and the initialization checker might have to be tweaked to match the RFC).

My expectation would be that nightly with the untagged_union feature gate has this requirement.

@bluss
Copy link
Member Author

bluss commented Dec 2, 2018

@RalfJung That makes sense, so we'd make a breaking change for that feature gate. In that case there should definitely be a suggestion to use ManuallyDrop as a diagnostic too.

@bluss
Copy link
Member Author

bluss commented Dec 7, 2018

@nikomatsakis Any thoughts on what the correct place in the code is for this, a check union fields don't need dropping?

@nikomatsakis
Copy link
Contributor

@bluss I think this check would make sense to do in this function

fn check_union<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
id: ast::NodeId,
span: Span) {
let def_id = tcx.hir().local_def_id(id);
let def = tcx.adt_def(def_id);
def.destructor(tcx); // force the destructor to be evaluated
check_representable(tcx, span, def_id);
check_packed(tcx, span, def_id);
}

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2018
@bluss bluss mentioned this pull request Dec 19, 2018
@bluss
Copy link
Member Author

bluss commented Dec 19, 2018

Ok, updated with the new rule:

  • stable: unchanged rules for union
  • nightly/untagged_union: don't allow union fields with drop

I've fixed tests quickly but with the best sense I had, so those could require ideas in review.
The first crate I've seen break on the changed rule for untagged_union is smallvec, so build will not succeed until crates we depend on are fixed; unsure which crates exactly yet.

E0720: r##"
A `union` can not have fields with destructors.
"##,

Copy link
Member Author

@bluss bluss Dec 19, 2018

Choose a reason for hiding this comment

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

Do we have a system for assigning error numbers? Yes, the text is a bit lacking here.

Copy link
Contributor

Choose a reason for hiding this comment

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

We do not really have a system, no. You just pick one.


let mut u3 = U3 { a: ManuallyDrop::new(String::from("old")) }; // OK
u3.a = ManuallyDrop::new(String::from("new")); //~ ERROR assignment to non-`Copy` union
*u3.a = String::from("new"); //~ ERROR access to union field is unsafe
Copy link
Member Author

Choose a reason for hiding this comment

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

(Above 7 lines).

The different rules between ManuallyDrop<i32> vs ManuallyDrop<String> are a bit confusing, but due to the Copy/non-Copy distinction.

Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, this distinction is pre-existing, right? Or are you referring to some behavior that this RFC introduced?

@rust-highfive
Copy link
Collaborator

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:09eb2ffc:start=1545250379263888141,finish=1545250478781955081,duration=99518066940
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:19:03]    Compiling ena v0.11.0
[00:19:04]    Compiling smallvec v0.6.7
[00:19:04]    Compiling lock_api v0.1.3
[00:19:04]    Compiling crossbeam-epoch v0.3.1
[00:19:04] error[E0720]: unions may not contain fields that need dropping
[00:19:04]     |
[00:19:04]     |
[00:19:04] 272 | / union SmallVecData<A: Array> {
[00:19:04] 273 | |     inline: A,
[00:19:04] 274 | |     heap: (*mut A::Item, usize),
[00:19:04] 275 | | }
[00:19:04]     | |_^ ManuallyDrop can be used to wrap such fields
[00:19:04] error: aborting due to previous error
[00:19:04] 
[00:19:04] For more information about this error, try `rustc --explain E0720`.
[00:19:04] error: Could not compile `smallvec`.
[00:19:04] error: Could not compile `smallvec`.
[00:19:04] warning: build failed, waiting for other jobs to finish...
[00:19:05] error: build failed
[00:19:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:19:05] expected success, got: exit code: 101
[00:19:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:19:05] Build completed unsuccessfully in 0:16:02
[00:19:05] Makefile:28: recipe for target 'all' failed
[00:19:05] make: *** [all] Error 1
travis_time:end:0079be01:start=1545251632995024654,finish=1545251633007078065,duration=12053411
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0b37c5c0
travis_time:start:0b37c5c0
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:0b37c5c0:start=1545251633011693449,finish=1545251633016395192,duration=4701743
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0976b9a2
$ 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:1423dc24
travis_time:start:1423dc24
$ 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 s

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)

@nikomatsakis nikomatsakis added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 19, 2018
@bluss bluss changed the title Allow unions to contain fields that don't need dropping Change untagged_unions to not allow union fields with drop Dec 19, 2018
@rust-highfive
Copy link
Collaborator

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:37bc24e2:start=1547412611150068669,finish=1547412688602059107,duration=77451990438
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:26:03]    Compiling ena v0.11.0
[00:26:03]    Compiling rustc_cratesio_shim v0.0.0 (/checkout/src/librustc_cratesio_shim)
[00:26:03]    Compiling rls-span v0.4.0
[00:26:04]    Compiling smallvec v0.6.7
[00:26:04] error[E0730]: unions may not contain fields that need dropping
[00:26:04]     |
[00:26:04] 273 |     inline: A,
[00:26:04]     |     ^^^^^^^^^
[00:26:04]     |
---
[00:26:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:26:05] expected success, got: exit code: 101
[00:26:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:26:05] Build completed unsuccessfully in 0:22:54
[00:26:05] Makefile:18: recipe for target 'all' failed
[00:26:05] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:15cb93d3
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Jan 13 21:17:41 UTC 2019
---
travis_time:end:006cb644:start=1547414262445868884,finish=1547414262450579986,duration=4711102
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:07808bce
$ 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:306fbb04
travis_time:start:306fbb04
$ 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:1f66c0b4
$ 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
Copy link
Collaborator

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:16660f88:start=1547485910734037882,finish=1547486025282440459,duration=114548402577
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:30:55] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:30:55] expected success, got: exit code: 101
[00:30:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:30:55] Build completed unsuccessfully in 0:27:07
[00:30:55] Makefile:18: recipe for target 'all' failed
[00:30:55] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:08ba204a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Mon Jan 14 17:44:52 UTC 2019
---
travis_time:end:0c11cea9:start=1547487893216508007,finish=1547487893221420257,duration=4912250
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0ad077e0
$ 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:11526274
travis_time:start:11526274
$ 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:2219d9ff
$ 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)

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

So -- code seems good now, but the test still is not pasing

@bluss
Copy link
Member Author

bluss commented Jan 19, 2019

Sure, I wasn't sure about when to request a new smallvec release, but I've done so now.

@rust-highfive
Copy link
Collaborator

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:054b782a:start=1547942650229009889,finish=1547942721247305906,duration=71018296017
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:28:55]    Compiling arena v0.0.0 (/checkout/src/libarena)
[00:28:55]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:29:01]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:30:35]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:30:45] error: internal compiler error: src/librustc/ty/relate.rs:703: impossible case reached: can't relate: '_#0r with Type(RustaceansAreAwesome)
[00:30:45] thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:589:9
[00:30:45] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[00:30:46] error: aborting due to previous error
[00:30:46] 
[00:30:46] 
[00:30:46] 
[00:30:46] note: the compiler unexpectedly panicked. this is a bug.
[00:30:46] 
[00:30:46] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:30:46] 
[00:30:46] note: rustc 1.33.0-dev running on x86_64-unknown-linux-gnu
[00:30:46] 
[00:30:46] note: compiler flags: -Z force-unstable-if-unmarked -C prefer-dynamic -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type dylib
[00:30:46] note: some of the compiler flags provided by cargo are hidden
[00:30:46] 
[00:30:46] error: Could not compile `rustc`.
[00:30:46] warning: build failed, waiting for other jobs to finish...
[00:30:46] warning: build failed, waiting for other jobs to finish...
[00:31:05] error: build failed
[00:31:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:31:05] expected success, got: exit code: 101
[00:31:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:31:05] Build completed unsuccessfully in 0:27:27
[00:31:05] make: *** [all] Error 1
[00:31:05] Makefile:18: recipe for target 'all' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0eac3d5b
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Jan 20 00:36:35 UTC 2019
---
travis_time:end:13a8477a:start=1547944595839519385,finish=1547944595844280318,duration=4760933
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0001ba58
$ 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:2f571240
travis_time:start:2f571240
$ 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:08a87700
$ 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)

@bluss
Copy link
Member Author

bluss commented Jan 21, 2019

The ICE reproduces locally, same message as #57156 and a smallvec in the backtrace, but will have to look closer at it.

ICE backtrace

   Compiling rustc v0.0.0 (~/src/rust/src/librustc)
error: internal compiler error: src/librustc/ty/relate.rs:703: impossible case reached: can't relate: '_#0r with Type(RustaceansAreAwesome)

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:589:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: <rustc::ty::subst::Kind<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
  15: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
  16: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  17: <core::result::Result<T, E> as rustc::ty::context::InternIteratorElement<T, R>>::intern_with
  18: <rustc::ty::sty::ExistentialTraitRef<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
  19: rustc::infer::higher_ranked::<impl rustc::infer::combine::CombineFields<'a, 'gcx, 'tcx>>::higher_ranked_sub
  20: rustc::infer::InferCtxt::commit_if_ok
  21: rustc::traits::select::SelectionContext::match_where_clause_trait_ref
  22: rustc::infer::InferCtxt::probe
  23: rustc::traits::select::SelectionContext::assemble_candidates
  24: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache
  25: rustc::dep_graph::graph::DepGraph::with_anon_task
  26: rustc::traits::select::SelectionContext::candidate_from_obligation
  27: rustc::traits::select::SelectionContext::evaluate_stack
  28: rustc::dep_graph::graph::DepGraph::with_anon_task
  29: rustc::traits::select::SelectionContext::evaluate_predicate_recursively
  30: rustc::traits::select::SelectionContext::evaluate_predicates_recursively
  31: rustc::infer::InferCtxt::probe
  32: rustc::traits::select::SelectionContext::evaluate_stack
  33: rustc::dep_graph::graph::DepGraph::with_anon_task
  34: rustc::traits::select::SelectionContext::evaluate_predicate_recursively
  35: rustc::infer::InferCtxt::probe
  36: rustc::traits::select::SelectionContext::evaluate_obligation_recursively
  37: rustc::ty::context::GlobalCtxt::enter_local
  38: rustc_traits::evaluate_obligation::evaluate_obligation
  39: rustc::ty::query::__query_compute::evaluate_obligation
  40: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::evaluate_obligation<'tcx>>::compute
  41: rustc::dep_graph::graph::DepGraph::with_task_impl
  42: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  43: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::evaluate_obligation
  44: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::evaluate_obligation_no_overflow
  45: rustc::ty::context::GlobalCtxt::enter_local
  46: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::virtual_call_violation_for_method
  47: <&mut I as core::iter::iterator::Iterator>::next
  48: <core::iter::Filter<I, P> as core::iter::iterator::Iterator>::next
  49: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  50: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::object_safety_violations_for_trait
  51: <core::iter::FlatMap<I, U, F> as core::iter::iterator::Iterator>::next
  52: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  53: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::object_safety_violations
  54: rustc::traits::object_safety::is_object_safe_provider
  55: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::is_object_safe<'tcx>>::compute
  56: rustc::dep_graph::graph::DepGraph::with_task_impl
  57: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  58: <rustc_data_structures::obligation_forest::ObligationForest<O>>::process_obligations
  59: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_where_possible
  60: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_all_or_error
  61: rustc_typeck::check::FnCtxt::select_all_obligations_or_error
  62: rustc::ty::context::GlobalCtxt::enter_local
  63: rustc_typeck::check::wfcheck::check_type_defn
  64: rustc_typeck::check::wfcheck::check_item_well_formed
  65: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::check_item_well_formed<'tcx>>::compute
  66: rustc::dep_graph::graph::DepGraph::with_task_impl
  67: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  68: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
  69: rustc::hir::Crate::visit_all_item_likes
  70: rustc::util::common::time
  71: rustc_typeck::check_crate
  72: <std::thread::local::LocalKey<T>>::with
  73: rustc::ty::context::TyCtxt::create_and_enter
  74: rustc_driver::driver::phase_3_run_analysis_passes
  75: rustc_driver::driver::compile_input
  76: rustc_driver::run_compiler_with_pool
  77: <scoped_tls::ScopedKey<T>>::set
  78: rustc_driver::run_compiler
  79: <scoped_tls::ScopedKey<T>>::set
  80: syntax::with_globals
  81: __rust_maybe_catch_panic
  82: <F as alloc::boxed::FnBox<A>>::call_box
  83: std::sys_common::thread::start_thread
  84: std::sys::unix::thread::Thread::new::thread_start
  85: start_thread
  86: __clone
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `&mut Self: std::ops::DispatchFromDyn<&mut RustaceansAreAwesome>`
#1 [is_object_safe] determine object safety of trait `lint::LateLintPass`
#2 [check_item_well_formed] processing `lint::context::LintStore`
end of query stack
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z force-unstable-if-unmarked -C prefer-dynamic -C opt-level=2 -C incremental -C prefer-dynamic -C debug-assertions=n -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type dylib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `rustc`.

@bors
Copy link
Contributor

bors commented Jan 22, 2019

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

@TimNN
Copy link
Contributor

TimNN commented Jan 29, 2019

Ping from triage @bluss: What is the status of this PR?

@Dylan-DPC-zz
Copy link

ping from triage @bluss any updates on this?

@Dylan-DPC-zz
Copy link

ping from triage @bluss
Unfortunately we haven't heard from you on this in a while, so I'm closing the PR to keep things tidy. Don't worry though, if you'll have time again in the future please reopen this PR, we'll be happy to review it again!

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 11, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019
…tsakis

Updates smallvec and new_debug_unreachable

The version `0.6.10` of smallvec has released that fixes an [ICE](rust-lang#61549).
This is re-submission of rust-lang#58773.
And this may let rust-lang#56440 re-start.
Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019
…tsakis

Updates smallvec and new_debug_unreachable

The version `0.6.10` of smallvec has released that fixes an [ICE](rust-lang#61549).
This is re-submission of rust-lang#58773.
And this may let rust-lang#56440 re-start.
Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019
…tsakis

Updates smallvec and new_debug_unreachable

The version `0.6.10` of smallvec has released that fixes an [ICE](rust-lang#61549).
This is re-submission of rust-lang#58773.
And this may let rust-lang#56440 re-start.
Centril added a commit to Centril/rust that referenced this pull request Oct 21, 2019
… r=RalfJung

Change untagged_unions to not allow union fields with drop

This is a rebase of rust-lang#56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: rust-lang#55149
Centril added a commit to Centril/rust that referenced this pull request Oct 21, 2019
… r=RalfJung

Change untagged_unions to not allow union fields with drop

This is a rebase of rust-lang#56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: rust-lang#55149
@bluss bluss deleted the no-drop-in-union-fields branch October 23, 2019 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants