about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-02-23on the fly type casting for `build.rustc` and `build.cargo`onur-ozkan-6/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-23Auto merge of #3314 - RalfJung:up, r=RalfJungbors-272/+248
cargo update
2024-02-23cargo updateRalf Jung-272/+248
2024-02-23Auto merge of #121303 - GrigorenkoPV:static_mut_refs, r=oli-obk,RalfJungbors-15/+14
Get rid of some `#![allow(static_mut_refs)]`
2024-02-23interpret: do no ICE on OOB shuffle/insert/extract indicesRalf Jung-6/+27
2024-02-23Rollup merge of #121495 - cuishuang:master, r=clubby789Matthias Krüger-2/+2
remove repetitive words
2024-02-23Get rid of some `#[allow(static_mut_refs)]`Pavel Grigorenko-15/+14
2024-02-23Auto merge of #121491 - matthiaskrgr:rollup-wkzqawy, r=matthiaskrgrbors-8/+26
Rollup of 8 pull requests Successful merges: - #121434 (Fix #121208 fallout) - #121471 (When encountering `<&T as Clone>::clone(x)` because `T: Clone`, suggest `#[derive(Clone)]`) - #121476 (remove `llvm.assertions=true` in compiler profile) - #121479 (fix generalizer unsoundness) - #121480 (Fix more #121208 fallout) - #121482 (Allow for a missing `adt_def` in `NamePrivacyVisitor`.) - #121484 (coverage: Use variable name `this` in `CoverageGraph::from_mir`) - #121487 (Explicitly call `emit_stashed_diagnostics`.) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-23remove repetitive wordscui fliter-2/+2
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-02-23Rollup merge of #121487 - nnethercote:fix-121450, r=oli-obkMatthias Krüger-5/+23
Explicitly call `emit_stashed_diagnostics`. Commit 72b172b in #121206 changed things so that `emit_stashed_diagnostics` is only called from `run_compiler`. But rustfmt doesn't use `run_compiler`, so it needs to call `emit_stashed_diagnostics` itself to avoid an abort in `DiagCtxtInner::drop` when stashed diagnostics occur. Fixes #121450. r? `@oli-obk`
2024-02-23Rollup merge of #121476 - onur-ozkan:update-compiler-profile, r=compiler-errorsMatthias Krüger-3/+3
remove `llvm.assertions=true` in compiler profile Having this set to true disrupts compiler development workflows for people who use `llvm.download-ci-llvm = true` because we don't provide ci-llvm on the `rustc-alt-builds` server. Therefore, it is kept off by default. cc `@Nilstrieb` `@compiler-errors` For more context, see https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20LLVM.20for.20aarch64
2024-02-23Auto merge of #121448 - klensy:bump-22-02-24, r=clubby789bors-11/+11
bump few deps Bumps `sysinfo`, `tabled`; dedupes `env_logger`; drops `is-terminal` https://github.com/zhiburt/tabled/blob/v0.15.1/CHANGELOG.md https://github.com/GuillaumeGomez/sysinfo/blob/v0.30.5/CHANGELOG.md
2024-02-23Auto merge of #121432 - mj10021:issue-119851-fix, r=nnethercotebors-1/+0
Move as many tests from tests/ui/numbers-arithmetic to tests/ui/lint as possible Fixes #119851 , and also consolidates as many individual tests as possible from numbers-arithmetic. I might have moved the tests in too aggressively, so let me know
2024-02-23Explicitly call `emit_stashed_diagnostics`.Nicholas Nethercote-5/+23
Commit 72b172b in #121206 changed things so that `emit_stashed_diagnostics` is only called from `run_compiler`. But rustfmt doesn't use `run_compiler`, so it needs to call `emit_stashed_diagnostics` itself to avoid an abort in `DiagCtxtInner::drop` when stashed diagnostics occur. Fixes #121450.
2024-02-23Auto merge of #121341 - GrigorenkoPV:bootstrap-rustup-cargo, r=onur-ozkanbors-30/+33
bootstrap: don't resolve symlinks for initial_cargo I have put the following in my `config.toml`: ```toml # Includes one of the default files in src/bootstrap/defaults profile = "compiler" change-id = 121203 [build] cargo = "/usr/bin/cargo" rustc = "/usr/bin/rustc" rustfmt = "/usr/bin/rustfmt" ``` I have rustup installed from Arch's repos, which has all of the above paths be symlinks to `/usr/bin/rustup`. This works just fine with the `argv[0]` trick that rustup uses. However, `bootstrap` resolves symlinks to check whether `cargo` exists and then uses the resolved path, so it ends up calling `rustup` directly expecting it to behave like `cargo`. Which it doesn't. This PR removes the canonicalization step, in turn fixing the issue, but sacrificing a pretty error message. However, this exact thing is checked by `x.py` in advance, so I hope it is not a big deal?
2024-02-23Allow tests to specify a `//@ filecheck-flags:` headerZalathar-5/+14
Any flags specified here will be passed to LLVM's `filecheck` tool, in tests that use that tool.
2024-02-23Simplify existing code for setting `filecheck` flagsZalathar-11/+17
This removes a version check for LLVM >=13, and specifies prefixes as a series of independent `--check-prefix` flags instead of a single `--check-prefixes`.
2024-02-22set `llvm.assertions` to false in compiler profileonur-ozkan-3/+3
Having this set to true disrupts compiler development workflows for people who use `llvm.download-ci-llvm = true` because we don't provide ci-llvm on the `rustc-alt-builds` server. Therefore, it is kept off by default. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22Auto merge of #121469 - matthiaskrgr:rollup-oaoxuo2, r=matthiaskrgrbors-0/+2
Rollup of 8 pull requests Successful merges: - #120598 (No need to `validate_alias_bound_self_from_param_env` in `assemble_alias_bound_candidates`) - #121386 (test that we do not support higher-ranked regions in opaque type inference) - #121393 (match lowering: Introduce a `TestCase` enum to replace most matching on `PatKind`) - #121401 (Fix typo in serialized.rs) - #121427 (Fix panic when compiling `Rocket`.) - #121439 (Fix typo in metadata.rs doc comment) - #121441 (`DefId` to `LocalDefId`) - #121452 (Add new maintainers to nto-qnx.md) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-22Rollup merge of #121452 - jonathanpallant:patch-1, r=AmanieuMatthias Krüger-0/+2
Add new maintainers to nto-qnx.md [Ferrous Systems](https://ferrous-systems.com) are volunteering myself and `@japaric` as co-maintainers of the QNX targets.
2024-02-22Auto merge of #121370 - jieyouxu:migrate-compiletest-directives, r=oli-obkbors-32/+67
Migrate compiletest to use `ui_test`-style `//@` directives ## Preface There's an on-going effort to rewrite parts of or the entirety of compiletest (<https://github.com/rust-lang/compiler-team/issues/536>). A step towards this involve migrating compiletest tests to use the [`ui_test`](https://github.com/oli-obk/ui_test) framework, which involves changing compiletest directives in `// <directive-name>` style to `ui_test` `//@ <directive-name>` style (https://github.com/rust-lang/compiler-team/issues/512). This PR aims to implement the directive-style change from `//` to `//`@`` for the remaining non-"ui" test suite tests. ## Key Changes 1. All `tests/` tests now use `//`@`` directives. 2. Compiletest only accepts `//`@`` and issues an error if an old-style directive is detected. 3. `// ignore-tidy` and `// ignore-tidy-*` are considered tidy directives and are ignored by compiletest header parsing. ## Diff Generation The diff is generated by: - Collecting directives from `tests/` via hijacking compiletest to emit successfully parsed directive lines. - Using a migration tool (<https://github.com/jieyouxu/compiletest-ui_test-header-migration/tree/master>) to replace `//` directives in compiletest tests with `//`@`.` ### Reproduction Steps 0. Delete the temporary file `$RUSTC_REPO_PATH/build/<target_triple>/test/__directive_lines.txt`, if the collection script was previously ran. 1. Use the <https://github.com/jieyouxu/rust/tree/collect-test-directives> collect-test-directives script, which outputs a temporary file recording headers occuring in each compiletest test. - You need to checkout this branch: `git checkout collect-test-directives`. - This needs to be rebased on latest master to ensure up-to-date test directives can be collected. - You need to run `./x test` on each of the `test/*` subfolders once: ```bash ./x test tests/assembly/ --stage 1 --force-rerun ./x test tests/codegen/ --stage 1 --force-rerun ./x test tests/codegen-units/ --stage 1 --force-rerun ./x test tests/coverage/ --stage 1 --force-rerun ./x test tests/coverage-run-rustdoc/ --stage 1 --force-rerun ./x test tests/debuginfo/ --stage 1 --force-rerun ./x test tests/incremental/ --stage 1 --force-rerun ./x test tests/mir-opt/ --stage 1 --force-rerun ./x test tests/pretty/ --stage 1 --force-rerun ./x test tests/run-make/ --stage 1 --force-rerun ./x test tests/run-make-fulldeps/ --stage 1 --force-rerun ./x test tests/run-pass-valgrind/ --stage 1 --force-rerun ./x test tests/rustdoc/ --stage 1 --force-rerun TARGET=<target-triple> ./x test tests/rustdoc-gui/ --stage 1 --force-rerun ./x test tests/rustdoc-js/ --stage 1 --force-rerun ./x test tests/rustdoc-js-std/ --stage 1 --force-rerun ./x test tests/rustdoc-json/ --stage 1 --force-rerun ./x test tests/rustdoc-ui/ --stage 1 --force-rerun ./x test tests/ui/ --stage 1 --force-rerun ./x test tests/ui-fulldeps/ --stage 1 --force-rerun ``` 2. Checkout the `migrate-compiletest-directives` branch. 3. Run the migration tool <https://github.com/jieyouxu/compiletest-ui_test-header-migration>. 4. Check that the migration at least does not cause test failures if you change compiletest to accept `//`@`` directives only. This is also required if the test outputs somehow need to be blessed. - `RUSTC_TEST_FAIL_FAST=1 ./x test tests/<secondary-directory> --stage 1 --bless` 5. Confirm that there is no difference after running the migration tool when you are on the `migrate-compiletest-directives` branch. ## Follow Up Work - [ ] Adjust rustc-dev-guide docs for compiletest directives (this time for all the other suites and modes). <https://github.com/rust-lang/rustc-dev-guide/pull/1895>.
2024-02-22Update tidy target_specific_tests to account for `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2024-02-22Update tidy target_policy to account for `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2024-02-22Update compiletest to only accept `//@` directives许杰友 Jieyou Xu (Joe)-30/+13
2024-02-22Update list of known directive names for diagnostics许杰友 Jieyou Xu (Joe)-0/+52
2024-02-22remove exceptionJames Dietz-1/+0
2024-02-22Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-0/+2
2024-02-22Auto merge of #121372 - clubby789:test-all-tests, r=onur-ozkanbors-6/+51
Make `x test tests` work Fixes #97314 This makes `x test tests` work, and be roughly equivalent to `x test tests/*`. The `--dry-run` output is identical, except for errors on the non-test items in `tests` and a couple of things being in a different order (where path != struct name). This probably needs a test, but I'm not sure of the best way to do it.
2024-02-22Add new maintainers to nto-qnx.mdJonathan Pallant-0/+2
Ferrous Systems are volunteering myself and Jorge as co-maintainers of the QNX targets.
2024-02-22Auto merge of #121309 - Nilstrieb:inline-all-the-fallbacks, r=oli-obkbors-0/+2
Make intrinsic fallback bodies cross-crate inlineable This change was prompted by the stage1 compiler spending 4% of its time when compiling the polymorphic-recursion MIR opt test in `unlikely`. Intrinsic fallback bodies like `unlikely` should always be inlined, it's very silly if they are not. To do this, we enable the fallback bodies to be cross-crate inlineable. Not that this matters for our workloads since the compiler never actually _uses_ the "fallback bodies", it just uses whatever was cfg(bootstrap)ped, so I've also added `#[inline]` to those. See the comments for more information. r? oli-obk
2024-02-22dedupe env_logger, drop is-terminalklensy-2/+2
2024-02-22bump tabledklensy-4/+4
2024-02-22bump sysinfoklensy-5/+5
2024-02-22Auto merge of #121129 - nnethercote:codegen-Diags, r=estebankbors-1/+1
Improve codegen diagnostic handling Clarify the workings of the temporary `Diagnostic` type used to send diagnostics from codegen threads to the main thread. r? `@estebank`
2024-02-22fmtThe Miri Conjob Bot-3/+5
2024-02-22Merge from rustcThe Miri Conjob Bot-713/+5153
2024-02-22Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2024-02-22Overhaul `Diagnostic` args.Nicholas Nethercote-1/+1
First, introduce a typedef `DiagnosticArgMap`. Second, make the `args` field public, and remove the `args` getter and `replace_args` setter. These were necessary previously because the getter had a `#[allow(rustc::potential_query_instability)]` attribute, but that was removed in #120931 when the args were changed from `FxHashMap` to `FxIndexMap`. (All the other `Diagnostic` fields are public.)
2024-02-22Auto merge of #121415 - matthiaskrgr:rollup-o9zzet4, r=matthiaskrgrbors-79/+95
Rollup of 8 pull requests Successful merges: - #121206 (Top level error handling) - #121261 (coverage: Remove `pending_dups` from the span refiner) - #121336 (triagebot: add queue notifications) - #121373 (Consistently refer to a test's `revision` instead of `cfg`) - #121391 (never patterns: Fix liveness analysis in the presence of never patterns) - #121392 (Unify dylib loading between proc macros and codegen backends) - #121399 (Solaris linker does not support --strip-debug) - #121406 (Add a couple tests) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-22add changelog entryonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22force dist.compression-profile = "no-op" for `x install`onur-ozkan-2/+17
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22support `no-op` compression profile in rust-installeronur-ozkan-2/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-21Rollup merge of #121373 - Zalathar:test-revision, r=oli-obkMatthias Krüger-65/+81
Consistently refer to a test's `revision` instead of `cfg` Compiletest allows a test file to specify multiple “revisions” (`//@ revisions: foo bar`), with each revision running as a separate test, and having the ability to define revision-specific headers (`//`@[foo]` ignore-blah`) and revision-specific code (`#[cfg(foo)]`). The code that implements this feature sometimes uses the term “cfg” instead of “revision”. This results in two confusingly-different names for the same concept, one of which is ambiguous with other kinds of configuration (such as compiletest's own config). This PR replaces those occurrences of `cfg` with `revision`, so that one name is used consistently.
2024-02-21Auto merge of #117658 - RalfJung:ptr-dangling, r=m-ou-sebors-24/+24
rename ptr::invalid -> ptr::without_provenance It has long bothered me that `ptr::invalid` returns a pointer that is actually valid for zero-sized memory accesses. In general, it doesn't even make sense to ask "is this pointer valid", you have to ask "is this pointer valid for a given memory access". We could say that a pointer is invalid if it is not valid for *any* memory access, but [the way this FCP is going](https://github.com/rust-lang/unsafe-code-guidelines/issues/472), it looks like *all* pointers will be valid for zero-sized memory accesses. Two possible alternative names emerged as people's favorites: 1. Something involving `dangling`, in analogy to `NonNull::dangling`. To avoid inconsistency with the `NonNull` method, the address-taking method could be called `dangling_at(addr: usize) -> *const T`. 2. `without_provenance`, to be symmetric with the inverse operation `ptr.addr_without_provenance()` (currently still called `ptr.addr()` but probably going to be renamed) I have no idea which one of these is better. I read [this comment](https://github.com/rust-lang/rust/pull/117658#issuecomment-1830934701) as expressing a slight preference for something like the second option, so I went for that. I'm happy to go with `dangling_at` as well. Cc `@rust-lang/opsem`
2024-02-22Inline and remove `abort_on_err`.Nicholas Nethercote-3/+2
It's clumsy and doesn't improve readability.
2024-02-22Refactor `run_global_ctxt`.Nicholas Nethercote-7/+10
It currently is infallible and uses `abort_if_errors` and `FatalError.raise()` to signal errors. It's easy to instead return a `Result<_, ErrorGuaranteed>`, which is the more usual way of doing things.
2024-02-22Inline and remove `Session::compile_status`.Nicholas Nethercote-1/+1
Because it's now simple enough that it doesn't provide much benefit.
2024-02-22Adjust the `has_errors*` methods.Nicholas Nethercote-4/+2
Currently `has_errors` excludes lint errors. This commit changes it to include lint errors. The motivation for this is that for most places it doesn't matter whether lint errors are included or not. But there are multiple places where they must be includes, and only one place where they must not be included. So it makes sense for `has_errors` to do the thing that fits the most situations, and the new `has_errors_excluding_lint_errors` method in the one exceptional place. The same change is made for `err_count`. Annoyingly, this requires the introduction of `err_count_excluding_lint_errs` for one place, to preserve existing error printing behaviour. But I still think the change is worthwhile overall.
2024-02-21bootstrap: improvements for stage0 checksPavel Grigorenko-30/+33
+ Do not resolve symlinks (as this may break rustup) + Check version not just for rustc, but also for cargo. + Check that the program's self-reported name matches the expected name (such as "rustc" or "cargo").
2024-02-21Make `x test tests` workclubby789-6/+51