Stream: general

Topic: borrow-AST bugs


Jethro (May 13 2019 at 15:46, on Zulip):

@pnkfelix Thanks for your detailed response in https://github.com/rust-lang/rust/issues/58781#issuecomment-491737375

Jethro (May 13 2019 at 15:46, on Zulip):

one question still remains though

Jethro (May 13 2019 at 15:46, on Zulip):

Are bugs in the old borrow checker still being fixed?

Jake Goulding (May 13 2019 at 15:58, on Zulip):

Feels like a waste of effort to me... especially since 2015 is moving to migrate mode

Jethro (May 13 2019 at 16:00, on Zulip):

memory safety bugs are no joke

oli (May 13 2019 at 16:01, on Zulip):

@Jethro migrate mode is the fix ;)

Jake Goulding (May 13 2019 at 16:01, on Zulip):

I mean it as, any fix to AST borrowck would be released after migrate mode is enabled.

RalfJ (May 13 2019 at 16:01, on Zulip):

the fix for AST borrowck bugs is to move to NLL

RalfJ (May 13 2019 at 16:02, on Zulip):

AST borrowck has several known memory safety bugs that are basically impossible to fix -- that's one of the reasons NLL is a complete rewrite

Jethro (May 13 2019 at 16:03, on Zulip):

would it be good to update the migrate message with a link to some FAQ?

Jake Goulding (May 13 2019 at 16:04, on Zulip):

And making that warning into an error would basically require users to move to NLL anyway, which is effectively what deleting migrate mode would be...

Jethro (May 13 2019 at 16:04, on Zulip):

@Jake Goulding except that you could opt-in to it on a crate-by-crate basis

oli (May 13 2019 at 16:05, on Zulip):

@Jethro you can already do that by opt-in to the 2018 edition

Jethro (May 13 2019 at 16:06, on Zulip):

@oli no it's just warnings

oli (May 13 2019 at 16:07, on Zulip):

once migrate mode is gone, everything will be errors

Jethro (May 13 2019 at 16:07, on Zulip):

yes but in the mean time...

oli (May 13 2019 at 16:07, on Zulip):

I don't think we can roll another scheme faster than eliminating migrate mode

Jethro (May 13 2019 at 16:08, on Zulip):

would it be good to update the migrate message with a link to some FAQ?

Jake Goulding (May 13 2019 at 16:08, on Zulip):

what's the Q and how is it F?

Jethro (May 13 2019 at 16:08, on Zulip):

especially since it's going to land on 2015 edition stable soon...

Jethro (May 13 2019 at 16:09, on Zulip):

I got this message, what do I do about it?
I found an invalid program that demonstrates UB, are you going to fix the old borrow checker?
Can I turn these warnings into errors?
When are these warnings going to turn into errors by themselves?

Jethro (May 13 2019 at 16:09, on Zulip):

I got this message, but it has nothing to do with borrows, help? (issue 60450)

Jethro (May 13 2019 at 16:32, on Zulip):

I'm going to assume due to the lack of responses that people are indifferent towards this idea

Jethro (May 13 2019 at 16:32, on Zulip):

@Steve Klabnik what would be a good place to put this?

oli (May 13 2019 at 16:37, on Zulip):

If we don't have an FAQ, we should not be creating one just for this. You can add more detailed explanations to the --explain output of the compiler. I believe such a change would be uncontroversial

lqd (May 13 2019 at 16:44, on Zulip):

(you can technically opt-in to full NLLs with feature/-Z flags)

Jake Goulding (May 13 2019 at 16:58, on Zulip):

If we don't have an FAQ

We used to have one on the website and it was removed, IIRC.

Jake Goulding (May 13 2019 at 16:59, on Zulip):

slightly different types of questions though

Jethro (May 13 2019 at 17:00, on Zulip):

@oli there is no --explain just for this warning

Jethro (May 13 2019 at 17:00, on Zulip):

it's usually (but not always) paired with some other warning message, for which the explain talks about general borrowing concepts

oli (May 13 2019 at 17:02, on Zulip):

@Jethro that's what I mean, we can create one

oli (May 13 2019 at 17:03, on Zulip):

it's a single method call in the code

oli (May 13 2019 at 17:03, on Zulip):

plus the explain text

Jethro (May 13 2019 at 17:52, on Zulip):

@oli I'm looking at how to do this, but since this warning is tacked on to another Diagnostic, it seems that it often will already have an error code attached to it

oli (May 13 2019 at 17:53, on Zulip):

ah

oli (May 13 2019 at 17:53, on Zulip):

hmm... but could the warning attachment itself add the --explain suggestion?

Jethro (May 13 2019 at 17:58, on Zulip):

that seems kind of a hack

Jethro (May 13 2019 at 17:58, on Zulip):

there's all kinds of logic in librustc_errors for determining whether or not to show the --explain message

Jethro (May 13 2019 at 20:42, on Zulip):

explain is only emitted if there are errors, not warnings :(

oli (May 13 2019 at 21:06, on Zulip):

:confused: how about just an additional note? or is that too much clutter?

Last update: Nov 21 2019 at 23:25UTC