Commit Graph

3677 Commits

Author SHA1 Message Date
Tshepang Mbambo 8e8bc1d999
add rdg push git config entry for git protocol pushers 2025-05-01 07:38:29 +02:00
Tshepang Mbambo 72a9e36e04
Merge pull request #2367 from rust-lang/rustc-pull
Rustc pull update
2025-05-01 07:01:46 +02:00
Tshepang Mbambo 4d2e6a9dc6
Merge pull request #2368 from martinomburajr/master
Adds 'with' to the bootstrapping docs to help clarify how to build a new compiler
2025-05-01 07:00:21 +02:00
Martin Ombura Jr. 7f939765c4 adds commas 2025-05-01 04:07:27 +00:00
The rustc-dev-guide Cronjob Bot f6524cb54d Merge from rustc 2025-05-01 04:05:49 +00:00
The rustc-dev-guide Cronjob Bot 8fe288a2f4 Preparing for merge from rustc 2025-05-01 04:05:40 +00:00
Martin Ombura Jr. 9c4b433575 adds 'with' to help clarify how to build a new compiler 2025-05-01 04:01:42 +00:00
bors deb0c0426f Auto merge of #121909 - Zoxc:drop-ast-task, r=petrochenkov
Drop AST on a separate thread and prefetch `hir_crate`

This drop AST on a separate thread and prefetches `hir_crate`.

A `spawn` function is added to the `parallel` module which spawn some work on the Rayon thread pool.
2025-04-30 23:57:22 +00:00
bors cecdac7d2f Auto merge of #140503 - matthiaskrgr:rollup-n7zigts, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`)
 - #139059 (uses_power_alignment: wording tweaks)
 - #139192 (mention provenance in the pointer::wrapping_offset docs)
 - #140312 (Improve pretty-printing of braces)
 - #140404 (rm `TypeVistable` impls for `Canonical`)
 - #140437 (enable msa feature for mips in codegen tests)
 - #140438 (Add `rust.debug-assertions-tools` option)
 - #140439 (miri: algebraic intrinsics: bring back float non-determinism)
 - #140445 (Treat ManuallyDrop as ~const Destruct)
 - #140446 (chore: fix some tests)
 - #140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-30 12:09:10 +00:00
许杰友 Jieyou Xu (Joe) c5598e0703
Merge pull request #2352 from xizheyin/enable-behind-upstream 2025-04-30 18:42:23 +08:00
许杰友 Jieyou Xu (Joe) 6eb758edf4
Merge pull request #2359 from rust-lang/tshepang-repo-name 2025-04-30 18:41:49 +08:00
许杰友 Jieyou Xu (Joe) 04caa77a7d
Merge pull request #2366 from rust-lang/tshepang-patch-1 2025-04-30 18:39:22 +08:00
Matthias Krüger fa49b28b28
Rollup merge of #140446 - mejrs:test1, r=jieyouxu
chore: fix some tests
2025-04-30 10:18:29 +02:00
Matthias Krüger 61b42a4ea3
Rollup merge of #140438 - ferrocene:pa-debug-assertions-tools, r=Kobzol
Add `rust.debug-assertions-tools` option

Before this PR, the two only options to configure the presence of debug assertions were the `rust.debug-assertions` and `rust.debug-assertions-std` options. The former applied to everything, and the latter allowed to override the setting just for the standard library. This combination of settings doesn't allow to enable debug assertions for the std and the compiler but not tools.

Some tools (like Cargo) are not really meant to be executed with debug assertions enabled, and in Ferrocene we hit some debug assertions in it that are exclusively meant for its test suite. We'd thus like to enable debug assertions everywhere but in tools.

This PR adds a `rust.debug-assertions-tools` setting that does exactly this.
2025-04-30 10:18:27 +02:00
Matthias Krüger 7ec41b9691
Rollup merge of #139192 - lolbinarycat:docs-wrapping_offset-provenance-139008, r=RalfJung
mention provenance in the pointer::wrapping_offset docs

fixes https://github.com/rust-lang/rust/issues/139008
2025-04-30 10:18:25 +02:00
Matthias Krüger 43a147932d
Rollup merge of #139059 - RalfJung:uses_power_alignment, r=nagisa
uses_power_alignment: wording tweaks

Slightly improves the wording introduced with https://github.com/rust-lang/rust/pull/135552.
2025-04-30 10:18:24 +02:00
Matthias Krüger 424bf9b7a5
Rollup merge of #136160 - ShE3py:should-panic-backticks, r=thomcc
Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

``@rustbot`` label +A-libtest
2025-04-30 10:18:24 +02:00
bors 51762a91a0 Auto merge of #139720 - petrochenkov:errkind2, r=jieyouxu
compiletest: Make diagnostic kind mandatory on line annotations (take 2)

Compiletest currently accepts line annotations without kind in UI tests.
```
    let a = b + c; //~ my message
```

Such annotations have two effects.
- First, they match any compiler-produced diagnostic kind. This functionality is never used in practice, there are no target-dependent diagnostic kinds of something like that.
- Second, they are not "viral". For example, any explicit `//~ NOTE my msg` in a test requires all other `NOTE` diagnostics in the same test to be annotated. Implicit `//~ my msg` will just match the note and won't require other annotations.

The second functionality has a replacement since recently - directive `//@ dont-require-annotations: NOTE`.

This PR removes support for `//~ my message` and makes the explicit diagnostic kind mandatory.
Unwanted additional annotations are suppressed using the `dont-require-annotations` directive.

Closes https://github.com/rust-lang/compiler-team/issues/862.
Previous attempt - #139427.
r? `@jieyouxu`
2025-04-30 08:17:30 +00:00
Vadim Petrochenkov d41f1f4219 compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
bors f24f31a122 Auto merge of #140188 - nnethercote:streamline-format-macro, r=cuviper
Streamline the `format` macro.

Removing the unnecessary local variable speeds up compilation a little.

r? `@cuviper`
2025-04-30 04:04:21 +00:00
Tshepang Mbambo 1b2f1c30d9
for a more friendly output
Also, these are normal Rust things (crates/packages), so remove the word *normal*.
2025-04-29 23:39:06 +02:00
bors bd34a6bf0f Auto merge of #140023 - cjgillot:arena-try-alloc, r=BoxyUwU
Introduce Arena::try_alloc_from_iter.

`alloc_from_iter` already collects the iterator for reentrancy. So adding an early exit for a fallible iterator integrates naturally into the code. This avoids the other solution to allocate and dump the allocation.
2025-04-29 21:06:15 +00:00
Tshepang Mbambo 64dd1c3a8c
Merge pull request #2363 from smanilov/patch-1
Update compiler-src.md
2025-04-29 23:01:31 +02:00
Travis Cross 2cc8f1a3a1 Merge PR #2360: Add docs about stabilizing an edition 2025-04-29 19:09:46 +00:00
Boxy 3c3aa7ebb4
Merge pull request #2365 from BoxyUwU/norm_footnotes
Fix footnotes
2025-04-29 19:38:28 +01:00
Boxy 2eae1c6f99 Fix footnotes 2025-04-29 19:35:26 +01:00
lcnr 12be276e9d
Merge pull request #2266 from BoxyUwU/normalization
Introduce a normalization chapter
2025-04-29 20:19:27 +02:00
Boxy 38a5e54ccd Introduce a normalization chapter 2025-04-29 19:08:55 +01:00
Stan Manilov 7700fb5dc8
Update compiler-src.md
Refactor the dependency structure from a nested unordered list to a single-level ordered list.

IMO, this is clearer, but happy to close this PR without merging, if the change is not desired.
2025-04-29 16:39:54 +03:00
bors 3342c600d7 Auto merge of #137940 - 1c3t3a:alignment-borrows-check, r=saethlin
Extend the alignment check to borrows

The current alignment check does not include checks for creating misaligned references from raw pointers, which is now added in this patch.

When inserting the check we need to be careful with references to field projections (e.g. `&(*ptr).a`), in which case the resulting reference must be aligned according to the field type and not the type of the pointer.

r? `@saethlin`

cc `@RalfJung,` after our discussion in #134424
2025-04-29 05:36:44 +00:00
Yuki Okushi b5367b8f95
Merge pull request #2361 from ehuss/update-mdbook 2025-04-29 09:12:05 +09:00
Eric Huss fb49fb6ba0 Add documentation on how to stabilize the compiler edition
This adds documentation on how to stabilize the edition in the compiler.
2025-04-28 14:53:36 -07:00
Eric Huss 5df71be99d Update mdbook to 0.4.48
This updates to the latest version of mdbook which has had a variety
of fixes of new features since the last update.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0448
2025-04-28 11:41:17 -07:00
Eric Huss 4ba34d12fb Add documentation on how to migration the edition of the standard library
Based on lessons learned from 2024. There's probably still more details
to say here since it was a ton of work. These are the major points that
I remember.
2025-04-28 11:30:33 -07:00
Eric Huss d0998d33cb Add an example of the example of an edition migration lint
It was observed that some people were missing the `edition20xx` rustdoc
attribute. Although this probably won't solve that problem, I'd still
like to highlight it as something to be aware of.
2025-04-28 11:29:42 -07:00
bors e3c349a6c3 Auto merge of #140388 - GuillaumeGomez:rollup-aj9o3ch, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #140056 (Fix a wrong error message in 2024 edition)
 - #140220 (Fix detection of main function if there are expressions around it)
 - #140249 (Remove `weak` alias terminology)
 - #140316 (Introduce `BoxMarker` to improve pretty-printing correctness)
 - #140347 (ci: clean more disk space in codebuild)
 - #140349 (ci: use aws codebuild for the `dist-x86_64-linux` job)
 - #140379 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-28 17:22:11 +00:00
Guillaume Gomez 238c163f34
Rollup merge of #140379 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update
2025-04-28 13:30:47 +02:00
Guillaume Gomez 21f637c917
Rollup merge of #140249 - BoxyUwU:remove_weak_alias_terminology, r=oli-obk
Remove `weak` alias terminology

I find the "weak" alias terminology to be quite confusing. It implies the existence of "strong" aliases (which do not exist) and I'm not really sure what about weak aliases is "weak". I much prefer "free alias" as the term. I think it's much more obvious what it means as "free function" is a well defined term that already exists in rust.

It's also a little confusing given "weak alias" is already a term in linker/codegen spaces which are part of the compiler too. Though I'm not particularly worried about that as it's usually very obvious if you're talking about the type system or not lol. I'm also currently trying to write documentation about aliases and it's somewhat awkward/confusing to be talking about *weak* aliases, when I'm not really sure what the basis for that as the term actually *is*.

I would also be happy to just find out there's a nice meaning behind calling them "weak" aliases :-)

r? `@oli-obk`

maybe we want a types MCP to decide on a specific naming here? or maybe we think its just too late to go back on this naming decision ^^'
2025-04-28 13:30:45 +02:00
Guillaume Gomez bf9e3f922e
Rollup merge of #140220 - GuillaumeGomez:doctest-main-wrapping, r=fmease
Fix detection of main function if there are expressions around it

Fixes #140162.
Fixes #139651.

Once this is merged, we can backport and I'll send a follow-up to emit a warning in case a `main` function is about to be "wrapped" (and therefore not run).

r? `@fmease`

try-job: x86_64-mingw-1
2025-04-28 13:30:44 +02:00
bors 45b93b30df Auto merge of #123239 - Urgau:dangerous_implicit_autorefs, r=jdonszelmann,traviscross
Implement a lint for implicit autoref of raw pointer dereference - take 2

*[t-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097)*

This PR aims at implementing a lint for implicit autoref of raw pointer dereference, it is based on #103735 with suggestion and improvements from https://github.com/rust-lang/rust/pull/103735#issuecomment-1370420305.

The goal is to catch cases like this, where the user probably doesn't realise it just created a reference.

```rust
pub struct Test {
    data: [u8],
}

pub fn test_len(t: *const Test) -> usize {
    unsafe { (*t).data.len() }  // this calls <[T]>::len(&self)
}
```

Since #103735 already went 2 times through T-lang, where they T-lang ended-up asking for a more restricted version (which is what this PR does), I would prefer this PR to be reviewed first before re-nominating it for T-lang.

----

Compared to the PR it is as based on, this PR adds 3 restrictions on the outer most expression, which must either be:
   1. A deref followed by any non-deref place projection (that intermediate deref will typically be auto-inserted)
   2. A method call annotated with `#[rustc_no_implicit_refs]`.
   3. A deref followed by a `addr_of!` or `addr_of_mut!`. See bottom of post for details.

There are several points that are not 100% clear to me when implementing the modifications:
 - ~~"4. Any number of automatically inserted deref/derefmut calls." I as never able to trigger this. Am I missing something?~~ Fixed
 - Are "index" and "field" enough?

----

cc `@JakobDegen` `@WaffleLapkin`
r? `@RalfJung`

try-job: dist-various-1
try-job: dist-various-2
2025-04-28 08:25:23 +00:00
Tshepang Mbambo 1b150ed05c use repo name in push pr title
I found "Rustc dev guide subtree update awkward"
2025-04-28 06:49:13 +02:00
Tshepang Mbambo f2e5577050
Merge pull request #2358 from rust-lang/rustc-pull
Rustc pull update
2025-04-28 06:25:10 +02:00
The rustc-dev-guide Cronjob Bot 825c56bcaa Merge from rustc 2025-04-28 04:02:54 +00:00
The rustc-dev-guide Cronjob Bot 420aa5f9ea Preparing for merge from rustc 2025-04-28 04:02:47 +00:00
Yuki Okushi 9b18c5f55c
Merge pull request #2351 from rust-lang/rustc-pull 2025-04-27 18:53:00 +09:00
bors e6c1a64cca Auto merge of #140291 - GuillaumeGomez:doctest-2024-stdout, r=notriddle
Correctly display stdout and stderr in case a doctest is failing

Fixes https://github.com/rust-lang/rust/issues/140289.

Since the doctest is actually running itself, we need to handle the output directly inside it.

cc `@fmease`
r? `@notriddle`
2025-04-27 07:43:46 +00:00
bors 80e2e9f163 Auto merge of #139646 - lcnr:default-is-fully-concrete, r=BoxyUwU
check types of const param defaults

fixes #139643 by checking that the type of a const parameter default matches the type of the parameter as long as both types are fully concrete

r? `@BoxyUwU`
2025-04-27 01:59:43 +00:00
Tshepang Mbambo 28684f92ff
Merge pull request #2356 from rust-lang/tshepang-patch-2
replace command that does not work
2025-04-26 15:37:24 +02:00
Tshepang Mbambo e36f9af1cd
replace command that does not work 2025-04-26 15:34:43 +02:00
Tshepang Mbambo fae7588172
Merge pull request #2355 from rust-lang/tshepang-patch-1
copy-paste ease
2025-04-26 15:19:08 +02:00