| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Remove some imports to the rustc crate
- When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code).
- Use `rustc_session::` imports instead of `rustc::{session, lint}`.
r? @Zoxc
|
|
|
|
Don't use static crt by default when build proc-macro
Don't check value of `crt-static` when build proc-macro crates, since they are always built dynamically.
For more information, see https://github.com/rust-lang/cargo/issues/7563#issuecomment-591965320
I hope this will fix issues about compiling `proc_macro` crates on musl host without bring more issues.
Fix https://github.com/rust-lang/cargo/issues/7563
|
|
|
|
Use queries for the HIR map
r? @eddyb cc @michaelwoerister
|
|
ast: `Mac`/`Macro` -> `MacCall`
It's now obvious that these refer to macro calls rather than to macro definitions.
It's also a single name instead of two different names in different places.
`rustc_expand` usually calls macro calls in a wide sense (including attributes and derives) "macro invocations", but structures and variants renamed in this PR are only relevant to fn-like macros, so it's simpler and clearer to just call them calls.
cc https://github.com/rust-lang/rust/pull/63586#discussion_r314232513
r? @eddyb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #69697 (Add explanation for E0380)
- #69698 (Use associated constants of integer types)
- #69711 (Update macros.rs: fix documentation typo.)
- #69713 (more clippy cleanups)
- #69728 (Make link to `std::str` active)
- #69732 (Clean E0382 and E0384 explanations)
- #69736 (even more clippy cleanups)
- #69742 (Fixed a typo)
Failed merges:
r? @ghost
|
|
rename feature to const_eval_limit
|
|
anything.
For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
|
|
|
|
|
|
|
|
use char instead of &str for single char patterns
|
|
example:
let s: String = format!("hello").into();
|
|
|
|
|
|
|
|
parse: fuse associated and extern items up to defaultness
Language changes:
- The grammar of extern `type` aliases is unified with associated ones, and becomes:
```rust
TypeItem = "type" ident generics {":" bounds}? where_clause {"=" type}? ";" ;
```
Semantic restrictions (`ast_validation`) are added to forbid any parameters in `generics`, any bounds in `bounds`, and any predicates in `where_clause`, as well as the presence of a type expression (`= u8`).
(Work still remains to fuse this with free `type` aliases, but this can be done later.)
- The grammar of constants and static items (free, associated, and extern) now permits the absence of an expression, and becomes:
```rust
GlobalItem = {"const" {ident | "_"} | "static" "mut"? ident} {"=" expr}? ";" ;
```
- A semantic restriction is added to enforce the presence of the expression (the body).
- A semantic restriction is added to reject `const _` in associated contexts.
Together, these changes allow us to fuse the grammar of associated items and extern items up to `default`ness which is the main goal of the PR.
-----------------------
We are now very close to fully fusing the entirely of item parsing and their ASTs. To progress further, we must make a decision: should we parse e.g. `default use foo::bar;` and whatnot? Accepting that is likely easiest from a parsing perspective, as it does not require using look-ahead, but it is perhaps not too onerous to only accept it for `fn`s (and all their various qualifiers), `const`s, `static`s, and `type`s.
r? @petrochenkov
|
|
|
|
|
|
|
|
|
|
Same idea for `Unsafety` & use new span for better diagnostics.
|
|
[experiment] Support linking from a .rlink file
Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file.
Part of Issue #64191
|
|
Remove unused feature gates
I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
|
|
Flag `-Z no-link` was previously introduced, which allows creating
an `.rlink` file to perform compilation without linking.
This change enables linking from an `.rlink` file.
|
|
|
|
|
|
remove redundant imports (clippy::single_component_path_imports)
|
|
Split `join_codegen_and_link()` into two steps
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
|
|
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
|
|
|
|
Use BufWriter for emitting MIR
I noticed that `--emit=mir` takes long time on a large crate. https://github.com/rust-lang/rust/pull/64344 seem to have fixed `-Zdump-mir`, but not `--emit=mir`.
|
|
|
|
|
|
2. invert rustc_session & syntax deps
3. drop rustc_session dep in rustc_hir
|
|
For now, this is all the crate contains, but more
attribute logic & types will be moved there over time.
|
|
|
|
|
|
|
|
This commit reduces the size of `Nonterminal` from a whopping 240 bytes
to 72 bytes (on x86-64), which gets it below the `memcpy` threshold.
It also removes some impedance mismatches with `Annotatable`, which
already uses `P` for these variants.
|
|
|