<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_metadata/src, branch 1.53.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.53.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.53.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2021-06-11T16:07:18+00:00</updated>
<entry>
<title>Preserve `SyntaxContext` for invalid/dummy spans in crate metadata</title>
<updated>2021-06-11T16:07:18+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2021-05-12T04:10:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9529cbd0ba0ec29308589dbc8899305bd629f72a'/>
<id>urn:sha1:9529cbd0ba0ec29308589dbc8899305bd629f72a</id>
<content type='text'>
Fixes #85197

We already preserved the `SyntaxContext` for invalid/dummy spans in the
incremental cache, but we weren't doing the same for crate metadata.
If an invalid (lo/hi from different files) span is written to the
incremental cache, we will decode it with a 'dummy' location, but keep
the original `SyntaxContext`. Since the crate metadata encoder was only
checking for `DUMMY_SP` (dummy location + root `SyntaxContext`),
the metadata encoder would treat it as a normal span, encoding the
`SyntaxContext`. As a result, the final span encoded to the metadata
would change across sessions, even if the crate itself was unchanged.

This PR updates our encoding of spans in the crate metadata to mirror
the encoding of spans into the incremental cache. We now always encode a
`SyntaxContext`, and encode location information for spans with a
non-dummy location.
</content>
</entry>
<entry>
<title>Make `real_rust_path_dir` a TRACKED_NO_CRATE_HASH option</title>
<updated>2021-04-27T16:48:25+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2021-04-27T16:25:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=39648ea467a39afa3676d900656874947c747690'/>
<id>urn:sha1:39648ea467a39afa3676d900656874947c747690</id>
<content type='text'>
This also adds support for doc-comments to Options.
</content>
</entry>
<entry>
<title>Rollup merge of #84450 - jyn514:missing-std, r=petrochenkov</title>
<updated>2021-04-25T21:15:11+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2021-04-25T21:15:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=379a55c64ef72df1c8272ac33ba730244d1395d4'/>
<id>urn:sha1:379a55c64ef72df1c8272ac33ba730244d1395d4</id>
<content type='text'>
Give a better error when `std` or `core` are missing

- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help.
- On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set
- Add a note about `#![no_std]` if `std` is missing but not core
- Add a note that std may be unsupported if `std` is missing but not core

Fixes https://github.com/rust-lang/rust/issues/84418.

r? `@petrochenkov`
</content>
</entry>
<entry>
<title>Give a better error when std or core are missing</title>
<updated>2021-04-25T16:45:31+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2021-04-22T19:23:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d326a4b4c9176193ff0ac445ec14ac50bd081f04'/>
<id>urn:sha1:d326a4b4c9176193ff0ac445ec14ac50bd081f04</id>
<content type='text'>
- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help.
- Add a note about `#![no_std]` if `std` is missing but not core
- On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set
- Add a note that std may be unsupported if `std` is missing but not core
- Don't suggest `#![no_std]` when the load isn't injected by the
  compiler
</content>
</entry>
<entry>
<title>Implement #[rustc_skip_array_during_method_dispatch]</title>
<updated>2021-04-16T18:11:59+00:00</updated>
<author>
<name>Josh Stone</name>
<email>jistone@redhat.com</email>
</author>
<published>2021-04-12T23:03:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b79af2fcde91abeae805c2dbccfdbf7114bfd47b'/>
<id>urn:sha1:b79af2fcde91abeae805c2dbccfdbf7114bfd47b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #83820 - petrochenkov:nolinkargs, r=nagisa</title>
<updated>2021-04-04T22:24:33+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2021-04-04T22:24:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3c2e4ff525a710987c4e01805edf051740cb022b'/>
<id>urn:sha1:3c2e4ff525a710987c4e01805edf051740cb022b</id>
<content type='text'>
Remove attribute `#[link_args]`

Closes https://github.com/rust-lang/rust/issues/29596

The attribute could always be replaced with `-C link-arg`, but cargo didn't provide a reasonable way to pass such flags to rustc.
Now cargo supports `cargo:rustc-link-arg*` directives in build scripts (https://doc.rust-lang.org/cargo/reference/unstable.html#extra-link-arg), so this attribute can be removed.
</content>
</entry>
<entry>
<title>Rollup merge of #73945 - est31:unused_externs, r=Mark-Simulacrum</title>
<updated>2021-04-04T17:19:58+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2021-04-04T17:19:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a1c34493d4d733fedf2a8609d7426a425eb7cf84'/>
<id>urn:sha1:a1c34493d4d733fedf2a8609d7426a425eb7cf84</id>
<content type='text'>
Add an unstable --json=unused-externs flag to print unused externs

This adds an unstable flag to print a list of the extern names not used by cargo.

This PR will enable cargo to collect unused dependencies from all units and provide warnings.
The companion PR to cargo is: https://github.com/rust-lang/cargo/pull/8437

The goal is eventual stabilization of this flag in rustc as well as in cargo.

Discussion of this feature is mostly contained inside these threads: #57274 #72342 #72603

The feature builds upon the internal datastructures added by #72342

Externs are uniquely identified by name and the information is sufficient for cargo.
If the mode is enabled, rustc will print json messages like:

```
{"unused_extern_names":["byteorder","openssl","webpki"]}
```

For a crate that got passed byteorder, openssl and webpki dependencies but needed none of them.

### Q: Why not pass -Wunused-crate-dependencies?
A: See [ehuss's comment here](https://github.com/rust-lang/rust/issues/57274#issuecomment-624839355)
   TLDR: it's cleaner. Rust's warning system wasn't built to be filtered or edited by cargo.
   Even a basic implementation of the feature would have to change the "n warnings emitted" line that rustc prints at the end.
   Cargo ideally wants to synthesize its own warnings anyways. For example, it would be hard for rustc to emit warnings like
   "dependency foo is only used by dev targets", suggesting to make it a dev-dependency instead.

### Q: Make rustc emit used or unused externs?
A: Emitting used externs has the advantage that it simplifies cargo's collection job.
   However, emitting unused externs creates less data to be communicated between rustc and cargo.
   Often you want to paste a cargo command obtained from `cargo build -vv` for doing something
   completely unrelated. The message is emitted always, even if no warning or error is emitted.
   At that point, even this tiny difference in "noise" matters. That's why I went with emitting unused externs.

### Q: One json msg per extern or a collective json msg?
A: Same as above, the data format should be concise. Having 30 lines for the 30 crates a crate uses would be disturbing to readers.
   Also it helps the cargo implementation to know that there aren't more unused deps coming.

### Q: Why use names of externs instead of e.g. paths?
A: Names are both sufficient as well as neccessary to uniquely identify a passed `--extern` arg.
   Names are sufficient because you *must* pass a name when passing an `--extern` arg.
   Passing a path is optional on the other hand so rustc might also figure out a crate's location from the file system.
   You can also put multiple paths for the same extern name, via e.g. `--extern hello=/usr/lib/hello.rmeta --extern hello=/usr/local/lib/hello.rmeta`,
   but rustc will only ever use one of those paths.
   Also, paths don't identify a dependency uniquely as it is possible to have multiple different extern names point to the same path.
   So paths are ill-suited for identification.

### Q: What about 2015 edition crates?
A: They are fully supported.
   Even on the 2015 edition, an explicit `--extern` flag is is required to enable `extern crate foo;` to work (outside of sysroot crates, which this flag doesn't warn about anyways).
   So the lint would still fire on 2015 edition crates if you haven't included a dependency specified in Cargo.toml using `extern crate foo;` or similar.
   The lint won't fire if your sole use in the crate is through a `extern crate foo;`   statement, but that's not its job.
   For detecting unused `extern crate foo` statements, there is the `unused_extern_crates` lint
   which can be enabled by `#![warn(unused_extern_crates)]` or similar.

cc ```@jsgf``` ```@ehuss``` ```@petrochenkov``` ```@estebank```
</content>
</entry>
<entry>
<title>Remove attribute `#[link_args]`</title>
<updated>2021-04-03T18:25:53+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2021-04-03T17:20:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5839bff0bac6063147c8905388713a787577208f'/>
<id>urn:sha1:5839bff0bac6063147c8905388713a787577208f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #83682 - bjorn3:mmap_wrapper, r=cjgillot</title>
<updated>2021-04-03T13:23:42+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2021-04-03T13:23:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=97717a561844eccbb6d6cc114adb94a8fa4e0172'/>
<id>urn:sha1:97717a561844eccbb6d6cc114adb94a8fa4e0172</id>
<content type='text'>
Add an Mmap wrapper to rustc_data_structures

This wrapper implements StableAddress and falls back to directly reading the file on wasm32.

Taken from #83640, which I will close due to the perf regression.
</content>
</entry>
<entry>
<title>Remove hir::CrateItem.</title>
<updated>2021-03-30T18:31:06+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2021-03-30T18:31:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9d8f833e0587b9c3991f94b227369f38ee48613a'/>
<id>urn:sha1:9d8f833e0587b9c3991f94b227369f38ee48613a</id>
<content type='text'>
</content>
</entry>
</feed>
