Remove dead or useless code from Session
This is a more principled follow-up to https://github.com/rust-lang/rust/pull/83185#discussion_r601753839.
- Rename `Parser::span_fatal_err` -> `Parser::span_err`
- Remove some unnecessary uses of `struct_span_fatal`
- Make `Diagnostic::span_fatal` unconditionally raise an error
- Add `impl Deref<Target = Handler>` for Session and remove all functions that are exactly the same as their Handler counterparts
- Note why `Handler::fatal` is different from `Sesssion::fatal`
- Remove unused `opt_span_warn` function
r? `@oli-obk` or `@estebank`
Remove `FakeDefId::expect_local()`
This function returned a fake `DefIndex`, with no indication that it was
fake, when it was provided with a `FakeDefId::Fake`. Every use of the
function uses the returned `DefIndex` in a call to
`tcx.local_def_id_to_hir_id()`, which I'm pretty sure would panic if it
were given a fake `DefIndex`.
I removed the function and replaced all calls to it with a call to
`expect_real()` followed by `DefId::expect_local()` (that's a function
on the *real* `DefId`).
Now, in the case that the function is not inlined, the panic location
will be the caller's location, which is more helpful since the panic is
not `expect_real()`'s fault.
This function returned a fake `DefIndex`, with no indication that it was
fake, when it was provided with a `FakeDefId::Fake`. Every use of the
function uses the returned `DefIndex` in a call to
`tcx.local_def_id_to_hir_id()`, which I'm pretty sure would panic if it
were given a fake `DefIndex`.
I removed the function and replaced all calls to it with a call to
`expect_real()` followed by `DefId::expect_local()` (that's a function
on the *real* `DefId`).
Bump stdarch submodule
Major changes:
- More AVX-512 intrinsics.
- More ARM & AArch64 NEON intrinsics.
- Updated unstable WASM intrinsics to latest draft standards.
- Intrinsics that previously used `#[rustc_args_required_const]` now use const generics. See #83167 for more details.
- `std_detect` is now a separate crate instead of a submodule of `std`.
This doesn't seem to be necessary anymore, although I don't know
at which point or why that changed.
Forcing -O1 makes some tests fail under NewPM, because NewPM also
performs inlining at -O1, so it ends up performing much more
optimization in practice than before.
This causes an assertion failure under NewPM, because it also ends
up disabling the NameAnonGlobals pass.
Instead pass -Copt-level=0 to disable optimizations. If that should
be insufficient, we can use -C no-prepopulate-passes.
Update cargo
7 commits in f3e13226d6d17a2bc5f325303494b43a45f53b7f..e51522ab3db23b0d8f1de54eb1f0113924896331
2021-04-30 21:50:27 +0000 to 2021-05-07 21:29:52 +0000
- Add CARGO_TARGET_TMPDIR env var for integration tests & benches (rust-lang/cargo#9375)
- Bump to 0.55.0, update changelog (rust-lang/cargo#9464)
- Some updates to the unstable documentation (rust-lang/cargo#9457)
- Add CARGO_PROFILE_<name>_SPLIT_DEBUGINFO to env docs. (rust-lang/cargo#9456)
- Add `report` subcommand. (rust-lang/cargo#9438)
- Respect Cargo.toml `[package.exclude]` even not in a git repo. (rust-lang/cargo#9186)
- Document the other crates in the codebase in the contrib guide. (rust-lang/cargo#9439)
rustdoc: Link to the docs on namespaces when an unknown disambiguator is found
This was reverted in https://github.com/rust-lang/rust/pull/84950; this re-lands the changes, but without different behavior depending on the channel.
r? `@camelid` cc `@pietroalbini`
Don't stop running rustdoc-gui tests at first failure
I just realized that before this PR, the rustdoc-gui test suite was stopping at the first failure, which isn't very convenient. All tests are now running and if one failed, it returns an error at the end once all tests have run.
r? `@Mark-Simulacrum`
Remove SpanInterner::get
- It's used exactly once, so it's trivial to replace
- It doesn't match the normal convention for containers: normally
`get()` returns an option and indexing panics. Instead `SpanInterner::get()` panics
and there's no indexing operation available.
Improve diagnostics for functions in `struct` definitions
Tries to implement #76421.
This is probably going to need unit tests, but I wanted to hear from review all the cases tests should cover.
I'd like to follow up with the "mechanically applicable suggestion here that adds an impl block" step, but I'd need guidance. My idea for now would be to try to parse a function, and if that succeeds, create a dummy `ast::Item` impl block to then format it using `pprust`. Would that be a viable approach? Is there a better alternative?
r? `@matklad` cc `@estebank`