rust/src
Alex Crichton e6166b7498 rollup merge of #23712: nikomatsakis/reflect-trait
This PR introduces a `Reflect` marker trait which is a supertrait of `Any`. The idea is that `Reflect` is defined for all concrete types, but is not defined for type parameters unless there is a `T:Reflect` bound. This is intended to preserve the parametricity property. This allows the `Any` interface to be stabilized without committing us to unbounded reflection that is not easily detectable by the caller.

The implementation of `Reflect` relies on an experimental variant of OIBIT. This variant behaves differently for objects, since it requires that all types exposed as part of the object's *interface* are `Reflect`, but isn't concerned about other types that may be closed over. In other words, you don't have to write `Foo+Reflect` in order for `Foo: Reflect` to hold (where `Foo` is a trait).

Given that `Any` is slated to stabilization and hence that we are committed to some form of reflection, the goal of this PR is to leave our options open with respect to parametricity. I see the options for full stabilization as follows (I think an RFC would be an appropriate way to confirm whichever of these three routes we take):

1. We make `Reflect` a lang-item.
2. We stabilize some version of the OIBIT variation I implemented as a general mechanism that may be appropriate for other use cases.
3. We give up on preserving parametricity here and just have `impl<T> Reflect for T` instead. In that case, `Reflect` is a harmless but not especially useful trait going forward.

cc @aturon
cc @alexcrichton
cc @glaebhoerl (this is more-or-less your proposal, as I understood it)
cc @reem (this is more-or-less what we discussed on IRC at some point)
cc @FlaPer87 (vaguely pertains to OIBIT)
2015-03-27 10:07:43 -07:00
..
compiler-rt@58ab642c30 Updated compiler-rt 2015-01-09 18:38:30 +02:00
compiletest rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
doc rollup merge of #23690: wettowelreactor/patch-1 2015-03-27 10:07:42 -07:00
driver Test fixes and rebase conflicts 2015-01-30 14:53:34 -08:00
etc Add the other S_I(RWX)(GRP/OTH) for posix creat 2015-03-24 03:25:48 -07:00
grammar Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
jemalloc@e24a1a025a bumping again to get the updated configure 2015-03-05 12:38:35 +05:30
liballoc rollup merge of #23712: nikomatsakis/reflect-trait 2015-03-27 10:07:43 -07:00
libarena Add trivial cast lints. 2015-03-25 10:03:57 +13:00
libbacktrace Strip trailing whitespace 2015-03-15 11:25:43 -07:00
libcollections rollup merge of #23535: pnkfelix/fsk-filling-drop 2015-03-27 10:07:41 -07:00
libcollectionstest rollup merge of #23282: nikomatsakis/fn-trait-inheritance 2015-03-24 14:50:44 -07:00
libcore rollup merge of #23712: nikomatsakis/reflect-trait 2015-03-27 10:07:43 -07:00
libcoretest Add trivial cast lints. 2015-03-25 10:03:57 +13:00
libflate Require feature attributes, and add them where necessary 2015-03-23 14:40:26 -07:00
libfmt_macros fix for new attributes failing. issue #22964 2015-03-05 11:53:51 -05:00
libgetopts std: Tweak some unstable features of str 2015-03-17 18:03:03 -07:00
libgraphviz Test fixes and rebase conflicts, round 2 2015-03-23 17:10:19 -07:00
liblibc Test fixes and rebase conflicts, round 2 2015-03-24 18:37:16 -07:00
liblog rollup merge of #23630: nrc/coerce-tidy 2015-03-24 14:50:46 -07:00
librand Change lint names to plurals 2015-03-25 10:06:13 +13:00
librbml Test fixes and rebase conflicts, round 2 2015-03-24 18:37:16 -07:00
librustc rollup merge of #23712: nikomatsakis/reflect-trait 2015-03-27 10:07:43 -07:00
librustc_back Test fixes and rebase conflicts, round 3 2015-03-23 22:52:21 -07:00
librustc_bitflags Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
librustc_borrowck rollup merge of #23601: nikomatsakis/by-value-index 2015-03-23 15:10:50 -07:00
librustc_driver Add generic conversion traits 2015-03-23 15:01:45 -07:00
librustc_lint Change lint names to plurals 2015-03-25 10:06:13 +13:00
librustc_llvm Change lint names to plurals 2015-03-25 10:06:13 +13:00
librustc_privacy Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses of 2015-03-23 16:55:45 -04:00
librustc_resolve default => or_insert per RFC 2015-03-27 07:42:03 -04:00
librustc_trans Use -Z force-dropflag-checks=on/off for emitting sanity-check. 2015-03-26 14:08:55 +01:00
librustc_typeck rollup merge of #23712: nikomatsakis/reflect-trait 2015-03-27 10:07:43 -07:00
librustdoc default => or_insert per RFC 2015-03-27 07:42:03 -04:00
libserialize Change lint names to plurals 2015-03-25 10:06:13 +13:00
libstd rollup merge of #23651: alexcrichton/unwind-try 2015-03-27 10:07:42 -07:00
libsyntax rollup merge of #23712: nikomatsakis/reflect-trait 2015-03-27 10:07:43 -07:00
libterm Bug fixes 2015-03-25 10:37:03 +13:00
libtest Add trivial cast lints. 2015-03-25 10:03:57 +13:00
libunicode Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
llvm@bff6907697 updating llvm submodule to include bitrig support 2015-03-05 12:38:34 +05:30
rt Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
rust-installer@60fd8abfca Upgrade rust-installer 2015-02-12 20:36:17 -08:00
rustbook Add trivial cast lints. 2015-03-25 10:03:57 +13:00
rustllvm Drop support for LLVM < 3.5 and fix compile errors with 3.5 2015-03-14 13:14:04 +01:00
test rollup merge of #23712: nikomatsakis/reflect-trait 2015-03-27 10:07:43 -07:00
snapshots.txt adding lastest Bitrig snapshot by hand 2015-03-23 15:58:44 -07:00