Skip to content

Schedule cleanup for &* on fat owned pointers#16915

Closed
nrc wants to merge 1 commit into
rust-lang:masterfrom
nrc:dst-bug-5
Closed

Schedule cleanup for &* on fat owned pointers#16915
nrc wants to merge 1 commit into
rust-lang:masterfrom
nrc:dst-bug-5

Conversation

@nrc

@nrc nrc commented Sep 1, 2014

Copy link
Copy Markdown
Member

For example let _x: &Trait = &*(box Foo as Box<Trait>);. There was a bug where no cleanup would be scheduled by the deref.

No test because cleanup-auto-borrow-obj.rs is a test for this once we remove trait cross-borrowing (done on another branch).

r?

Comment thread src/librustc/middle/trans/expr.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

*emulate

For example `let _x: &Trait = &*(box Foo as Box<Trait>);`. There was a bug where no cleanup would be scheduled by the deref.

No test because cleanup-auto-borrow-obj.rs is a test for this once we remove trait cross-borrowing (done on another branch).
@nrc

nrc commented Sep 2, 2014

Copy link
Copy Markdown
Member Author

This is on the branch for PR #16917

@nrc nrc closed this Sep 2, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2024
fix: Prevent stack overflow in recursive const types

In the evaluation of const values of recursive types certain declarations could cause an endless call-loop within the interpreter (hir-ty’s create_memory_map), which would lead to a stack overflow.
This commit adds a check that prevents values that contain an address in their value (such as TyKind::Ref) from being allocated at the address they contain.
The commit also adds a test for this edge case.
flip1995 added a commit to flip1995/rust that referenced this pull request Apr 30, 2026
Fix deprecation warning that Node20.js will stop working in June.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants