Add "type_name" support in emulate_intrinsic()
I did some dumb Git things and deleted my original fork repo semi-accidentally (but probably for the best as I'd messed up the history.)
This is the same issue as #61399, which was obviously auto-closed, to be clear.
Looks like Azure has updated images recently to install Rust by default,
but that can interfere with our own compiler (for example Cargo's test
suite we think) so be sure to uninstall it before proceeding.
std: Update dependency on `backtrace`
Discovered in #61416 an accidental regression in libstd's backtrace
behavior is that it previously attempted to consult libbacktrace and
would then fall back to `dladdr` if libbacktrace didn't report anything.
The `backtrace` crate, however, did not do this, so that's now been
fixed!
Changes: https://github.com/rust-lang/backtrace-rs/compare/0.3.25...0.3.29Closes#61416
Discovered in #61416 an accidental regression in libstd's backtrace
behavior is that it previously attempted to consult libbacktrace and
would then fall back to `dladdr` if libbacktrace didn't report anything.
The `backtrace` crate, however, did not do this, so that's now been
fixed!
Changes: https://github.com/rust-lang/backtrace-rs/compare/0.3.25...0.3.27Closes#61416
The commit combines two calls into one by saving the result in a local
variable. The commit also moves the check for `async` later, so that
when a different keyword is present the `rust_2018` call will be avoided
completely.
They can each now do a single `HygieneData::with` call by replacing the
`SyntaxContext` and `Mark` methods with the equivalent methods from
`HygieneData`.
Hide gen_future API from documentation
This is internal rustc only API which should never be used outside code created by the current `async` transform, if it is used then the panic messages don't make sense as they're written from the perspective of that meaning there is a bug in the `async` transform (e.g. #61482).
Fix NLL typeck ICEs
* Don't ICE when a type containing a region is constrained by nothing
* Don't ICE trying to normalize a type in a `ParamEnv` containing global bounds.
To explain what was happening in the `issue-61311-normalize.rs` case:
* When borrow checking the `the_fn` in the last `impl` we would try to normalize `Self::Proj` (`<Unit as HasProjFn>::Proj`).
* We would find the `impl` that we're checking and and check its `where` clause.
* This would need us to check `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`
* We find two possible implementations, the blanket impl and the bound in our `ParamEnv`.
* The bound in our `ParamEnv` was canonicalized, so we don't see it as a global bound. As such we prefer it to the `impl`.
* This means that we cannot normalize `<Box<dyn Obj + 'static> as HasProj>::Proj` to `Unit`.
* The `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` bound, which looks like it should be in our `ParamEnv` has been normalized to `Unit: Bound`.
* We fail to prove `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`.
* We ICE, since we believe typeck have errored.
Closes#61311Closes#61315Closes#61320
r? @pnkfelix
cc @nikomatsakis
Add new diagnostic writer using annotate-snippet library
This adds a new diagnostic writer `AnnotateRsEmitterWriter` that uses
the [`annotate-snippet`][as] library to print out the human readable
diagnostics.
The goal of #59346 is to eventually switch over to using the library instead of
maintaining our own diagnostics output.
This PR does **not** add all the required features to the new
diagnostics writer. It is only meant as a starting point so that other
people can start contributing as well.
There are some FIXMEs in `librustc_errors/annotate_rs_emitter.rs` that
point at yet to be implemented features of the new diagnostic emitter, however
those are most likely not exhaustive.
[as]: https://github.com/rust-lang/annotate-snippets-rs
As per issue #54985 removes the not useful suggestion to remove asterisk in
move errors. Includes minor changes to tests in the `ui` suite to account
for the removed suggestion.