about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-02-29Merge from rustcRalf Jung-35/+26
2024-02-29Preparing for merge from rustcRalf Jung-1/+1
2024-02-29Add supporting infrastructure for `run-make` V2 tests许杰友 Jieyou Xu (Joe)-9/+426
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-5/+8
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-29Inline and remove `HumanEmitter::stderr`.Nicholas Nethercote-2/+5
Because `HumanEmitter::new` is enough, in conjunction with the (renamed) `stderr_destination` function.
2024-02-29Rename `DiagCtxt::with_emitter` as `DiagCtxt::new`.Nicholas Nethercote-3/+3
Because it's now the only constructor.
2024-02-29Merge from rustcThe Miri Conjob Bot-10864/+14177
2024-02-29Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2024-02-29Reinstate `emit_stashed_diagnostics` in `DiagCtxtInner::drop`.Nicholas Nethercote-22/+7
I removed it in #121206 because I thought thought it wasn't necessary. But then I had to add an `emit_stashed_diagnostics` call elsewhere in rustfmt to avoid the assertion failure (which took two attempts to get right, #121487 and #121615), and now there's an assertion failure in clippy as well (https://github.com/rust-lang/rust-clippy/issues/12364). So this commit just reinstates the call in `DiagCtxtInner::drop`. It also reverts the rustfmt changes from #121487 and #121615, though it keeps the tests added for those PRs.
2024-02-29Stop miri if delayed bugs are present.Nicholas Nethercote-1/+1
Seems wise, since it shouldn't proceed in that case.
2024-02-29Overhaul how stashed diagnostics work, again.Nicholas Nethercote-0/+17
Stashed errors used to be counted as errors, but could then be cancelled, leading to `ErrorGuaranteed` soundness holes. #120828 changed that, closing the soundness hole. But it introduced other difficulties because you sometimes have to account for pending stashed errors when making decisions about whether errors have occured/will occur and it's easy to overlook these. This commit aims for a middle ground. - Stashed errors (not warnings) are counted immediately as emitted errors, avoiding the possibility of forgetting to consider them. - The ability to cancel (or downgrade) stashed errors is eliminated, by disallowing the use of `steal_diagnostic` with errors, and introducing the more restrictive methods `try_steal_{modify,replace}_and_emit_err` that can be used instead. Other things: - `DiagnosticBuilder::stash` and `DiagCtxt::stash_diagnostic` now both return `Option<ErrorGuaranteed>`, which enables the removal of two `delayed_bug` calls and one `Ty::new_error_with_message` call. This is possible because we store error guarantees in `DiagCtxt::stashed_diagnostics`. - Storing the guarantees also saves us having to maintain a counter. - Calls to the `stashed_err_count` method are no longer necessary alongside calls to `has_errors`, which is a nice simplification, and eliminates two more `span_delayed_bug` calls and one FIXME comment. - Tests are added for three of the four fixed PRs mentioned below. - `issue-121108.rs`'s output improved slightly, omitting a non-useful error message. Fixes #121451. Fixes #121477. Fixes #121504. Fixes #121508.
2024-02-29Rollup merge of #121724 - nnethercote:LitKind-Err-for-floats, r=fmeaseMatthias Krüger-12/+1
Use `LitKind::Err` for malformed floats #121120 changed `StringReader::cook_lexer_literal` to return `LitKind::Err` for malformed integer literals. This commit does the same for float literals, for consistency. r? ``@fmease``
2024-02-28Auto merge of #121489 - nnethercote:diag-renaming, r=davidtwcobors-52/+52
Diagnostic renaming Renaming various diagnostic types from `Diagnostic*` to `Diag*`. Part of https://github.com/rust-lang/compiler-team/issues/722. There are more to do but this is enough for one PR. r? `@davidtwco`
2024-02-28Add stubs for `f16` and `f128` to miriTrevor Gross-0/+10
2024-02-28Add stubs for `f16` and `f128` to clippyTrevor Gross-0/+6
2024-02-28Auto merge of #121741 - GuillaumeGomez:rollup-msrsrnk, r=GuillaumeGomezbors-1/+0
Rollup of 12 pull requests Successful merges: - #120051 (Add `display` method to `OsStr`) - #121226 (Fix issues in suggesting importing extern crate paths) - #121423 (Remove the `UntranslatableDiagnosticTrivial` lint.) - #121527 (unix_sigpipe: Simple fixes and improvements in tests) - #121572 (Add test case for primitive links in alias js) - #121661 (Changing some attributes to only_local.) - #121680 (Fix link generation for foreign macro in jump to definition feature) - #121686 (Adjust printing for RPITITs) - #121691 (handle unavailable creation time as `io::ErrorKind::Unsupported`) - #121695 (Split rustc_type_ir to avoid rustc_ast from depending on it) - #121698 (CFI: Fix typo in test file names) - #121702 (Process alias-relate obligations in CoerceUnsized loop) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-28Use `LitKind::Err` for floats with empty exponents.Nicholas Nethercote-12/+1
This prevents a follow-up type error in a test, which seems fine.
2024-02-28remove a wrong bitwise negationRalf Jung-1/+1
2024-02-28Remove the `UntranslatableDiagnosticTrivial` lint.Nicholas Nethercote-1/+0
It's a specialized form of the `UntranslatableDiagnostic` lint that is deny-by-default. Now that `UntranslatableDiagnostic` has been changed from allow-by-default to deny-by-default, the trivial variant is no longer needed.
2024-02-28Rename `DiagnosticArg{,Map,Name,Value}` as `DiagArg{,Map,Name,Value}`.Nicholas Nethercote-1/+1
2024-02-28Rename `DiagnosticBuilder` as `Diag`.Nicholas Nethercote-40/+40
Much better! Note that this involves renaming (and updating the value of) `DIAGNOSTIC_BUILDER` in clippy.
2024-02-27Update cargoWeihang Lo-0/+0
2024-02-28Rename `Diagnostic` as `DiagInner`.Nicholas Nethercote-12/+12
I started by changing it to `DiagData`, but that didn't feel right. `DiagInner` felt much better.
2024-02-27safe transmute: revise safety analysisJack Wrenn-1/+0
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
2024-02-27Merge commit '10136170fe9ed01e46aeb4f4479175b79eb0e3c7' into ↵Philipp Krones-10811/+14122
clippy-subtree-update
2024-02-27Auto merge of #3332 - RalfJung:trophy, r=RalfJungbors-0/+1
add mpsc memory leak to trophy case
2024-02-27Auto merge of #3331 - rust-lang:rustup-2024-02-27, r=RalfJungbors-116/+122
Automatic Rustup
2024-02-27add mpsc memory leak to trophy caseRalf Jung-0/+1
2024-02-27Merge from rustcThe Miri Conjob Bot-115/+121
2024-02-27Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2024-02-27Auto merge of #121655 - matthiaskrgr:rollup-qpx3kks, r=matthiaskrgrbors-27/+27
Rollup of 4 pull requests Successful merges: - #121598 (rename 'try' intrinsic to 'catch_unwind') - #121639 (Update books) - #121648 (Update Vec and String `{from,into}_raw_parts`-family docs) - #121651 (Properly emit `expected ;` on `#[attr] expr`) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-27Rollup merge of #121598 - RalfJung:catch_unwind, r=oli-obkMatthias Krüger-27/+27
rename 'try' intrinsic to 'catch_unwind' The intrinsic has nothing to do with `try` blocks, and corresponds to the stable `catch_unwind` function, so this makes a lot more sense IMO. Also rename Miri's special function while we are at it, to reflect the level of abstraction it works on: it's an unwinding mechanism, on which Rust implements panics.
2024-02-26Auto merge of #121516 - RalfJung:platform-intrinsics-begone, r=oli-obkbors-49/+21
remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics `@Amanieu` `@workingjubilee` I don't think there is any reason these need to be "special"? The [original RFC](https://rust-lang.github.io/rfcs/1199-simd-infrastructure.html) indicated eventually making them stable, but I think that is no longer the plan, so seems to me like we can clean this up a bit. Blocked on https://github.com/rust-lang/stdarch/pull/1538, https://github.com/rust-lang/rust/pull/121542.
2024-02-26Fix miri.bat not bailing early on errorRoss Smyth-1/+4
2024-02-26Auto merge of #121636 - matthiaskrgr:rollup-1tt2o5n, r=matthiaskrgrbors-19/+35
Rollup of 6 pull requests Successful merges: - #121389 (llvm-wrapper: fix few warnings) - #121493 (By changing some attributes to only_local, reducing encoding attributes in the crate metadate.) - #121615 (Move `emit_stashed_diagnostic` call in rustfmt.) - #121617 (Actually use the right closure kind when checking async Fn goals) - #121628 (Do not const prop unions) - #121629 (fix some references to no-longer-existing ReprOptions.layout_seed) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-26Rollup merge of #121615 - nnethercote:fix-121517, r=oli-obkMatthias Krüger-19/+35
Move `emit_stashed_diagnostic` call in rustfmt. This call was added to `parse_crate_mod` in #121487, to fix a case where a stashed diagnostic wasn't emitted. But there is another path where a stashed diagnostic might fail to be emitted if there's a parse error, if the `build` call in `parse_crate_inner` fails before `parse_crate_mod` is reached. So this commit moves the `emit_stashed_diagnostic` call outwards, from `parse_crate_mod` to `format_project`, just after the `Parser::parse_crate` call. This should be far out enough to catch any parsing errors. Fixes #121517. r? `@oli-obk` cc `@ytmimi`
2024-02-26Auto merge of #120586 - ShE3py:exprkind-err, r=fmeasebors-4/+7
Add `ErrorGuaranteed` to `ast::ExprKind::Err` See #119967 for context ``` \ \ _~^~^~_ \) / o o \ (/ '_ - _' / '-----' \ ``` r? fmease
2024-02-26Auto merge of #3328 - RalfJung:many-seeds, r=RalfJungbors-7/+14
./miri many-seeds: support MIRI_SEED_END to control the end of the seed range
2024-02-26./miri many-seeds: support MIRI_SEED_END to control the end of the tried ↵Ralf Jung-7/+14
seed range
2024-02-26miri: rename miri_start_panic → miri_start_unwindRalf Jung-22/+22
2024-02-26rename 'try' intrinsic to 'catch_unwind'Ralf Jung-5/+5
2024-02-26tree borrows: add a test to sb_failsRalf Jung-2/+16
2024-02-26Rollup merge of #120656 - Zalathar:filecheck-flags, r=wesleywiserGuillaume Gomez-16/+31
Allow tests to specify a `//@ filecheck-flags:` header This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM `filecheck` tool as needed. --- The original motivation was noticing that `tests/run-make/instrument-coverage` was very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck. I then saw the comment in `verify_with_filecheck` indicating that a `filecheck-flags` header might be useful for other purposes as well.
2024-02-26add direct test for new ProcessPrng shimRalf Jung-0/+17
2024-02-26fix clippyRalf Jung-1/+1
2024-02-26Merge from rustcThe Miri Conjob Bot-779/+1938
2024-02-26Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2024-02-26Move `emit_stashed_diagnostic` call in rustfmt.Nicholas Nethercote-19/+35
This call was added to `parse_crate_mod` in #121487, to fix a case where a stashed diagnostic wasn't emitted. But there is another path where a stashed diagnostic might fail to be emitted if there's a parse error, if the `build` call in `parse_crate_inner` fails before `parse_crate_mod` is reached. So this commit moves the `emit_stashed_diagnostic` call outwards, from `parse_crate_mod` to `format_project`, just after the `Parser::parse_crate` call. This should be far out enough to catch any parsing errors. Fixes #121517.