about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
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 #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-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-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.
2024-02-29Inline and remove `JsonEmitter::{basic,stderr}`.Nicholas Nethercote-1/+3
They are so similar to `JsonEmitter::new` it's not worth having separate functions, it makes the code harder to read.
2024-02-29Inline and remove `HumanEmitter::stderr`.Nicholas Nethercote-5/+10
Because `HumanEmitter::new` is enough, in conjunction with the (renamed) `stderr_destination` function.
2024-02-29Rename `DiagCtxt::with_emitter` as `DiagCtxt::new`.Nicholas Nethercote-7/+7
Because it's now the only constructor.
2024-02-29Remove unnecessary `diagnostic_width` call.Nicholas Nethercote-3/+2
This `HumanEmitter` is only created to test if it supports colour. The diagnostic width isn't relevant.
2024-02-29Merge from rustcThe Miri Conjob Bot-10912/+14259
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-29Rollup merge of #121689 - GuillaumeGomez:rustdoc-highlighting-whitespace, ↵Matthias Krüger-1/+2
r=notriddle [rustdoc] Prevent inclusion of whitespace character after macro_rules ident Discovered this bug randomly when looking at: ![image](https://github.com/rust-lang/rust/assets/3050060/dca38047-9085-4377-bfac-f98890224be4) We were too eagerly trying to merge tokens that shouldn't be merged together (for example if you have a code comment followed by a code comment, we merge them in one attribute to reduce the DOM size). r? ``@notriddle``
2024-02-28Auto merge of #121489 - nnethercote:diag-renaming, r=davidtwcobors-79/+78
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 a platform doc for hexagon-unknown-linux-muslBrian Cain-1/+104
2024-02-28Clarify the usage example for hexagon-unknown-none-elfBrian Cain-4/+17
The C wrapper program represents a typical use case (linking C libraries with Rust libraries) but it was not made explicit how this was supposed to work in the usage example. Also: correct a table alignment error for hexagon-unknown-none-elf on the general platform support doc.
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-28Add basic support for `f16` and `f128` to rustdocTrevor Gross-0/+6
2024-02-28Auto merge of #121741 - GuillaumeGomez:rollup-msrsrnk, r=GuillaumeGomezbors-2/+1
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-28Add regression test for inclusion of whitespace characters in rustdoc ↵Guillaume Gomez-1/+1
highlighting
2024-02-28Rollup merge of #121680 - GuillaumeGomez:foreign-macro-jump-to-def, r=notriddleGuillaume Gomez-1/+1
Fix link generation for foreign macro in jump to definition feature The crate name is already added to the link so it shouldn't be added a second time for local foreign macros. r? ``@notriddle``
2024-02-28Auto merge of #121699 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 16 commits in 194a60b2952bd5d12ba15dd2577a97eed7d3c587..8964c8ccff6e420e2a38b8696d178d69fab84d9d 2024-02-21 01:53:45 +0000 to 2024-02-27 19:22:46 +0000 - feat: Add "-Zpublic-dependency" for public-dependency feature. (rust-lang/cargo#13340) - Stabilize global cache data tracking. (rust-lang/cargo#13492) - chore: bump baseline version requirement of sub crates (rust-lang/cargo#13494) - fix(doctest): search native libs in build script outputs (rust-lang/cargo#13490) - chore: fixed a typo(two-&gt;too) (rust-lang/cargo#13489) - test: relax help text assertion (rust-lang/cargo#13488) - refactor: clean up for `GlobalContext` rename (rust-lang/cargo#13486) - test(cli): Verify terminal styling (rust-lang/cargo#13461) - fix(cli): Respect CARGO_TERM_COLOR in '--list' and '-Zhelp' (rust-lang/cargo#13479) - Error messages when collecting workspace members now mention the workspace root location (rust-lang/cargo#13480) - fix(add): Improve error when adding registry packages while vendored (rust-lang/cargo#13281) - [docs]:Add missing jump links (rust-lang/cargo#13478) - Add global_cache_tracker stability tests. (rust-lang/cargo#13467) - fix(cli): Control clap colors through config (rust-lang/cargo#13463) - chore: remove the unused function (rust-lang/cargo#13472) - Fix missing brackets (rust-lang/cargo#13470)
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-65/+64
Much better! Note that this involves renaming (and updating the value of) `DIAGNOSTIC_BUILDER` in clippy.
2024-02-27Update cargoWeihang Lo-0/+0