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

TypeChecker::check_box_free_inputs never happens #50071

Closed
glandium opened this issue Apr 19, 2018 · 1 comment
Closed

TypeChecker::check_box_free_inputs never happens #50071

glandium opened this issue Apr 19, 2018 · 1 comment

Comments

@glandium
Copy link
Contributor

I have, in my patch queue, a change that removes TypeChecker::check_box_free_inputs because I changed the MIR emitted for box_free such that the normal TypeChecker::check_call_inputs should work for it. I wanted to check whether that's true, but couldn't find any case where it's called. I went as far as reverting all my changes, and making check_box_free_inputs eprintln a message, and never saw one. Not while compiling the compiler itself, and not while compiling the testcase from #50041 (which does create a basic block with a termination call to box_free, contrary to most cases where the MIR only contains a drop ; and I tried adding #[feature(nll)] to that testcase in case that matters, to no avail)

Actually, full disclosure: I did see two calls... when compiling liballoc, which contains explicit calls to the function. (

box_free(bptr);
box_free(bptr);
). And for those, check_call_inputs is clearly enough, since type checking actually happens before MIR.

Cc: @nikomatsakis

glandium added a commit to glandium/rust that referenced this issue Apr 20, 2018
Because box_free is now passed a pointer instead of a Box, we can stop
relying on TypeChecked::check_box_free_inputs, because
TypeChecker::check_call_inputs should be enough, like for all other
function calls.

It seems it was not actually reached anyways in cases where it would
have made a difference. (issue rust-lang#50071)
@Mark-Simulacrum
Copy link
Member

dfa6111 was merged and removed check_box_free_inputs so I'm closing this.

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

No branches or pull requests

2 participants