Simplify the AST representation of ty param bounds #3792

Closed
wants to merge 1 commit into
from

5 participants

@catamorphism

Change ast::ty_param_bound so that all ty param bounds are represented
as traits, with no special cases for Copy/Send/Owned/Const.
typeck::collect generates the special cases.

A consequence of this is that code using the #[no_core] attribute
can't use the Copy kind/trait. Probably not a big deal?

As a side effect, any user-defined traits that happen to be called
Copy, etc. in the same module override the built-in Copy trait.
Closes #2284

@catamorphism catamorphism Simplify the AST representation of ty param bounds
Change ast::ty_param_bound so that all ty param bounds are represented
as traits, with no special cases for Copy/Send/Owned/Const.
typeck::collect generates the special cases.

A consequence of this is that code using the #[no_core] attribute
can't use the Copy kind/trait. Probably not a big deal?

As a side effect, any user-defined traits that happen to be called
Copy, etc. in the same module override the built-in Copy trait.
Closes #2284
bbc94e8
@vertexclique

what does "r?" mean? Sorry I don't know

@graydon

@vertexclique it's a request for review

@brson

Agree the #[no_core] restriction is nbd. core is the only crate that can reasonably use no_core these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment