| Age | Commit message (Collapse) | Author | Lines |
|
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: 07b7dc90ee4df5815dbb91ef8e98cb93571230f5
Filtered ref: 3785af8cd0fe0eeb48a0f920ca3fae973cf842d7
This merge was created using https://github.com/rust-lang/josh-sync.
|
|
`rust-analyzer` subtree update
Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/8d75311400a108d7ffe17dc9c38182c566952e6e.
Created using https://github.com/rust-lang/josh-sync.
r? `@ghost`
|
|
Add a tidy check to prevent adding UI tests directly under `tests/ui/`
This PR implements https://github.com/rust-lang/compiler-team/issues/902.
Only the last commit (adding the new check) is functional; earlier commits are just small drive-by changes to make the other ui/ui-fulldeps checks more logically contained.
r? ```@Kobzol``` (or compiler)
|
|
This updates the rust-version file to 07b7dc90ee4df5815dbb91ef8e98cb93571230f5.
|
|
Distinguish prepending and replacing self ty in predicates
There are two kinds of functions called `with_self_ty`:
1. Prepends the `Self` type onto an `ExistentialPredicate` which lacks it in its internal representation.
2. Replaces the `Self` type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type.
This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it `with_replaced_self_ty` when all we're doing is replacing the self type.
|
|
Remove unnecessary `rust_` prefixes
part of https://github.com/rust-lang/rust/issues/116005
Honestly, not sure if this can affect linking somehow, also I didn't touched things like `__rust_panic_cleanup` and `__rust_start_panic` which very likely will break something, so just small cleanup here
also didn't changed `rust_panic_without_hook` because it was renamed here https://github.com/rust-lang/rust/pull/144852
r? libs
|
|
For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info
Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that test programs can link against stage 1 rustc crates.
Unfortunately, using the stage 0 compiler causes problems when compiletest tries to obtain target information from the compiler, but the output format has changed since the last bootstrap beta bump.
We can work around this by also providing compiletest with a stage 1 compiler, and having it use that compiler to query for target information.
---
This fixes the stage 1 ui-fulldeps failure seen at https://github.com/rust-lang/rust/pull/144443#issuecomment-3146992771.
|
|
Do not give function allocations alignment in consteval and Miri.
We do not yet have a (clear and T-lang approved) design for how `#[align(N)]` on functions should affect function pointers' addresses on various platforms, so for now do not give function pointers alignment in consteval and Miri.
----
Old summary:
Not a full solution to <https://github.com/rust-lang/rust/issues/144661>, but fixes the immediate issue by making function allocations all have alignment 1 in consteval, ignoring `#[rustc_align(N)]`, so the compiler doesn't know if any offset other than 0 is non-null.
A more "principlied" solution would probably be to make function pointers to `#[instruction_set(arm::t32)]` functions be at offset 1 of an align-`max(2, align attribute)` allocation instead of at offset 0 of their allocation during consteval, and on wasm to either disallow `#[align(N)]` where N > 1, or to pad the function table such that the function pointer of a `#[align(N)]` function is a multiple of `N` at runtime.
|
|
Add lint against dangling pointers from local variables
## `dangling_pointers_from_locals`
*warn-by-default*
The `dangling_pointers_from_locals` lint detects getting a pointer to data of a local that will be dropped at the end of the function.
### Example
```rust
fn f() -> *const u8 {
let x = 0;
&x // returns a dangling ptr to `x`
}
```
```text
warning: a dangling pointer will be produced because the local variable `x` will be dropped
--> $DIR/dangling-pointers-from-locals.rs:10:5
|
LL | fn simple() -> *const u8 {
| --------- return type of the function is `*const u8`
LL | let x = 0;
| - `x` is defined inside the function and will be drop at the end of the function
LL | &x
| ^^
|
= note: pointers do not have a lifetime; after returning, the `u8` will be deallocated at the end of the function because nothing is referencing it as far as the type system is concerned
= note: `#[warn(dangling_pointers_from_locals)]` on by default
```
### Explanation
Returning a pointer from a local value will not prolong its lifetime, which means that the value can be dropped and the allocation freed while the pointer still exists, making the pointer dangling.
If you need stronger guarantees, consider using references instead, as they are statically verified by the borrow-checker to never dangle.
------
This is related to GitHub codeql [CWE-825](https://github.com/github/codeql/blob/main/rust/ql/src/queries/security/CWE-825/AccessAfterLifetimeBad.rs) which shows examples of such simple miss-use.
It should be noted that C compilers warns against such patterns even without `-Wall`, https://godbolt.org/z/P7z98arrc.
------
`@rustbot` labels +I-lang-nominated +T-lang
cc `@traviscross`
r? compiler
|
|
Weekly `cargo update`
Automation to keep dependencies in `Cargo.lock` current.
r? dep-bumps
The following is the output from `cargo update`:
```txt
compiler & tools dependencies:
Locking 14 packages to latest compatible versions
Updating clap v4.5.41 -> v4.5.42
Updating clap_builder v4.5.41 -> v4.5.42
Updating jsonpath-rust v1.0.3 -> v1.0.4
Updating libredox v0.1.6 -> v0.1.9
Updating object v0.37.1 -> v0.37.2
Updating redox_syscall v0.5.16 -> v0.5.17
Updating redox_users v0.5.0 -> v0.5.2
Updating rustc-demangle v0.1.25 -> v0.1.26
Updating serde_json v1.0.141 -> v1.0.142
Updating wasm-encoder v0.235.0 -> v0.236.0
Updating wasmparser v0.235.0 -> v0.236.0
Updating wast v235.0.0 -> v236.0.0
Updating wat v1.235.0 -> v1.236.0
Updating windows-targets v0.53.2 -> v0.53.3
note: pass `--verbose` to see 36 unchanged dependencies behind latest
library dependencies:
Locking 3 packages to latest compatible versions
Updating object v0.37.1 -> v0.37.2
Updating rustc-demangle v0.1.25 -> v0.1.26
Updating unwinding v0.2.7 -> v0.2.8
note: pass `--verbose` to see 2 unchanged dependencies behind latest
rustbook dependencies:
Locking 6 packages to latest compatible versions
Updating cc v1.2.30 -> v1.2.31
Updating clap v4.5.41 -> v4.5.42
Updating clap_builder v4.5.41 -> v4.5.42
Updating redox_syscall v0.5.16 -> v0.5.17
Updating serde_json v1.0.141 -> v1.0.142
Updating windows-targets v0.53.2 -> v0.53.3
```
|
|
compiletest: Preliminary cleanup of `ProcRes` printing/unwinding
While experimenting with changes to how compiletest handles output capture, error reporting, and unwinding, I repeatedly ran in to difficulties with this core code for reporting test failures caused by a subprocess.
There should be no change in compiletest output.
r? jieyouxu
|
|
r=jieyouxu
Remove the omit_gdb_pretty_printer_section attribute
Disabling loading of pretty printers in the debugger itself is more reliable. Before this commit the .gdb_debug_scripts section couldn't be included in dylibs or rlibs as otherwise there is no way to disable the section anymore without recompiling the entire standard library.
|
|
|
|
|
|
Testing ui-fulldeps in "stage 1" actually uses the stage 0 compiler, so that
test programs can link against stage 1 rustc crates.
Unfortunately, using the stage 0 compiler causes problems when compiletest
tries to obtain target information from the compiler, but the output format has
changed since the last bootstrap beta bump.
We can work around this by also providing compiletest with a stage 1 compiler,
and having it use that compiler to query for target information.
|
|
Migrate `generate_trait_from_impl` assist to use `SyntaxEditor`
|
|
|
|
Migrate `generate_delegate_methods` assist to use `SyntaxEditor`
|
|
Migrate `convert_from_to_tryfrom` assist to use `SyntaxEditor`
|
|
This reduces the amount of "hidden" printing in error-reporting code, which
will be helpful when overhauling compiletest's error handling and output
capture.
|
|
|
|
This method now returns a string instead of printing directly to
(possibly-captured) stdout.
|
|
compiler & tools dependencies:
Locking 14 packages to latest compatible versions
Updating clap v4.5.41 -> v4.5.42
Updating clap_builder v4.5.41 -> v4.5.42
Updating jsonpath-rust v1.0.3 -> v1.0.4
Updating libredox v0.1.6 -> v0.1.9
Updating object v0.37.1 -> v0.37.2
Updating redox_syscall v0.5.16 -> v0.5.17
Updating redox_users v0.5.0 -> v0.5.2
Updating rustc-demangle v0.1.25 -> v0.1.26
Updating serde_json v1.0.141 -> v1.0.142
Updating wasm-encoder v0.235.0 -> v0.236.0
Updating wasmparser v0.235.0 -> v0.236.0
Updating wast v235.0.0 -> v236.0.0
Updating wat v1.235.0 -> v1.236.0
Updating windows-targets v0.53.2 -> v0.53.3
note: pass `--verbose` to see 36 unchanged dependencies behind latest
library dependencies:
Locking 3 packages to latest compatible versions
Updating object v0.37.1 -> v0.37.2
Updating rustc-demangle v0.1.25 -> v0.1.26
Updating unwinding v0.2.7 -> v0.2.8
note: pass `--verbose` to see 2 unchanged dependencies behind latest
rustbook dependencies:
Locking 6 packages to latest compatible versions
Updating cc v1.2.30 -> v1.2.31
Updating clap v4.5.41 -> v4.5.42
Updating clap_builder v4.5.41 -> v4.5.42
Updating redox_syscall v0.5.16 -> v0.5.17
Updating serde_json v1.0.141 -> v1.0.142
Updating windows-targets v0.53.2 -> v0.53.3
|
|
feat: When renaming a parameter to `self`, change callers to use method call syntax
|
|
|
|
|
|
|
|
Properly pass path to staged `rustc` to `compiletest` self-tests
Otherwise, this can do weird things like use a global rustc, or try to use stage 0 rustc. This must be properly configured, because `compiletest` is intended to only support one compiler target spec JSON format (of the in-tree compiler).
Historically, this was probably done so before `bootstrap` was really its own thing, and `compiletest` had to be runnable as a much more "self-standing" tool.
Follow-up to rust-lang/rust#144675, as I didn't realize this until Zalathar pointed it out in [#t-infra/bootstrap > Building vs testing `compiletest` @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Building.20vs.20testing.20.60compiletest.60/near/532040838).
r? ````@Kobzol````
|
|
compiletest: Improve diagnostics for line annotation mismatches 2
Follow up to https://github.com/rust-lang/rust/pull/140622 based on feedback from https://github.com/rust-lang/rust/issues/144590.
|
|
As we want future UI tests to be added under a more meaningful
subdirectory instead.
|
|
|
|
|
|
|
|
|
|
|
|
Disabling loading of pretty printers in the debugger itself is more
reliable. Before this commit the .gdb_debug_scripts section couldn't be
included in dylibs or rlibs as otherwise there is no way to disable the
section anymore without recompiling the entire standard library.
|
|
|
|
|
|
|
|
Update cargo
3 commits in a7fcef21feb4d835d1fee83b3f93b4aef86d5545..840b83a10fb0e039a83f4d70ad032892c287570a
2025-07-13 02:25:52 +0000 to 2025-07-30 13:59:19 +0000
- chore: fix some minor issues in comments (rust-lang/cargo#15787)
- feat(schema): Expose `IndexPackage`, the description of a package within a Registry Index (rust-lang/cargo#15770)
- chore: update toml/toml_edit to latest (rust-lang/cargo#15779)
r? ghost
|
|
Otherwise, this can do weird things like use a global rustc, or try to
use stage 0 rustc. This must be properly configured, because
`compiletest` is intended to only support one compiler target spec JSON
format (of the in-tree compiler).
|
|
update rustup PR message
|
|
|
|
|
|
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: adcb3d3b4cd3b7c4cde642f3ed537037f293738e
Filtered ref: 5825740f16c56a1dac078765954330b987825b73
This merge was created using https://github.com/rust-lang/josh-sync.
|
|
This updates the rust-version file to adcb3d3b4cd3b7c4cde642f3ed537037f293738e.
|
|
Add correct dynamic_lib_extension for aix
AIX uses `.a` for static and shared libraries, this fixes a number of `run-make` tests on AIX
|
|
Extend `is_case_difference` to handle digit-letter confusables
This PR extends `is_case_difference` to handle digit-letter confusables
Add support for detecting 0/O, 1/l, 5/S, 8/B, 9/g confusables in error suggestions.
r? `@estebank`
|
|
|
|
|