about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-03-02Avoid some interning in bootstrapNilstrieb-140/+128
This interning is pointless and only makes the code more complex. The only remaining use of interning is `TargetSelection`, for which I left a comment.
2024-03-02Promote OpenHarmony targets to tier 2Amanieu d'Antras-4/+121
MCP: rust-lang/compiler-team#719
2024-03-02add option to track all read/write accesses to tracked allocationsRalf Jung-14/+38
2024-03-02Add a new `wasm32-wasip1` target to rustcAlex Crichton-4/+139
This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-03Add a tidy check that checks whether the fluent slugs only appear oncer0cky-6/+96
2024-03-02print thread name in miri error backtracesRalf Jung-170/+219
2024-03-02Rollup merge of #121855 - GuillaumeGomez:trait-item-info, r=notriddleMatthias Krüger-13/+14
Correctly generate item info of trait items Fixes #121772. The `document_info` function was wrongly used when documenting a trait item. r? `@notriddle`
2024-03-02remove some flags that haven't had an effect in a whileRalf Jung-11/+0
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-7/+42
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-03-02Auto merge of #121878 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 12 commits in 8964c8ccff6e420e2a38b8696d178d69fab84d9d..f772ec0224d3755ce52ac5128a80319fb2eb45d0 2024-02-27 19:22:46 +0000 to 2024-03-01 22:57:35 +0000 - feat(toml): Warn on unset Edition (rust-lang/cargo#13505) - fix(msrv): Report all incompatible packages, not just a random one (rust-lang/cargo#13514) - refactor: abstract `std::fs` away from on-disk index cache (rust-lang/cargo#13515) - chore(deps): update compatible (rust-lang/cargo#13507) - chore(deps): update rust crate rusqlite to 0.31.0 (rust-lang/cargo#13510) - [docs]: Clarify vendored sources as read-only and way to modify (rust-lang/cargo#13512) - chore(deps): update rust crate supports-hyperlinks to v3 (rust-lang/cargo#13511) - refactor: Clarify more Config -> Context (rust-lang/cargo#13506) - test: Make `edition` explicit in packages (rust-lang/cargo#13504) - Add all unit's children recursively for `doc.extern-map` option (rust-lang/cargo#13481) - fix(rustc): Always pass --edition to rustc (rust-lang/cargo#13499) - Silently ignore `cargo::rustc-check-cfg` to avoid MSRV annoyance when stabilizing `-Zcheck-cfg` (rust-lang/cargo#13438) r? ghost
2024-03-01Update cargoWeihang Lo-0/+0
2024-03-02Auto merge of #121870 - matthiaskrgr:rollup-mfpa3jx, r=matthiaskrgrbors-17/+3
Rollup of 11 pull requests Successful merges: - #111505 (Made `INVALID_DOC_ATTRIBUTES` lint deny by default) - #120305 (Delete line if suggestion would replace it with an empty line) - #121153 (Suggest removing superfluous semicolon when statements used as expression) - #121497 (`-Znext-solver=coherence`: suggest increasing recursion limit) - #121634 (Clarify behavior of slice prefix/suffix operations in case of equality) - #121706 (match lowering: Remove hacky branch in sort_candidate) - #121730 (Add profiling support to AIX) - #121750 (match lowering: Separate the `bool` case from other integers in `TestKind`) - #121803 (Never say "`Trait` is implemented for `{type error}`") - #121811 (Move sanitizer ui tests to sanitizer directory) - #121824 (Implement missing ABI structures in StableMIR) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-01Rollup merge of #121811 - ↵Matthias Krüger-3/+3
rcvalle:rust-cfi-move-ui-tests-to-sanitizer-directory, r=compiler-errors Move sanitizer ui tests to sanitizer directory Moves the sanitizer ui tests to the sanitizer directory and removes the sanitizer prefix from tests file names similarly to how the sanitizer codegen tests are organized.
2024-03-01Rollup merge of #120305 - clubby789:unused-import-line, r=estebankMatthias Krüger-14/+0
Delete line if suggestion would replace it with an empty line Fixes #120296
2024-03-01Auto merge of #121395 - nikic:update-llvm-21, r=cuviperbors-11/+32
Update to LLVM 18.1.0 rc 4 Fixes https://github.com/rust-lang/rust/issues/120819. Fixes https://github.com/rust-lang/rust/issues/121180. Fixes https://github.com/rust-lang/rust/issues/121239. Fixes https://github.com/rust-lang/rust/issues/121367.
2024-03-01Auto merge of #121859 - matthiaskrgr:rollup-i724wpm, r=matthiaskrgrbors-24/+202
Rollup of 12 pull requests Successful merges: - #120646 (Fix incorrect suggestion for uninitialized binding in pattern) - #121416 (Improve error messages for generics with default parameters) - #121475 (Add tidy check for .stderr/.stdout files for non-existent test revisions) - #121580 (make unused_imports less assertive in test modules) - #121736 (Remove `Mutex::unlock` Function) - #121784 (Make the success arms of `if lhs || rhs` meet up in a separate block) - #121818 (CFI: Remove unused `typeid_for_fnsig`) - #121819 (Handle stashing of delayed bugs) - #121828 (Remove unused fluent messages) - #121831 (Fix typo in comment) - #121850 (Make `ZeroablePrimitive` trait unsafe.) - #121853 (normalizes-to: handle negative impls) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-01Propegate HIR and AST `f16` and `f128` types to clippyTrevor Gross-0/+9
2024-03-01Propegate HIR and AST `f16` and `f128` types to rustdocTrevor Gross-0/+4
2024-03-01Modify opt-dist logic for finding LLVM artifactsJakub Beránek-0/+13
2024-03-01Rollup merge of #121475 - jieyouxu:tidy-stderr-check, r=the8472,compiler-errorsMatthias Krüger-24/+202
Add tidy check for .stderr/.stdout files for non-existent test revisions Closes #77498.
2024-03-01Auto merge of #113026 - jieyouxu:run-make-v2, r=bjorn3bors-10/+506
Introduce `run-make` V2 infrastructure, a `run_make_support` library and port over 2 tests as example ## Preface See [issue #40713: Switch run-make tests from Makefiles to rust](https://github.com/rust-lang/rust/issues/40713) for more context. ## Basic Description of `run-make` V2 `run-make` V2 aims to eliminate the dependency on `make` and `Makefile`s for building `run-make`-style tests. Makefiles are replaced by *recipes* (`rmake.rs`). The current implementation runs `run-make` V2 tests in 3 steps: 1. We build the support library `run_make_support` which the `rmake.rs` recipes depend on as a tool lib. 2. We build the recipe `rmake.rs` and link in the support library. 3. We run the recipe to build and run the tests. `rmake.rs` is basically a replacement for `Makefile`, and allows running arbitrary Rust code. The support library is built using cargo, and so can depend on external crates if desired. The infrastructure implemented by this PR is very barebones, and is the minimally required infrastructure needed to build, run and pass the two example `run-make` tests ported over to the new infrastructure. ### Example `run-make` V2 test ```rs // ignore-tidy-linelength extern crate run_make_support; use std::path::PathBuf; use run_make_support::{aux_build, rustc}; fn main() { aux_build() .arg("--emit=metadata") .arg("stable.rs") .run(); let mut stable_path = PathBuf::from(env!("TMPDIR")); stable_path.push("libstable.rmeta"); let output = rustc() .arg("--emit=metadata") .arg("--extern") .arg(&format!("stable={}", &stable_path.to_string_lossy())) .arg("main.rs") .run(); let stderr = String::from_utf8_lossy(&output.stderr); let version = include_str!(concat!(env!("S"), "/src/version")); let expected_string = format!("stable since {}", version.trim()); assert!(stderr.contains(&expected_string)); } ``` ## Follow Up Work - [ ] Adjust rustc-dev-guide docs
2024-03-01Handle new LLVM sonameNikita Popov-11/+32
LLVM now includes the minor version in the soname, and also changed the names of shared object files. libLLVM-18.so is now a symlink to libLLVM.so.18.1. We need to make some changes to support this: First, we need to run the installed llvm-config binary, rather than the one from the build directory. This is because the symlink does not exist in the build directory, but llvm-config requires it. This looks like an LLVM bug to me, but it's probably a good idea to use the installed version anyway. Second, when installing LLVM into the libdir, we need to install the target of the symlink, ans this is what will get loaded at runtime. However, the rust-dev component in particular also needs to distribute the symlink itself, as download-ci-llvm will end up invoking llvm-config, which requires the symlink to exist. The symlink is not shipped in other components.
2024-03-01Update to LLVM 18.1.0 rc 4Nikita Popov-0/+0
2024-03-01Correctly generate item info of trait itemsGuillaume Gomez-13/+14
2024-03-01If suggestion would leave an empty line, delete itclubby789-14/+0
2024-03-01Auto merge of #12218 - jhpratt:manifest-options-doc, r=blyxyasbors-2/+7
Document manifest options All built-in cargo commands have this output included when run with `cargo foo --help`. Clippy is the only exception, so I have copied the text here. As far as I can tell, the flags come from Cargo itself and not clippy, but the user almost certainly does not care about that. ```text Manifest Options: --manifest-path <PATH> Path to Cargo.toml --frozen Require Cargo.lock and cache are up to date --locked Require Cargo.lock is up to date --offline Run without accessing the network ``` changelog: Add the standard Manifest Options section to the `--help` output
2024-03-01Document manifest optionsJacob Pratt-2/+7
2024-03-01Auto merge of #121728 - tgross35:f16-f128-step1-ty-updates, r=compiler-errorsbors-0/+22
Add stubs in IR and ABI for `f16` and `f128` This is the very first step toward the changes in https://github.com/rust-lang/rust/pull/114607 and the [`f16` and `f128` RFC](https://rust-lang.github.io/rfcs/3453-f16-and-f128.html). It adds the types to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`, and just propagates those out as `unimplemented!` stubs where necessary. These types do not parse yet so there is no feature gate, and it should be okay to use `unimplemented!`. The next steps will probably be AST support with parsing and the feature gate. r? `@compiler-errors` cc `@Nilstrieb` suggested breaking the PR up in https://github.com/rust-lang/rust/pull/120645#issuecomment-1925900572
2024-02-29Move sanitizer ui tests to sanitizer directoryRamon de C Valle-3/+3
Moves the sanitizer ui tests to the sanitizer directory and removes the sanitizer prefix from tests file names similarly to how the sanitizer codegen tests are organized.
2024-02-29Error on stray .stderr/.stdout files for (un-)revisioned tests许杰友 Jieyou Xu (Joe)-24/+202
2024-02-29Rollup merge of #121798 - AaronChen0:master, r=NilstriebMatthias Krüger-2/+2
Fix links in rustc doc
2024-02-29Rollup merge of #121681 - jswrenn:nix-visibility-analysis, r=compiler-errorsMatthias Krüger-1/+0
Safe Transmute: Revise safety analysis This PR migrates `BikeshedIntrinsicFrom` to a simplified safety analysis (described [here](https://github.com/rust-lang/project-safe-transmute/issues/15)) that does not rely on analyzing the visibility of types and fields. The revised analysis treats primitive types as safe, and user-defined types as potentially carrying safety invariants. If Rust gains explicit (un)safe fields, this PR is structured so that it will be fairly easy to thread support for those annotations into the analysis. Notably, this PR removes the `Context` type parameter from `BikeshedIntrinsicFrom`. Most of the files changed by this PR are just UI tests tweaked to accommodate the removed parameter. r? `@compiler-errors`
2024-02-29Rollup merge of #121464 - alexcrichton:fix-wasm64, r=wesleywiserMatthias Krüger-0/+3
rustc: Fix wasm64 metadata object files It looks like LLD will detect object files being either 32 or 64-bit depending on any memory present. LLD will additionally reject 32-bit objects during a 64-bit link. Previously metadata objects did not have any memories in them which led LLD to conclude they were 32-bit objects which broke 64-bit targets for wasm. This commit fixes this by ensuring that for 64-bit targets there's a memory object present to get LLD to detect it's a 64-bit target. Additionally this commit moves away from a hand-crafted wasm encoder to the `wasm-encoder` crate on crates.io as the complexity grows for the generated object file. Closes #121460
2024-02-29Rollup merge of #121326 - ↵Matthias Krüger-24/+6
fmease:detect-empty-leading-where-clauses-on-ty-aliases, r=compiler-errors Detect empty leading where clauses on type aliases 1. commit: refactor the AST of type alias where clauses * I could no longer bear the look of `.0.1` and `.1.0` * Arguably moving `split` out of `TyAlias` into a substruct might not make that much sense from a semantic standpoint since it reprs an index into `TyAlias.predicates` but it's alright and it cleans up the usage sites of `TyAlias` 2. commit: fix an oversight: An empty leading where clause is still a leading where clause * semantically reject empty leading where clauses on lazy type aliases * e.g., on `#![feature(lazy_type_alias)] type X where = ();` * make empty leading where clauses on assoc types trigger lint `deprecated_where_clause_location` * e.g., `impl Trait for () { type X where = (); }`
2024-02-29add regression testRalf Jung-0/+25
2024-02-29Merge from rustcRalf Jung-62/+170
2024-02-29Preparing for merge from rustcRalf Jung-1/+1
2024-02-29Add supporting infrastructure for `run-make` V2 tests许杰友 Jieyou Xu (Joe)-10/+506
2024-02-29AST: Refactor type alias where clausesLeón Orell Valerian Liehr-24/+6
2024-02-29Rollup merge of #121783 - nnethercote:emitter-cleanups, r=oli-obkGuillaume Gomez-22/+25
Emitter cleanups Some cleanups I made when reading emitter code. In particular, `HumanEmitter` and `JsonEmitter` have gone from three constructors to one. r? `@oli-obk`
2024-02-29Rollup merge of #121669 - nnethercote:count-stashed-errs-again, r=estebankGuillaume Gomez-23/+25
Count stashed errors again Stashed diagnostics are such a pain. Their "might be emitted, might not" semantics messes with lots of things. #120828 and #121206 made some big changes to how they work, improving some things, but still leaving some problems, as seen by the issues caused by #121206. This PR aims to fix all of them by restricting them in a way that eliminates the "might be emitted, might not" semantics while still allowing 98% of their benefit. Details in the individual commit logs. r? `@oli-obk`
2024-02-29add unit tests on unknown fieldsonur-ozkan-2/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-29Rollup merge of #121788 - klensy:clap-deprecated-fix, r=clubby789Guillaume Gomez-19/+19
bootstrap: fix clap deprecated warnings Run 'cargo check --features clap/deprecated' and fix warnings
2024-02-29Rollup merge of #121781 - RalfJung:bootstrap-fmt, r=clubby789Guillaume Gomez-2/+2
bootstrap/format: send larger batches to rustfmt This helps on systems with low core counts. To benchmark this I made a lot of files be modified: ``` for FILE in $(find compiler/ -name "*.rs"); do echo "// end of the file" >>$FILE; done ``` Then I ran ``` hyperfine "./x.py fmt -j1" -w 1 -r 4 ``` Before this patch: ``` Benchmark 1: ./x.py fmt -j1 Time (mean ± σ): 3.426 s ± 0.032 s [User: 4.681 s, System: 1.376 s] Range (min … max): 3.389 s … 3.462 s 4 runs ``` With this patch: ``` Benchmark 1: ./x.py fmt -j1 Time (mean ± σ): 2.530 s ± 0.054 s [User: 4.042 s, System: 0.467 s] Range (min … max): 2.452 s … 2.576 s 4 runs ```
2024-02-29Rollup merge of #121412 - androm3da:bcain/update_hex_docs_03, r=AmanieuGuillaume Gomez-5/+121
platform docs: clarify hexagon-unknown-none-elf example, add hexagon-unknown-linux-musl
2024-02-29Fix links in rustc docAaron Chen-2/+2
2024-02-29run change tracker even when config parse failsonur-ozkan-13/+48
Please note that we are currently validating the build configuration on two entry points (e.g., profile validation is handled on the python side), and change-tracker system is handled on the rust side. Once #94829 is completed (scheduled for 2024), we will be able to handle this more effectively. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-29fix clap warningsklensy-19/+19
Run 'cargo check --features clap/deprecated' and fix warnings
2024-02-29bootstrap/format: send larger batches to rustfmtRalf Jung-2/+2
2024-02-29Make `JsonEmitter` more like `HumanEmitter`.Nicholas Nethercote-7/+4
Use `derive(Setters)` to derive setters, and then change `JsonEmitter::new` to only have the arguments that are always used.