| Age | Commit message (Collapse) | Author | Lines |
|
Implement RFC3137 trim-paths sysroot changes - take 2
This PR is a continuation of https://github.com/rust-lang/rust/pull/118149. Nothing really changed, except for https://github.com/rust-lang/rust/pull/129408 which I was able to trigger locally.
Original description:
> Implement parts of #111540
>
> Right now, backtraces into sysroot always shows /rustc/$hash in diagnostics, e.g.
>
> ```
> thread 'main' panicked at 'hello world', map-panic.rs:2:50
> stack backtrace:
> 0: std::panicking::begin_panic
> at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12
> 1: map_panic::main::{{closure}}
> at ./map-panic.rs:2:50
> 2: core::option::Option<T>::map
> at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29
> 3: map_panic::main
> at ./map-panic.rs:2:30
> 4: core::ops::function::FnOnce::call_once
> at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
> ```
>
> [RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc)
>
> > We want to change this behaviour such that, when rust-src source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a --remap-path-prefix that causes this local path to be remapped in the usual way.
>
> This PR implements this behaviour. When `rust-src` is present at compile time, rustc replaces /rustc/$hash with a real path into local rust-src with best effort. To sanitise this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo`.
cc `@cbeuw`
Fix #105907
Fix #85463
try-job: dist-x86_64-linux
try-job: x86_64-msvc
try-job: dist-x86_64-msvc
try-job: armhf-gnu
|
|
in case the real paths into the libstd/libcore are located inside the
the build directory, maybe because it's coming from an extracted dist
component in the build dir (cc opt-dist)
|
|
compiletest: rename "runtest/crash.rs" to "runtest/crashes.rs" to be in line with the test directory
r? jieyouxu
|
|
simplify LLVM submodule handling
Fixes #130906.
|
|
atomics: allow atomic and non-atomic reads to race
We currently define our atomics in terms of C++ `atomic_ref`. That has the unfortunate side-effect of making it UB for an atomic and a non-atomic read to race (concretely, [this code](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d1a743774e60923db33def7fe314d754) has UB). There's really no good reason for this, all the academic models of the C++ memory model I am aware of allow this -- C++ just disallows this because of their insistence on an "object model" with typed memory, where `atomic_ref` temporarily creates an "atomic object" that may not be accesses via regular non-atomic operations.
So instead of tying our operations to `atomic_ref`, let us tie them directly to the underlying C++ memory model. I am not sure what is the best way to phrase this, so here's a first attempt.
We also carve out an exception from the "no mixed-size atomic accesses" rule to permit mixed-size atomic reads -- given that we permit mixed-size non-atomic reads, it seems odd that this would be disallowed for atomic reads. However, when an atomic write races with any other atomic operation, they must use the same size.
With this change, it is finally the case that every non-atomic access can be replaced by an atomic access without introducing UB.
Cc `@rust-lang/opsem` `@chorman0773` `@m-ou-se` `@WaffleLapkin` `@Amanieu`
Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/483
|
|
Rollup of 8 pull requests
Successful merges:
- #125404 (Fix `read_buf` uses in `std`)
- #130866 (Allow instantiating object trait binder when upcasting)
- #130922 (Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4)
- #130924 (Make clashing_extern_declarations considering generic args for ADT field)
- #130939 (rustdoc: update `ProcMacro` docs section on helper attributes)
- #130940 (Revert space-saving operations)
- #130944 (Allow instantiating trait object binder in ptr-to-ptr casts)
- #130953 (Rename a few tests to make tidy happier)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
with the test directory
r? jieyouxu
|
|
- UnsafeCell: mention the term "data race", and reference the data race definition
- atomic: failing RMWs are just reads, reorder and reword docs
|
|
|
|
|
|
Rename a few tests to make tidy happier
A somewhat random smattering of tests that I have recently looked at, and thus had cause to research and write down the reason for their existence.
|
|
r=Kobzol
Revert space-saving operations
The "all of our artifacts" `mv` seems like it may save enough space to matter sometimes, since it can range up to a gigabyte of difference, if memory serves. For the rest, I think we're good.
try-job: dist-aarch64-apple
|
|
rustdoc: update `ProcMacro` docs section on helper attributes
I believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes.
The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers:
```rust
#[proc_macro_attribute(attributes(helper))]
pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}
```
The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
|
|
bump few deps
Bumps cargo_metadata, thorin-dwp, windows.
Should dedupe some crates around.
|
|
GCC backend subtree update
We just finished the [last sync](https://github.com/rust-lang/rustc_codegen_gcc/pull/556) so time to sync back.
cc `@antoyo`
|
|
Update cargo
19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a
2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000
- Update cc to 1.1.22 (rust-lang/cargo#14607)
- feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556)
- feat(toml): Add `autolib` (rust-lang/cargo#14591)
- fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598)
- test: relax panic output assertion (rust-lang/cargo#14602)
- feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588)
- feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404)
- fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579)
- fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587)
- feat: make lockfile v4 the default (rust-lang/cargo#14595)
- perf: Improve quality of completion performance traces (rust-lang/cargo#14592)
- test: Remove completion tests (rust-lang/cargo#14590)
- feat: Add support for completing `cargo update <TAB>` (rust-lang/cargo#14552)
- test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577)
- fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569)
- chore: Bump MSRV to 1.81 (rust-lang/cargo#14585)
- Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280)
- fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568)
- feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #130718 (Cleanup some known-bug issues)
- #130730 (Reorganize Test Headers)
- #130826 (Compiler: Rename "object safe" to "dyn compatible")
- #130915 (fix typo in triagebot.toml)
- #130926 (Update cc to 1.1.22 in library/)
- #130932 (etc: Add sample rust-analyzer configs for eglot & helix)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
|
|
etc: Add sample rust-analyzer configs for eglot & helix
LSP configuration in editors like Emacs (eglot) and helix does not
use the same JSON format as vscode and vim do. It is not obvious
how to set up LSP for rustc in those editors and the dev guide currently
does not cover them. Adding sample configuration files for those editors
alongside the currently existing JSON one would be helpful.
I figured having those included in the repo like the JSON one might save
someone some time and frustration otherwise spent on trying to get the
more niche editors' LSP to work properly. I'll add a section in the dev
guide too.
|
|
Update cc to 1.1.22 in library/
r? `@ghost`
try-job: x86_64-msvc
|
|
r=compiler-errors
Compiler: Rename "object safe" to "dyn compatible"
Completed T-lang FCP: https://github.com/rust-lang/lang-team/issues/286#issuecomment-2338905118.
Tracking issue: https://github.com/rust-lang/rust/issues/130852
Excludes `compiler/rustc_codegen_cranelift` (to be filed separately).
Includes Stable MIR.
Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language).
r? ghost
|
|
This partially reverts commit fe7c97c2e732de8dfc93ef21ee84ccfbc04c7d0c.
I kept a mv, not a cp, for the one that shuffles major artifacts around,
because the size of those artifacts are big enough to matter, sometimes.
I don't think the diagnostic info will be that heavy, by comparison.
|
|
This reverts commit 06f49f6d5326440192b8d31d69fa490dbfe01cfe.
|
|
I believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes.
The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers:
```rust
#[proc_macro_attribute(attributes(helper))]
pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}
```
The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
|
|
delete sub build directory "debug" to not delete the change-id file
Fixes #130449
|
|
LSP configuration in editors like Emacs (eglot) and helix does not
use the same JSON format as vscode and vim do. It is not obvious
how to set up LSP for rustc in those editors and the dev guide currently
does not cover them. Adding sample configuration files for those editors
alongside the currently existing JSON one would be helpful.
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
|
|
|
|
|
|
rustdoc perf: clone `clean::Item` less
In https://github.com/rust-lang/rust/pull/130798, I caused a small perf regression for rustdoc (see https://github.com/rust-lang/rust/pull/130807#issuecomment-2373116917), so here is a small improvement to make up for it :smiley_cat:.
This change is actually unrelated to the minor perf regression in `Item::stability` and instead fixes a more relevant perf problem that I found while investigating: For certain crates with many impls on type aliases, we unnecessarily cloned large `clean::Item`s multiple times -- now we just borrow them.
|
|
|
|
cargo_metadata, thorin-dwp, windows
|
|
On implicit `Sized` bound on fn argument, point at type instead of pattern
Instead of
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:20
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^ doesn't have a size known at compile-time
```
output
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:29
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
```
|
|
notriddle:notriddle/suggest-wrap-parens-fn-pointer, r=compiler-errors
diagnostics: wrap fn cast suggestions in parens when needed
Fixes #121632
|
|
Weekly `cargo update`: only `rustbook`
We are having problems getting updates to merge due to CI failures. I took only the rustbook portion of https://github.com/rust-lang/rust/pull/129538 and put it into this PR, which hopefully should be able to successfully merge on its own.
Original message:
```
cargo update: rustbook
rustbook dependencies:
Locking 70 packages to latest compatible versions
Removing adler v1.0.2
Adding adler2 v2.0.0
Updating anstream v0.6.14 -> v0.6.15
Updating anstyle v1.0.7 -> v1.0.8
Updating anstyle-parse v0.2.4 -> v0.2.5
Updating anstyle-query v1.1.0 -> v1.1.1
Updating anstyle-wincon v3.0.3 -> v3.0.4
Updating anyhow v1.0.86 -> v1.0.89
Removing base64 v0.22.1
Updating bstr v1.9.1 -> v1.10.0
Adding byteorder v1.5.0
Updating cc v1.1.5 -> v1.1.21
Updating clap v4.5.9 -> v4.5.18
Updating clap_builder v4.5.9 -> v4.5.18
Updating clap_complete v4.5.8 -> v4.5.29
Updating clap_derive v4.5.8 -> v4.5.18
Updating clap_lex v0.7.1 -> v0.7.2
Updating colorchoice v1.0.1 -> v1.0.2
Updating core-foundation-sys v0.8.6 -> v0.8.7
Updating cpufeatures v0.2.12 -> v0.2.14
Adding dateparser v0.2.1
Removing deranged v0.3.11
Updating env_filter v0.1.0 -> v0.1.2
Updating env_logger v0.11.3 -> v0.11.5
Updating fastrand v2.1.0 -> v2.1.1
Updating flate2 v1.0.30 -> v1.0.33
Updating iana-time-zone v0.1.60 -> v0.1.61
Updating indexmap v2.2.6 -> v2.5.0
Updating is_terminal_polyfill v1.70.0 -> v1.70.1
Updating js-sys v0.3.69 -> v0.3.70
Adding lazy_static v1.5.0
Updating libc v0.2.155 -> v0.2.158
Removing linked-hash-map v0.5.6
Updating mdbook-i18n-helpers v0.3.4 -> v0.3.5
Updating miniz_oxide v0.7.4 -> v0.8.0
Updating normpath v1.2.0 -> v1.3.0
Removing num-conv v0.1.0
Updating opener v0.7.1 -> v0.7.2
Updating pest v2.7.11 -> v2.7.13
Updating pest_derive v2.7.11 -> v2.7.13
Updating pest_generator v2.7.11 -> v2.7.13
Updating pest_meta v2.7.11 -> v2.7.13
Removing plist v1.7.0
Removing powerfmt v0.2.0
Updating ppv-lite86 v0.2.17 -> v0.2.20
Adding pulldown-cmark v0.11.3 (latest: v0.12.1)
Adding pulldown-cmark-escape v0.11.0
Adding pulldown-cmark-to-cmark v15.0.1 (latest: v17.0.0)
Removing quick-xml v0.32.0
Updating quote v1.0.36 -> v1.0.37
Updating redox_syscall v0.5.3 -> v0.5.4
Updating regex v1.10.5 -> v1.10.6
Updating rustix v0.38.34 -> v0.38.37
Updating serde v1.0.204 -> v1.0.210
Updating serde_derive v1.0.204 -> v1.0.210
Updating serde_json v1.0.120 -> v1.0.128
Updating serde_spanned v0.6.6 -> v0.6.7
Updating syn v2.0.71 -> v2.0.77
Updating tempfile v3.10.1 -> v3.12.0
Updating thiserror v1.0.62 -> v1.0.63
Updating thiserror-impl v1.0.62 -> v1.0.63
Removing time v0.3.36
Removing time-core v0.1.2
Removing time-macros v0.2.18
Updating toml v0.8.14 -> v0.8.19
Updating toml_datetime v0.6.6 -> v0.6.8
Updating toml_edit v0.22.15 -> v0.22.21
Updating unicode-ident v1.0.12 -> v1.0.13
Updating unicode-normalization v0.1.23 -> v0.1.24
Updating unicode-width v0.1.13 -> v0.1.14 (latest: v0.2.0)
Updating version_check v0.9.4 -> v0.9.5
Updating wasm-bindgen v0.2.92 -> v0.2.93
Updating wasm-bindgen-backend v0.2.92 -> v0.2.93
Updating wasm-bindgen-macro v0.2.92 -> v0.2.93
Updating wasm-bindgen-macro-support v0.2.92 -> v0.2.93
Updating wasm-bindgen-shared v0.2.92 -> v0.2.93
Updating winapi-util v0.1.8 -> v0.1.9
Adding windows-sys v0.59.0
Updating winnow v0.6.13 -> v0.6.18
Removing yaml-rust v0.4.5
Adding zerocopy v0.7.35
Adding zerocopy-derive v0.7.35
note: pass `--verbose` to see 26 unchanged dependencies behind latest
```
|
|
r=notriddle
[rustdoc] Remove unneeded jinja comments
This is a follow-up of https://github.com/rust-lang/rust/pull/130585.
Since we now check for the jinja comments we missed, we can now check for the jinja comments which are unneeded. It will make the parsing and therefore the compilation a tiny bit faster (well, if anyone sees a difference haha). The real goal is mostly to have easier to read template files. :wink:
r? ``@notriddle``
|
|
Fixes #121632
|
|
Instead of
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:20
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^ doesn't have a size known at compile-time
```
output
```
error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
--> $DIR/issue-59324.rs:23:29
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
```
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #130279 (Document subtleties of `ManuallyDrop`)
- #130517 (Add the library workspace to the suggested rust-analyzer config)
- #130820 (Fix diagnostics for coroutines with () as input.)
- #130833 (Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation)
- #130845 (Utf8Chunks: add link to Utf8Chunk)
- #130850 (Pass Module Analysis Manager to Standard Instrumentations)
- #130861 (Use `mem::offset_of!` for `sockaddr_un.sun_path`)
- #130862 (rustdoc: do not animate :target when user prefers reduced motion)
- #130868 (Update FIXME comment in s390x_unknown_linux_*.rs)
- #130879 (Pass correct HirId to late_bound_vars in diagnostic code)
- #130880 (add missing FIXME(const-hack))
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustdoc: do not animate :target when user prefers reduced motion
This accessibility improvement gates #129284 behind an inverted [prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/`@media/prefers-reduced-motion)` media query.
|
|
Add the library workspace to the suggested rust-analyzer config
|
|
|
|
|