Stream: t-compiler/help

Topic: no debug output from rustc_mir?


mark-i-m (Nov 20 2019 at 23:49, on Zulip):

I'm trying to do some debugging, but when I run RUSTC_LOG=rustc_mir=debug rustc +stage1 test/ui/async-await/issues/issue-63388-1.rs I don't get any debugging output

mark-i-m (Nov 20 2019 at 23:49, on Zulip):

If I run with RUSTC_LOG=debug I get plenty of output, but it is all from libsyntax_pos, librustc

mark-i-m (Nov 20 2019 at 23:50, on Zulip):

Am I doing something stupid?

mark-i-m (Nov 20 2019 at 23:50, on Zulip):

I made sure debug-assertions=true and I recompiled stage1 from clean

Santiago Pastorino (Nov 20 2019 at 23:55, on Zulip):

@mark-i-m I think that should work ... hmmm, can you try RUSTC_LOG=rustc_mir rustc +stage1 test/ui/async-await/issues/issue-63388-1.rs?

Santiago Pastorino (Nov 20 2019 at 23:56, on Zulip):

sorry, I did not understand if RUSTC_LOG=debug ... worked or not

Santiago Pastorino (Nov 20 2019 at 23:56, on Zulip):

did you get debug info from rustc_mir? maybe search for that in the output?

mark-i-m (Nov 21 2019 at 00:21, on Zulip):

Oh, sorry, I see how that could be miss understood

mark-i-m (Nov 21 2019 at 00:21, on Zulip):

RUSTC_LOG=rustc_mir gives nothing

mark-i-m (Nov 21 2019 at 00:22, on Zulip):

RUSTC_LOG=debug gives _no_ output from rustc_mir

mark-i-m (Nov 21 2019 at 00:24, on Zulip):

It also doesn't work with stage 2

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

@mark-i-m I was checking a bit the code because I was not sure how are logs in general enabled but it shouldn't be related to debug-assertions or anything like that

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

my understanding is that it just uses the env variable to initialize the loggers in the level you use on the env variable and that's all

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

https://github.com/rust-lang/rust/blob/2cad8bb659066b42fc518c95def384956126bd3f/src/librustc_driver/lib.rs#L1246

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

debug-assertions are about turning on debug-assert in non optimized builds

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

https://github.com/rust-lang/rust/blob/2cad8bb659066b42fc518c95def384956126bd3f/src/libcore/macros/mod.rs#L142-L217

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

/cc @simulacrum

simulacrum (Nov 21 2019 at 12:49, on Zulip):

if debug-asserts aren't on you can't get more verbose logs than just info

simulacrum (Nov 21 2019 at 12:50, on Zulip):

debug! logs are gated behind debug-assert = true so that they're completely compiled out in dist builds

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

I see, makes sense, couldn't find how that happens on the code though

mark-i-m (Nov 21 2019 at 17:36, on Zulip):

Yeah, I wanted debug! messages, so I turned on debug-assert

mark-i-m (Nov 21 2019 at 17:37, on Zulip):

It turned out that 1) I needed to pass --edition 2018 to the compiler, and 2) I needed to add #![feature(nll)] to the test case

mark-i-m (Nov 21 2019 at 17:37, on Zulip):

I was under the impression that the nll borrow checker was always running, so this is still a bit perplexing to me...

mark-i-m (Nov 21 2019 at 17:37, on Zulip):

In particular, if nll is on by default, what does the feature gate do? And what does edition 2015 do differently?

lqd (Nov 21 2019 at 17:44, on Zulip):

probably related to the migrate-mode

lqd (Nov 21 2019 at 17:45, on Zulip):

while the feature gate turns on "full NLLs"

Last update: Dec 12 2019 at 01:45UTC