Add support for trait-objects without a principal
The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate.
Fixes#33140.
Fixes#57057.
r? @nikomatsakis
Implement the Re-rebalance coherence RFC
This is the first time I touch anything in the compiler so just tell me if I got something wrong.
Big thanks to @sgrif for the pointers where to look for those things.
cc #55437
It's possible that `is_object_safe` is called on a trait that is ill-formed, and we shouldn't ICE unless there are no errors being raised. Using `delay_span_bug` solves this.
fixes#56806
make `panictry!` private to libsyntax
This commit completely removes usage of the `panictry!` macro from
outside libsyntax. The macro causes parse errors to be fatal, so using
it in libsyntax_ext caused parse failures *within* a syntax extension to
be fatal, which is probably not intended.
Furthermore, this commit adds spans to diagnostics emitted by empty
extensions if they were missing, à la #56491.
Trying to write a `const_fn` lint for Clippy. @oli-obk suggested
[here][link] to use the `is_min_const_fn` function from the
`qualify_min_const_fn` module. However, the module is currently private
and this commit makes it public.
I lack any historical knowledge of the development of the `const_fn`
feature, so I'm not sure if it was private on purpose or not. fwiw, all
modules are already public except `qualify_min_const_fn`.
[link]: https://github.com/rust-lang/rust-clippy/issues/2440#issuecomment-446109978
Forbid recursive impl trait
There is no type T, such that `T = [T; 2]`, but impl Trait could sometimes
be to circumvented this.
This patch makes it a hard error for an opaque type to resolve to such a
"type". Before this can be merged it needs
- [x] A better error message - it's good enough for now.
- [x] A crater run (?) to see if this any real-world code
closes#47659
Allow to dispatch fn traits depending on number of parameters
Hello,
By following @eddyb's advise on issue #45510, I managed to have the snippets of code in #45510 and #18952 passing without breaking older diagnostics.
EDIT: the codegen tests breakage I experienced is due to the poor quality of my laptop.
If any kind reviewer has any advice, you are very welcome.
In #56986 the linkage of jemalloc to the compiler was switched from the
driver library to the rustc binary to ensure that only rustc itself uses
jemalloc. In doing so, however, it turns out jemalloc wasn't actually
linked in at all! None of the symbols were referenced so the static
library wasn't used. This means that jemalloc wasn't pulled in at all.
This commit performs a bit of a dance to reference jemalloc symbols,
attempting to pull it in despite LLVM's optimizations.
Closes#57115