6862: Add LifetimeParam resolving to Semantics r=matklad a=Veykril
This is stuff required for the lifetime references/definitions PR. I pulled this out to make it easier to review as well as because there is one thing that still has to be addressed which can be found in the review comments.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Since we just tried running `rustup component add`, it doesn't make sense to me
to recommend trying that again. If we're reaching this case, it's probably more
likely that rustc was installed via package manager, in which case the source
should be installed the same way (e.g. if you install the rust-src package on
Ubuntu it will install a symlink in the right place to make our sysroot
detection work).
6852: Ignore lifetime params in substitutions r=matklad a=Veykril
[`hir_ty::utils::Generics`](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/utils.rs#L153) currently only assumes type parameters but not lifetime parameters and therefor creates incorrect index and length calculations, this PR just makes the use sites ignore LifetimeGenerics for now.
This fixes the panic at least locally for me for `analysis-stats`. Funnily enough this panic prevented me from using reference search for the `args` field to fix this problem.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6818: Add Lifetimes to the HIR r=matklad a=Veykril
This doesn't handle resolve yet as I don't know yet how that will be used. I'll get to that once I start moving the lifetime reference PR to the hir.
This also adds a new `hir` name type for lifetimes and labels, `hir::LifetimeName`.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6839: Infer labeled blocks r=flodiebold a=Veykril
The test should cover all the interesting cases I believe(main part of it is copied from the loop label break test above it).
The test is indented to stay consistent with the rest of the tests in the file, I can dedent all the tests in the file in a follow up PR if desired.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6819: Add builtin attributes for use in nameres r=jonas-schievink a=jonas-schievink
These are not yet used, but have to go through nameres later in order to support procedural macro attributes
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
derive(Clone, Copy) reads better than derive(Copy, Clone).
However, we preserve the reverse ordering in the lookup text for
sorting purposes. That way, it's convenient to type just `Ord` to
derive everything.
6807: Replicate Cargo environment variables r=jonas-schievink a=jonas-schievink
These might be relied on by procedural macros, and can also be accessed via `env!`.
Required for fixing https://github.com/rust-analyzer/rust-analyzer/issues/6696. We do not yet propagate these to any proc macros though.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6804: Bump the macro token limit r=jonas-schievink a=jonas-schievink
Should fix https://github.com/rust-analyzer/rust-analyzer/issues/6504
Not entirely sure what the previous limit was based on, but it looks like it does get hit in practice.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>