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

Compiling with debug logging is never end. #11701

Merged
merged 1 commit into from
Jan 23, 2014

Conversation

angdev
Copy link
Contributor

@angdev angdev commented Jan 22, 2014

When there is println! macro in the code, compiling is never end.

// print.rs
fn main() {
  println!("Hello!");
}
$ RUST_LOG=rustc rustc print.rs

And this is a part of output from stderr.

# ...
Looking up syntax::ast::DefId{crate: 1u32, node: 176234u32}
looking up syntax::ast::DefId{crate: 1u32, node: 176235u32} : extra::ebml::Doc<>{data: &[168u8, 16u8, 0u8, 0u8, 16u8, 51u8, 101u8, 53u8, 97u8, 101u8, 98u8, 56u8, 51u8, 55u8, 97u8, 101u8, 49u8, 54u8, 50u8
# ...
# vector which has infinite length.
  • note : rust 0.9, 0.10-pre

@sfackler
Copy link
Member

I'm going to guess that the vector doesn't have infinite length, it's just very large.

@angdev
Copy link
Contributor Author

angdev commented Jan 22, 2014

Actually, length of the vector is 34995047. Is it normal?

Compiling with debug logging emits over 4GB output. so I have commented out line 220, 225 in librustc/metadata/csearch.rs.

line 220 : debug!("looking up {:?} : {:?}", def, class_doc);
line 225 : debug!("got field data {:?}", the_field);

and finally build successfully in a short time.

@alexcrichton
Copy link
Member

Pull requests are welcome! This is just dumping a few megabytes of metadata which gets inflated because it prints a few bytes per byte of metadata. Nothing worrisome here, just a stray debug statement that should be removed.

@alexcrichton
Copy link
Member

Oh wow I was quite confused, I had no idea I was commenting on a pull request before, sorry about that!

@huonw
Copy link
Member

huonw commented Jan 23, 2014

@alexcrichton this was an issue. It was "upgraded" to a PR, which, apparently, can be done via the API: http://opensoul.org/2012/11/09/convert-a-github-issue-into-a-pull-request/

@alexcrichton
Copy link
Member

My mind was just blown.

bors added a commit that referenced this pull request Jan 23, 2014
When there is `println!` macro in the code, compiling is never end.

```rust
// print.rs
fn main() {
  println!("Hello!");
}
```

```bash
$ RUST_LOG=rustc rustc print.rs
```

And this is a part of output from stderr.

```bash
# ...
Looking up syntax::ast::DefId{crate: 1u32, node: 176234u32}
looking up syntax::ast::DefId{crate: 1u32, node: 176235u32} : extra::ebml::Doc<>{data: &[168u8, 16u8, 0u8, 0u8, 16u8, 51u8, 101u8, 53u8, 97u8, 101u8, 98u8, 56u8, 51u8, 55u8, 97u8, 101u8, 49u8, 54u8, 50u8
# ...
# vector which has infinite length.
```

* note : rust 0.9, 0.10-pre
@bors bors closed this Jan 23, 2014
@bors bors merged commit 86b0564 into rust-lang:master Jan 23, 2014
arcnmx pushed a commit to arcnmx/rust that referenced this pull request Jan 9, 2023
Implement location link for type inlay hints

fix rust-lang#11701

This actually doesn't work due a problem in vscode: microsoft/vscode#167564
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 2, 2023
…Jarcho

Use multiple pushes in `vec_init_then_push` example

Makes the perf argument clearer, since a single push doesn't have unnecessary allocations compared to `vec![x]`

changelog: none
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

Successfully merging this pull request may close these issues.

5 participants