Stream: t-compiler/wg-mir-opt

Topic: preparation work to remove static from place


Santiago Pastorino (Nov 12 2019 at 12:43, on Zulip):

I'm going over some things that needs to be done before placing the actual PR to remove statics from place and to be able to do that in a tidy way

Santiago Pastorino (Nov 12 2019 at 12:45, on Zulip):

in particular we would need to generalize a bit some error messages because we are going to loose track of some information on MIR so we are not going to be able to differentiate between some ownership/borrowing violations through statics and through the use of just plain borrows

Santiago Pastorino (Nov 12 2019 at 12:46, on Zulip):

I've opened https://github.com/rust-lang/rust/pull/66302, https://github.com/rust-lang/rust/pull/66306 and https://github.com/rust-lang/rust/pull/66328

Santiago Pastorino (Nov 12 2019 at 12:46, on Zulip):

/cc @oli @centril

centril (Nov 12 2019 at 12:47, on Zulip):

https://github.com/rust-lang/rust/pull/66302 is a language change so those errors will need to be preserved some other way

Santiago Pastorino (Nov 12 2019 at 12:49, on Zulip):

I see it differently but I'm not part of the lang team, I'd leave this up to you, @oli and others

centril (Nov 12 2019 at 12:49, on Zulip):

Can you explain your POV?

centril (Nov 12 2019 at 12:50, on Zulip):

We could move the check to HIR if necessary -- I think that should be doable in a fairly clean way

Santiago Pastorino (Nov 12 2019 at 12:51, on Zulip):

I think it was just a limitation, that constants could not refer to statics

Santiago Pastorino (Nov 12 2019 at 12:51, on Zulip):

ahh or maybe you're talking about just the errors?

Santiago Pastorino (Nov 12 2019 at 12:52, on Zulip):

are you saying that is a language change to change the error messages?

centril (Nov 12 2019 at 12:52, on Zulip):

@Santiago Pastorino https://github.com/rust-lang/rust/pull/66302 is allowing more programs, yes? :slight_smile:

Santiago Pastorino (Nov 12 2019 at 12:52, on Zulip):

yes

centril (Nov 12 2019 at 12:53, on Zulip):

so that's changing the type system, which makes it a language change

centril (Nov 12 2019 at 12:53, on Zulip):

it's true that it was a limitation, but an intentional one

Santiago Pastorino (Nov 12 2019 at 12:53, on Zulip):

yeah, ok, I'd leave that discussion up to you guys :)

centril (Nov 12 2019 at 12:53, on Zulip):

=)

Santiago Pastorino (Nov 14 2019 at 13:56, on Zulip):

hey everyone, in particular @oli @nikomatsakis @Matthew Jasper

Santiago Pastorino (Nov 14 2019 at 13:56, on Zulip):

I think we may want to discuss this here :)

Santiago Pastorino (Nov 14 2019 at 13:57, on Zulip):

I have been talking with some in different places and other things show up on PRs

Santiago Pastorino (Nov 14 2019 at 13:57, on Zulip):

so I've been talking and working a bit with Oli on this https://github.com/rust-lang/rust/compare/master...spastorino:handle-static-as-const

Santiago Pastorino (Nov 14 2019 at 13:57, on Zulip):

one of the things we need to discuss is about error reporting

Santiago Pastorino (Nov 14 2019 at 13:58, on Zulip):

basically if you start checking that diff from https://github.com/rust-lang/rust/compare/master...spastorino:handle-static-as-const#diff-ea11ff0e44213ba8f3bee0f5e63f392a and on

Santiago Pastorino (Nov 14 2019 at 13:58, on Zulip):

you will see how some diagnostics errors regresses

Santiago Pastorino (Nov 14 2019 at 13:59, on Zulip):

with @oli we were aiming for some more general errors, maybe as a first step towards a solution

Santiago Pastorino (Nov 14 2019 at 13:59, on Zulip):

I've opened https://github.com/rust-lang/rust/pull/66328

Santiago Pastorino (Nov 14 2019 at 13:59, on Zulip):

and some very interesting thoughts from @Matthew Jasper showed up

Santiago Pastorino (Nov 14 2019 at 14:00, on Zulip):

this is all to give a bit of context

Santiago Pastorino (Nov 14 2019 at 14:00, on Zulip):

would be nice to discuss everything here maybe? :)

Santiago Pastorino (Nov 14 2019 at 14:01, on Zulip):

/cc @eddyb maybe too

oli (Nov 14 2019 at 14:01, on Zulip):

cc @WG-diagnostics you can also chime in here, we're figuring out what kind of errors can have identical error messages for static items and immutable references

Last update: Dec 12 2019 at 00:50UTC