rust/src
bors a2545fd6fc Auto merge of #133540 - ehuss:compiletest-proc-macro, r=jieyouxu
Compiletest: add proc-macro header

This adds a `proc-macro` header to simplify using proc-macros, and to reduce boilerplate. This header works similar to the `aux-build` header where you pass a path for a proc-macro to be built.

This allows the `force-host`, `no-prefer-dynamic` headers, and `crate_type` attribute to be removed. Additionally it uses `--extern` like `aux_crate` (allows implicit `extern crate` in 2018) and `--extern proc_macro` (to place in the prelude in 2018).

~~This also includes a secondary change which defaults the edition of proc-macros to 2024. This further reduces boilerplate (removing `extern crate proc_macro;`), and allows using modern Rust syntax. I was a little on the fence including this. I personally prefer it, but I can imagine it might be confusing to others.~~ EDIT: Removed

Some tests were changed so that when there is a chain of dependencies A→B→C, that the `@ proc-macro` is placed in `B` instead of `A` so that the `--extern` flag works correctly (previously it depended on `-L` to find `C`). I think this is better to make the dependencies more explicit. None of these tests looked like the were actually testing this behavior.

There is one test that had an unexplained output change: `tests/ui/macros/same-sequence-span.rs`. I do not know why it changed, but it didn't look like it was particularly important. Perhaps there was a normalization issue?

This is currently not compatible with the rustdoc `build-aux-docs` header. It can probably be fixed, I'm just not feeling motivated to do that right now.

### Implementation steps

- [x] Document this new behavior in rustc-dev-guide once we figure out the specifics. https://github.com/rust-lang/rustc-dev-guide/pull/2149
2024-11-28 19:00:58 +00:00
..
bootstrap print generated doc paths 2024-11-27 22:57:53 +03:00
build_helper move src/tools/build_helper into src/build_helper 2024-11-11 11:19:11 +03:00
ci Rollup merge of #133453 - ferrocene:check-license-metadata, r=Kobzol 2024-11-27 08:13:48 +01:00
doc Rollup merge of #133452 - taiki-e:hexagon-asm-pred, r=Amanieu 2024-11-28 12:06:02 +01:00
etc Rollup merge of #132803 - wangjingcun:master, r=Mark-Simulacrum 2024-11-25 07:01:40 +01:00
gcc@fd3498bff0 Update GCC version 2024-09-06 16:01:46 +02:00
librustdoc Fix new clippy lints 2024-11-28 03:05:43 +01:00
llvm-project@104d0d16c3 Update LLVM to 19.1.4 2024-11-20 16:59:48 +01:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types Auto merge of #131980 - matthiaskrgr:rollup-iy5nw71, r=matthiaskrgr 2024-10-20 21:40:21 +00:00
tools Auto merge of #133540 - ehuss:compiletest-proc-macro, r=jieyouxu 2024-11-28 19:00:58 +00:00
README.md
stage0 bump stage0 to 1.83.0-beta.1 2024-10-15 20:13:55 -07:00
version Bump to 1.85 2024-11-22 11:08:33 +00:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.