| Age | Commit message (Collapse) | Author | Lines |
|
Provide a span if main function is not present in crate
Unfortunately, the diagnostic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.
Tests are already updated for this change, so a dedicated test is not added.
Resolves #36561.
|
|
Unfortunately, the diagnotic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.
|
|
|
|
Add methods for converting `bool` to `Option<T>`
This provides a reference implementation for https://github.com/rust-lang/rfcs/pull/2757.
|
|
Support "soft" feature-gating using a lint
Use it for feature-gating `#[bench]`.
Closes https://github.com/rust-lang/rust/issues/63798.
|
|
Use it for feature-gating `#[bench]`
|
|
|
|
|
|
This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.
|
|
Add Option<Span> to `require_lang_item`
Fixes #63954
I'm not sure where to take `Some(span)` or something so I use `None` in many places.
r? @estebank
|
|
|
|
|
|
|
|
Currently the default is "inherited" from context, so e.g. `&impl
Foo<Item = dyn Bar>` would default to `&'x impl Foo<Item = dyn Bar +
'x>`, but this triggers an ICE and is not very consistent.
This patch doesn't implement what I expect would be the correct
semantics, because those are likely too complex. Instead, it handles
what I'd expect to be the common case -- where the trait has no
lifetime parameters.
|
|
Object-lifetime-default elision is distinct from other forms of
elision; it always refers to some enclosing lifetime *present in the
surrounding type* (e.g., `&dyn Bar` expands to `&'a (dyn Bar + 'a)`.
If there is no enclosing lifetime, then it expands to `'static`.
Therefore, in an `impl Trait<Item = dyn Bar>` setting, we don't expand
to create a lifetime parameter for the `dyn Bar + 'X` bound. It will
just be resolved to `'static`.
Annoyingly, the responsibility for this resolution is spread across
multiple bits of code right now (`middle::resolve_lifetimes`,
`lowering`). The lowering code knows that the default is for an object
lifetime, but it doesn't know what the correct result would be.
Probably this should be fixed, but what we do now is a surgical fix:
we have it generate a different result for elided lifetimes in a
object context, and then we can ignore those results when figuring out
the lifetimes that are captured in the opaque type.
|
|
|
|
|
|
with -> which , and re-wrap line.
|
|
cleanup: Remove `Spanned` where possible
It generally only makes sense on enums, otherwise it's more convenient to "flatten" it by adding a span field to the struct it wraps.
|
|
Fix ICE #63226
Fixes #63226
r? @oli-obk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix generator size regressions due to optimization
I tested the generator optimizations in #60187 and #61922 on the Fuchsia
build, and noticed that some small generators (about 8% of the async fns
in our build) increased in size slightly.
This is because in #60187 we split the fields into two groups, a
"prefix" non-overlap region and an overlap region, and lay them out
separately. This can introduce unnecessary padding bytes between the two
groups.
In every single case in the Fuchsia build, it was due to there being
only a single variant being used in the overlap region. This means that
we aren't doing any overlapping, period. So it's better to combine the
two regions into one and lay out all the fields at once, which is what
this change does.
r? @cramertj
cc @eddyb @Zoxc
|
|
|
|
|
|
|
|
|
|
dead_code: Properly inspect fields in struct patterns with type relative paths
Closes #63151.
|
|
|
|
|
|
|
|
|
|
This prevents uninhabited fields from "infecting" the abi and
largest_niche of the generator layout.
This fixes a latent bug, where an uninhabited field could be promoted to
the generator prefix and cause the entire generator to become
uninhabited.
|
|
They were resolved with modern hygiene, making this just a strange way
to shadow lifetimes.
|
|
|
|
|
|
|
|
|
|
Remove support for -Zlower-128bit-ops
It is broken and unused
cc https://github.com/rust-lang/rust/issues/58969
blocked https://github.com/rust-lang-nursery/compiler-builtins/pull/302 (removes definitions of the lang items removed in this PR)
r? @alexcrichton
|
|
Turn `#[global_allocator]` into a regular attribute macro
It was a 99% macro with exception of some diagnostic details.
As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks.
Fixes https://github.com/rust-lang/rust/issues/44113
Fixes https://github.com/rust-lang/rust/issues/58072
|
|
|
|
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
It is broken and unused
|
|
in which we suggest anonymizing single-use lifetimes in paths
Following @nikomatsakis's [October 2017 comment](https://github.com/rust-lang/rust/issues/44752#issuecomment-340885834).

r? @estebank
cc @eddyb (you were saying something about running single-use-lifetimes against the tree the other week?)
|
|
|