about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-07-17fix: false positive double_negations when it jumps macro boundaryanatawa12-0/+36
2025-07-15Auto merge of #143877 - xizheyin:143813, r=scottmcm,saethlinbors-0/+55
`std::vec`: Add UB check for `set_len`, `from_raw_parts_in`, and etc. Closes rust-lang/rust#143813 I noticed that `from_parts_in` do the similar things like `from_raw_parts_in`, so I add the UB check in the last commit. If it is not appropriate, I will remove it. And I fix a typo in the first commit. r? `@scottmcm`
2025-07-15Auto merge of #143958 - samueltardieu:rollup-lh1s143, r=samueltardieubors-59/+361
Rollup of 13 pull requests Successful merges: - rust-lang/rust#142301 (tests: Fix duplicated-path-in-error fail with musl) - rust-lang/rust#143630 (Drop `./x suggest`) - rust-lang/rust#143736 (Give all bytes of TypeId provenance) - rust-lang/rust#143752 (Don't panic if WASI_SDK_PATH not set when detecting compiler) - rust-lang/rust#143837 (Adjust `run_make_support::symbols` helpers) - rust-lang/rust#143878 (Port `#[pointee]` to the new attribute parsing infrastructure) - rust-lang/rust#143905 (Recover and suggest to use `;` to construct array type) - rust-lang/rust#143907 (core: make `str::split_at_unchecked()` inline) - rust-lang/rust#143910 (Add experimental `backtrace-trace-only` std feature) - rust-lang/rust#143927 (Preserve constness in trait objects up to hir ty lowering) - rust-lang/rust#143935 (rustc_type_ir/walk: move docstring to `TypeWalker` itself) - rust-lang/rust#143938 (Update books) - rust-lang/rust#143941 (update `cfg_select!` documentation) Failed merges: - rust-lang/rust#143926 (Remove deprecated fields in bootstrap) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-15Rollup merge of #143941 - folkertdev:cfg-select-docs, r=traviscrossSamuel Tardieu-6/+15
update `cfg_select!` documentation tracking issue: https://github.com/rust-lang/rust/issues/115585 After rust-lang/rust#143461, and with an eye on a soon(ish) stabilization, I think the docs need some work. The existing text read more like a motivation for the feature existing to me, so I've tried to now be a bit more descriptive. Still, suggestions are very welcome. I also added a test for an empty `select! {}` because it's just the sort of thing that might break. r? ``@traviscross``
2025-07-15Rollup merge of #143927 - oli-obk:const-dyn-trait-hir-ty, r=fmeaseSamuel Tardieu-2/+26
Preserve constness in trait objects up to hir ty lowering r? ``@compiler-errors`` While we don't support `dyn const Trait`, we can at least also inform the user that `const Trait` is only legal for `#[const_trait] trait Trait {}`
2025-07-15Rollup merge of #143905 - xizheyin:143828, r=compiler-errorsSamuel Tardieu-44/+160
Recover and suggest to use `;` to construct array type Fixes rust-lang/rust#143828 r? compiler
2025-07-15Rollup merge of #143837 - jieyouxu:symbol-apis, r=ChrisDentonSamuel Tardieu-4/+109
Adjust `run_make_support::symbols` helpers Massage the `symbols` helpers to fill out {match all, match any} x {substring match, exact match}: | | Substring match | Exact match | |-----------|----------------------------------------|-------------------------------| | Match any | `object_contains_any_symbol_substring` | `object_contains_any_symbol` | | Match all | `object_contains_all_symbol_substring` | `object_contains_all_symbols` | As I'd like to use `object_contains_all_symbols` for rust-lang/rust#143669. As part of this: - Rename `any_symbol_contains` to `object_contains_any_symbol_substring` for accuracy, as `any_symbol_contains` is actually "contains any matching substring". - Remove `with_symbol_iter`. Noticed while working on https://github.com/rust-lang/rust/pull/143669. r? ``@ChrisDenton`` (or compiler)
2025-07-15Rollup merge of #143736 - oli-obk:uninspectable-type-id, r=RalfJungSamuel Tardieu-3/+42
Give all bytes of TypeId provenance This makes all bytes of TypeId uninspectable at compile-time. For context see https://github.com/rust-lang/rust/issues/77125#issuecomment-3057049217 r? ``@RalfJung``
2025-07-15Rollup merge of #142301 - Gelbpunkt:duplicated-path-in-error-musl, ↵Samuel Tardieu-0/+9
r=workingjubilee,fmease,jieyouxu tests: Fix duplicated-path-in-error fail with musl musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Fixes rust-lang/rust#128474
2025-07-15New example for E0536Jonathan Brouwer-7/+6
2025-07-15Changes to diagnosticsJonathan Brouwer-97/+156
2025-07-15Add tests for UB check in `set_len`, `from_raw_parts_in`, `from_parts_in`xizheyin-0/+55
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-15Recover and suggest use `;` to construct array typexizheyin-82/+124
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-14update `cfg_select!` documentationFolkert de Vries-6/+15
and make internal terminology consistent Co-authored-by: Travis Cross <tc@traviscross.com>
2025-07-14tests: Fix duplicated-path-in-error fail with muslJens Reidel-0/+9
musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-14Rollup merge of #143903 - vtjl10:master, r=jieyouxuSamuel Tardieu-2/+2
Fix typos in documentation files ## Summary Fix minor typos in documentation files to improve readability. ## Changes - **tests/mir-opt/pre-codegen/README.md**: Fix typo `condiguration` → `configuration` - **tests/ui/SUMMARY.md**: Fix typo in RFC link URL (`namepsace ` → `namespace`) ## Type of Change - [x] Documentation update - [x] Bug fix (typo correction)
2025-07-14Rollup merge of #143855 - JonathanBrouwer:omit_gdb_pretty_printer_section, ↵Samuel Tardieu-6/+9
r=jdonszelmann Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing Ports `#[omit_gdb_pretty_printer_section]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 r? ```@jdonszelmann```
2025-07-14Rollup merge of #143848 - makai410:smir-rename, r=oli-obkSamuel Tardieu-165/+173
Rename `stable_mir` and `rustc_smir` This PR only renames the two crate names. There is no doubt that we want to rename `stable_mir` to `rustc_public`, while it hasn't been discussed yet that what the new name for `rustc_smir` should be. This PR proposes a new name for `rustc_smir`, that is `rustc_public_shim`, since `rustc_smir` now is mostly a proxy to do calls to rustc queries and the public API of rustc that is invoked by the `rustc_public` crate. However, I don't think that name is good enough. I hope there would be a way better name. r? `@oli-obk`
2025-07-14Preserve constness in trait objects up to hir ty loweringOli Scherer-2/+26
2025-07-14rename `stable_mir` to `rustc_public`, and `rustc_smir` to `rustc_public_bridge`Makai-165/+173
2025-07-14Rollup merge of #143875 - fee1-dead-contrib:push-zvqrmzrprpzt, r=compiler-errorsJakub Beránek-37/+37
update issue number for `const_trait_impl` r? project-const-traits cc rust-lang/rust#67792 rust-lang/rust#143874
2025-07-14Rollup merge of #143217 - Periodic1911:link-ordinal, r=jdonszelmannJakub Beránek-38/+54
Port #[link_ordinal] to the new attribute parsing infrastructure Ports link_ordinal to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
2025-07-14Update SUMMARY.mdfuder.eth-2/+2
Update README.md
2025-07-14Give all bytes of TypeId provenanceOli Scherer-3/+42
2025-07-14Add test array-type-no-semi.rsxizheyin-0/+74
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-14Auto merge of #143779 - JonathanBrouwer:automatically_derived_parser, r=oli-obkbors-33/+36
Port `#[automatically_derived]` to the new attribute parsing infrastructure Ports `#[automatically_derived]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 r? `@oli-obk` cc `@jdonszelmann`
2025-07-13Auto merge of #143357 - cjgillot:no-assoc-item-kind, r=compiler-errorsbors-74/+71
Retire hir::*ItemRef. This information was kept for various places that iterate on HIR to know about trait-items and impl-items. This PR replaces them by uses of the `associated_items` query that contain pretty much the same information. This shortens many spans to just `def_span`, which can be easier to read.
2025-07-13Auto merge of #143461 - folkertdev:cfg-select-builtin-macro, r=petrochenkovbors-0/+56
make `cfg_select` a builtin macro tracking issue: https://github.com/rust-lang/rust/issues/115585 This parses mostly the same as the `macro cfg_select` version, except: 1. wrapping in double brackets is no longer supported (or needed): `cfg_select {{ /* ... */ }}` is now rejected. 2. in an expression context, the rhs is no longer wrapped in a block, so that this now works: ```rust fn main() { println!(cfg_select! { unix => { "foo" } _ => { "bar" } }); } ``` 3. a single wildcard rule is now supported: `cfg_select { _ => 1 }` now works I've also added an error if none of the rules evaluate to true, and warnings for any arms that follow the `_` wildcard rule. cc `@traviscross` if I'm missing any feature that should/should not be included r? `@petrochenkov` for the macro logic details
2025-07-13update issue number for `const_trait_impl`Deadbeef-37/+37
2025-07-13Auto merge of #143888 - matthiaskrgr:rollup-fv9x7kf, r=matthiaskrgrbors-262/+411
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143301 (`tests/ui`: A New Order [26/N]) - rust-lang/rust#143519 (Check assoc consts and tys later like assoc fns) - rust-lang/rust#143554 (slice: Mark `rotate_left`, `rotate_right` unstably const) - rust-lang/rust#143634 (interpret/allocation: expose init + write_wildcards on a range) - rust-lang/rust#143685 (Resolve: merge `source_bindings` and `target_bindings` into `bindings`) - rust-lang/rust#143734 (Refactor resolve resolution bindings) - rust-lang/rust#143774 (constify `From` and `Into`) - rust-lang/rust#143785 (Add --compile-time-deps argument for x check) - rust-lang/rust#143786 (Fix fallback for CI_JOB_NAME) - rust-lang/rust#143825 (clippy: fix test filtering when TESTNAME is empty) - rust-lang/rust#143826 (Fix command trace) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-13Bless incremental tests.Camille GILLOT-3/+3
2025-07-13Retire hir::*ItemRef.Camille GILLOT-24/+21
2025-07-13Retire hir::ForeignItemRef.Camille GILLOT-2/+2
2025-07-13Remove hir::AssocItemKind.Camille GILLOT-49/+49
2025-07-13Move trait_item_def_id from ImplItemRef to ImplItem.Camille GILLOT-2/+2
2025-07-13Rollup merge of #143774 - oli-obk:const_from, r=fee1-deadMatthias Krüger-35/+17
constify `From` and `Into` tracking issue rust-lang/rust#143773 r? ``````@fee1-dead`````` I did not mark any impls elsewhere as `const`, those can happen on their own timeframe and don't need to be part of this MVP. But if there are some core ones you think should be in there I'll happily add them, just couldn't think of any
2025-07-13Rollup merge of #143519 - mu001999-contrib:dead-code/impl-items, r=petrochenkovMatthias Krüger-20/+123
Check assoc consts and tys later like assoc fns This PR 1. checks assoc consts and tys later like assoc fns 2. marks assoc consts appear in poly-trait-ref live For assoc consts, considering ```rust #![deny(dead_code)] trait Tr { // ERROR trait `Tr` is never used const I: Self; } struct Foo; //~ ERROR struct `Foo` is never constructed impl Tr for Foo { const I: Self = Foo; } fn main() {} ``` Current this will produce unused `I` instead of unused `Tr` and `Foo` ([play](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=e0490d4a2d522cb70437b26e514a3d9c)), because `const I: Self = Foo;` will be added into the worklist at first: ``` error: associated constant `I` is never used --> src/main.rs:4:11 | 3 | trait Tr { // ERROR trait `Tr` is never used | -- associated constant in this trait 4 | const I: Self; | ^ | note: the lint level is defined here --> src/main.rs:1:9 | 1 | #![deny(dead_code)] | ^^^^^^^^^ error: could not compile `playground` (bin "playground") due to 1 previous error ``` This also happens to assoc tys, see the [new test](https://github.com/rust-lang/rust/compare/master...mu001999-contrib:rust:dead-code/impl-items?expand=1#diff-bf45fa403934a31c9d610a073ed2603d885e7e81572e8edf38b7f4e08a1f3531) Fixes rust-lang/rust#126729 r? `````@petrochenkov`````
2025-07-13Rollup merge of #143301 - Kivooeo:tf26, r=tgross35Matthias Krüger-207/+271
`tests/ui`: A New Order [26/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ````@tgross35````
2025-07-13make `cfg_select` a builtin macroFolkert de Vries-0/+56
2025-07-13Auto merge of #143617 - aDotInTheVoid:devdesktoptestattr, r=Mark-Simulacrumbors-2/+0
Run `tests/rustdoc-json/attrs/target_features` on all hosts. Makes it more convenient to test rustdoc on non x86_64. I mainly care about the aarch64 dev-desktops. This works because rustdoc uses all target features, not just that of the target.
2025-07-13Port `#[link_ordinal]` to the new attribute parsing infrastructure.Anne Stijns-38/+54
2025-07-13Update `run-make` tests to use adjusted `symbols` helpersJieyou Xu-4/+4
2025-07-13Adjust `run_make_support::symbols` helpersJieyou Xu-0/+105
Massage the `symbols` helpers to fill out {match all, match any} x {substring match, exact match}: | | Substring match | Exact match | |-----------|----------------------------------------|-------------------------------| | Match any | `object_contains_any_symbol_substring` | `object_contains_any_symbol` | | Match all | `object_contains_all_symbol_substring` | `object_contains_all_symbols` | As part of this, rename `any_symbol_contains` to `object_contains_any_symbol_substring` for accuracy.
2025-07-13Rollup merge of #143803 - RalfJung:const-trait-tracking, r=compiler-errorsLeón Orell Valerian Liehr-22/+23
New tracking issues for const_ops and const_cmp Let's do a clean start with new tracking issues to avoid mixing things up with the previous constification. I assume the fact that the `PartialEq` *trait* and *impls* used different feature names was a mistake (the feature name on the impl is entirely irrelevant anyway). Part of https://github.com/rust-lang/rust/issues/143800, https://github.com/rust-lang/rust/issues/143802 r? ``@oli-obk``
2025-07-13Rollup merge of #143796 - JonathanBrouwer:fix-builtin-attribute-prefix, ↵León Orell Valerian Liehr-0/+23
r=jdonszelmann Fix ICE for parsed attributes with longer path not handled by CheckAttribute Fixes https://github.com/rust-lang/rust/issues/137590 Fixes https://github.com/rust-lang/rust/issues/143789 r? ```@jdonszelmann```
2025-07-13Rollup merge of #143782 - jieyouxu:debug-assertions, r=ChrisDentonLeón Orell Valerian Liehr-2/+2
Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests `NO_DEBUG_ASSERTIONS` is set by CI that threads through to the `./configure.py` script, which is somewhat fragile and "spooky action at a distance". For `fmt-write-bloat`, this is actually wrong because the test wants to gate on *std* being built with debug assertions or not, whereas `NO_DEBUG_ASSERTIONS` determines *rustc* being built with debug assertions or not. Instead, use env vars controlled by compiletest, whose debug assertion info comes from bootstrap. https://github.com/rust-lang/rust/blob/855e0fe46e68d94e9f6147531b75ac2d488c548e/src/ci/run.sh#L137-L146 `NO_DEBUG_ASSERTIONS` controls `--enable-debug-assertions` https://github.com/rust-lang/rust/blob/855e0fe46e68d94e9f6147531b75ac2d488c548e/src/bootstrap/configure.py#L124 which sets `--rust.debug-assertions`, which controls *rustc* debug assertions. https://github.com/rust-lang/rust/blob/855e0fe46e68d94e9f6147531b75ac2d488c548e/src/bootstrap/configure.py#L125-L129 `--rust.debug-assertions-std` controls *std* debug assertions. Noticed while investigating `fmt-write-bloat` in https://github.com/rust-lang/rust/pull/143669#discussion_r2200522215. Best reviewed commit-by-commit. r? ``@ChrisDenton`` (or compiler/bootstrap)
2025-07-13Rollup merge of #143778 - oli-obk:const-cleanup, r=fee1-deadLeón Orell Valerian Liehr-12/+4
Some const_trait_impl test cleanups Some tests we forgot to update when the feature gate was reimplemented r? ``@fee1-dead`` ``@compiler-errors``
2025-07-13Auto merge of #140717 - mejrs:diagnostic_lints, r=oli-obkbors-29/+35
Split up the `unknown_or_malformed_diagnostic_attributes` lint This splits up the lint into the following lint group: - `unknown_diagnostic_attributes` - triggers if the attribute is unknown to the current compiler - `misplaced_diagnostic_attributes` - triggers if the attribute exists but it is not placed on the item kind it's meant for - `malformed_diagnostic_attributes` - triggers if the attribute's syntax or options are invalid - `malformed_diagnostic_format_literals` - triggers if the format string literal is invalid, for example if it has unpaired curly braces or invalid parameters - this pr doesn't create it, but future lints for things like deprecations can also go here. This PR does not start emitting lints in places that previously did not. ## Motivation I want to have finer control over what `unknown_or_malformed_diagnostic_attributes` does I have a project with fairly low msrv that is/will have a lower msrv than future diagnostic attributes. So lints will be emitted when I or others compile it on a lower msrv. At this time, there are two options to silence these lints: - `#[allow(unknown_or_malformed_diagnostic_attributes)]` - this risks diagnostic regressions if I (or others) mess up using the attribute, or if the attribute's syntax ever changes. - write a build script to detect the compiler version and emit cfgs, and then conditionally enable the attribute: ```rust #[cfg_attr(rust_version_99, diagnostic::new_attr_in_rust_99(thing = ..))]` struct Foo; ``` or conditionally `allow` the lint: ```rust // lib.rs #![cfg_attr(not(current_rust), allow(unknown_or_malformed_diagnostic_attributes))] ``` I like to avoid using build scripts if I can, so the following works much better for me. That is what this PR will let me do in the future: ```rust #[allow(unknown_diagnostic_attribute, reason = "attribute came out in rust 1.99 but msrv is 1.70")] #[diagnostic::new_attr_in_rust_99(thing = ..)]` struct Foo;
2025-07-12Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing ↵Jonathan Brouwer-6/+9
infrastructure Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-13cleaned up some testsKivooeo-96/+160
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.