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

impl trait for trait #20341

Merged
merged 8 commits into from Jan 2, 2015

Conversation

Projects
None yet
6 participants
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Dec 30, 2014

Code that ensures that every trait object Foo implements the trait Foo.

This requires patching up some object safety concerns. Also more-or-less requires removing the default Sized bound for Self. Don't merge yet until we we reach final decision on these language changes.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 30, 2014

r? @nick29581

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

@@ -783,6 +783,9 @@ pub struct ctxt<'tcx> {

/// Caches whether types move by default.
pub type_moves_by_default_cache: RefCell<HashMap<Ty<'tcx>,bool>>,

/// Caches whether types move by default.

This comment has been minimized.

Copy link
@gereeter

gereeter Dec 30, 2014

Contributor

This comment is for type_moves_by_default_cache, not object_safety_cache.

@pcwalton

This comment has been minimized.

Copy link
Contributor

pcwalton commented Dec 31, 2014

r=me modulo nits

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:impl-trait-for-trait-2 branch from 9086d0c to cf5642e Jan 2, 2015

nikomatsakis added some commits Dec 18, 2014

Refactor object-safety into its own (cached) module so that we can
check it more easily; also extend object safety to cover sized types
as well as static methods.  This makes it sufficient so that we can
always ensure that `Foo : Foo` holds for any trait `Foo`.
Move the `upcast` routine into traits and use it for method selection…
…; also

move get_method_index into traits and give it a better name (`get_vtable_index_of_object_method`).

@nikomatsakis nikomatsakis force-pushed the nikomatsakis:impl-trait-for-trait-2 branch from 75a3396 to 704ed4c Jan 2, 2015

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 2, 2015

rollup merge of rust-lang#20341: nikomatsakis/impl-trait-for-trait-2
Conflicts:
	src/librustc/middle/traits/mod.rs
	src/libstd/io/mod.rs
	src/test/run-pass/builtin-superkinds-self-type.rs

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 2, 2015

rollup merge of rust-lang#20341: nikomatsakis/impl-trait-for-trait-2
Conflicts:
	src/librustc/middle/traits/mod.rs
	src/libstd/io/mod.rs
	src/test/run-pass/builtin-superkinds-self-type.rs

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 2, 2015

rollup merge of rust-lang#20341: nikomatsakis/impl-trait-for-trait-2
Conflicts:
	src/librustc/middle/traits/mod.rs
	src/libstd/io/mod.rs
	src/test/run-pass/builtin-superkinds-self-type.rs

@bors bors merged commit 704ed4c into rust-lang:master Jan 2, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@nikomatsakis nikomatsakis deleted the nikomatsakis:impl-trait-for-trait-2 branch Mar 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.