| Age | Commit message (Collapse) | Author | Lines |
|
|
|
`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`
|
|
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
|
|
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``
|
|
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 {}`
|
|
Recover and suggest to use `;` to construct array type
Fixes rust-lang/rust#143828
r? compiler
|
|
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)
|
|
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``
|
|
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
|
|
|
|
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
and make internal terminology consistent
Co-authored-by: Travis Cross <tc@traviscross.com>
|
|
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>
|
|
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)
|
|
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```
|
|
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`
|
|
|
|
|
|
update issue number for `const_trait_impl`
r? project-const-traits
cc rust-lang/rust#67792 rust-lang/rust#143874
|
|
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
|
|
Update README.md
|
|
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
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`
|
|
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.
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
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`````
|
|
`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````
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
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``
|
|
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```
|
|
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)
|
|
Some const_trait_impl test cleanups
Some tests we forgot to update when the feature gate was reimplemented
r? ``@fee1-dead`` ``@compiler-errors``
|
|
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;
|
|
infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
|