Skip to content

Simplify the AST representation of ty param bounds #3792

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

catamorphism
Copy link
Contributor

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

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 rust-lang#2284
@catamorphism
Copy link
Contributor Author

r? @nikomatsakis

@vertexclique
Copy link
Member

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

@graydon
Copy link
Contributor

graydon commented Oct 20, 2012

@vertexclique it's a request for review

@brson
Copy link
Contributor

brson commented Oct 20, 2012

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

@nikomatsakis
Copy link
Contributor

@catamorphism: r+

tesuji pushed a commit to tesuji/rustc that referenced this pull request Jun 9, 2020
let_and_return: avoid "does not live long enough" errors

EDIT: Add rust-lang#3324 to the list of fixes

<details>
<summary>Description of old impl</summary>
<br>
Avoid suggesting turning the RHS expression of the last statement into the block tail expression if a temporary borrows from a local that would be destroyed before.

This is my first incursion into MIR so there's probably room for improvement!
</details>

Avoid linting if the return type of some method or function called in the last statement has a lifetime parameter.

changelog: Fix false positive in [`let_and_return`]

Fixes rust-lang#3792
Fixes rust-lang#3324
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Aug 10, 2024
add and fix return-place-protection tests
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants