Skip to content

isolate librustc_metadata regression using NLL #48623

Closed
@nikomatsakis

Description

@nikomatsakis

If you start from my nll-bootstrap branch and try to build rustc with NLL enabled, like so:

> RUSTFLAGS_STAGE_NOT_0="-Znll -Zborrowck=mir -Ztwo-phase-borrows" ./x.py build

You will find that it dies here:

error[E0597]: `**self.ecx` does not live long enough
   --> src/librustc_metadata/index_builder.rs:128:58
    |
128 |             let mut entry_builder = IsolatedEncoder::new(self.ecx);
    |                                                          ^^^^^^^^ borrowed value does not live long enough
...
133 |         })
    |         - borrowed value only lives until here
    |
    = note: borrowed value must be valid for lifetime '_#13r...

It would be great if somebody were able to help isolate this into a standalone test case! This basically involves extract code from the environment until we reproduce the error.

I took a stab at it but did not yet finish. This gist contains my intermediate results:

https://gist.github.com/nikomatsakis/f2103b4c3f4299a77e8eb472b236d985

cc @rust-lang/wg-compiler-nll -- It'd be great if somebody wanted to take this on! This is a fairly high priority item, because I would like to get the point where we are able to bootstrap rustc and hence know all of the issues that arise!

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)NLL-completeWorking towards the "valid code works" goal

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions