| Age | Commit message (Collapse) | Author | Lines |
|
Rollup of 5 pull requests
Successful merges:
- #129248 (Taking a raw ref (`&raw (const|mut)`) of a deref of pointer (`*ptr`) is always safe)
- #131906 (rustdoc: adjust spacing and typography in header)
- #132084 (Consider param-env candidates even if they have errors)
- #132096 (Replace an FTP link in comments with an equivalent HTTPS link)
- #132098 (rustc_feature::Features: explain what that 'Option<Symbol>' is about)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustc_feature::Features: explain what that 'Option<Symbol>' is about
|
|
Replace an FTP link in comments with an equivalent HTTPS link
Modern browsers and editors often don't support following FTP links, so using an ordinary web link gives the same result in a more convenient way.
|
|
Consider param-env candidates even if they have errors
I added this logic in https://github.com/rust-lang/rust/pull/106309, but frankly I don't know why -- the logic was a very large hammer. It seems like recent changes to error tainting has made that no longer necessary.
Ideally we'd rework the way we handle error reporting in all of candidate assembly to be a bit more responsible; we're just suppressing candidates all willy-nilly and it leads to mysterious *other* errors cropping up, like the one that #132082 originally wanted to fix.
**N.B.** This has the side-effect of turning a failed resolution like `where Missing: Sized` into a trivial where clause that matches all types, but also I don't think it really matters?
I'm putting this up as an alternative to #132082, since that PR doesn't address the case when one desugars the APIT into a regular type param.
r? lcnr vibeck
|
|
rustdoc: adjust spacing and typography in header
Fixes #131589
Preview: https://notriddle.com/rustdoc-html-demo-12/spacing/std/index.html
| Before | After |
|--|--|
|  | 
|  | 
|  | 
|  | 
First of all, we put 4px additional margin below the search box, and 4px margin below the header to balance it out.
The bigger problem we have to solve is making the lines look logically spaced. This is troublesome, because Fira Sans (the typeface we use here) wants to look good on average, and to avoid breaking, with text that uses [ascenders and descenders](https://www.w3.org/TR/css-inline-3/images/text-edge.png). If the text we're putting in happens to not have any, things look weird (strictly speaking, there’s hand-tuning here, because the Copy Path button messes with stuff, but the overall point is that there is no true, one perfect layout).
In order to play nicely with the font, I've tweaked the text to use that space. The word "Source" for the link is now capitalized, and the Since version number now uses oldstyle nums with descenders.
|
|
Taking a raw ref (`&raw (const|mut)`) of a deref of pointer (`*ptr`) is always safe
T-opsem decided in https://github.com/rust-lang/reference/pull/1387 that `*ptr` is only unsafe if the place is accessed. This means that taking a raw ref of a deref expr is always safe, since it doesn't constitute a read.
This also relaxes the `DEREF_NULLPTR` lint to stop warning in the case of raw ref of a deref'd nullptr, and updates its docs to reflect that change in the UB specification.
This does not change the behavior of `addr_of!((*ptr).field)`, since field projections still require the projection is in-bounds.
I'm on the fence whether this requires an FCP, since it's something that is guaranteed by the reference you could ostensibly call this a bugfix since we were counting truly safe operations as unsafe. Perhaps someone on opsem has a strong opinion? cc `@rust-lang/opsem`
|
|
|
|
|
|
r=GuillaumeGomez
rustdoc: hash assets at rustdoc build time
Since sha256 is slow enough to show up on small benchmarks, we can save time by embedding the hash in the executable.
Addresses https://github.com/rust-lang/rust/pull/131934#issuecomment-2424213861
|
|
Rollup of 10 pull requests
Successful merges:
- #130225 (Rename Receiver -> LegacyReceiver)
- #131169 (Fix `target_vendor` in QNX Neutrino targets)
- #131623 (misc cleanups)
- #131756 (Deeply normalize `TypeTrace` when reporting type error in new solver)
- #131898 (minor `*dyn` cast cleanup)
- #131909 (Prevent overflowing enum cast from ICEing)
- #131930 (Don't allow test revisions that conflict with built in cfgs)
- #131956 (coverage: Pass coverage mappings to LLVM as separate structs)
- #132076 (HashStable for rustc_feature::Features: stop hashing compile-time constant)
- #132088 (Print safety correctly in extern static items)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Print safety correctly in extern static items
Fixes #132080
r? spastorino or anyone really
|
|
r=nnethercote,Mark-Simulacrum
HashStable for rustc_feature::Features: stop hashing compile-time constant
It seems like back in https://github.com/rust-lang/rust/commit/542bc75deaaf4e84dcd7a196685bc1a1cb100d32 this was added as "hash the boolean value of each lang feature", but then in https://github.com/rust-lang/rust/commit/1487bd6a174f813967ffff6b3334b4fe296f1f30 this got split into first hashing a sequence of `bool`s (representing all the features) and then hashing all the feature names... but the list of feature names is a compile-time constant, so it seems entirely unnecessary to hash them?
Cc `@Mark-Simulacrum` who wrote the second of the commits mentioned above.
Cc `@nnethercote`
|
|
coverage: Pass coverage mappings to LLVM as separate structs
Instead of trying to cram *N* different kinds of coverage mapping data into a single list for FFI, pass *N* different lists of simpler structs.
This avoids the need to fill unused fields with dummy values, and avoids the need to tag structs with their underlying kind. It also lets us call the dedicated LLVM constructors for each different mapping type, instead of having to go through the complex general-purpose constructor.
Even though this adds multiple new structs to the FFI surface area, the resulting C++ code is simpler and shorter.
---
I've structured this mostly as a single atomic patch, rather than a series of incremental changes, because that avoids the need to make fiddly fixes to code that is about to be deleted anyway.
|
|
Don't allow test revisions that conflict with built in cfgs
Fixes #128964
Sorry `@heysujal` I started working on this about 1 minute before your comment by complete coincidence 😅
|
|
Prevent overflowing enum cast from ICEing
Fixes #131902
|
|
minor `*dyn` cast cleanup
Small follow-up to https://github.com/rust-lang/rust/pull/130234 to remove a redundant check and clean up comments. No functional changes.
Also, explain why casts cannot drop the principal even though coercions can, and add a test because apparently we didn't have one already.
r? `@WaffleLapkin` or `@compiler-errors`
|
|
Deeply normalize `TypeTrace` when reporting type error in new solver
Normalize the values that come from the `TypeTrace` for various type mismatches.
Side-note: We can't normalize the `TypeError` itself bc it may come from instantiated binders, so it may reference values from within the probe...
r? lcnr
|
|
misc cleanups
|
|
Fix `target_vendor` in QNX Neutrino targets
The `x86_64-pc-nto-qnx710` and `i586-pc-nto-qnx700` targets have `pc` in their target triple names, but the vendor was set to the default `"unknown"`.
CC target maintainers `@flba-eb,` `@gh-tr,` `@jonathanpallant` and `@japaric`
|
|
Rename Receiver -> LegacyReceiver
As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait.
This PR renames the old trait to get it out the way. Naming is hard. Options considered included:
* HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded)
* LegacyReceiver
* TargetLessReceiver
* OldReceiver
These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether.
Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages.
It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency.
This is a part of the arbitrary self types v2 project,
https://github.com/rust-lang/rfcs/pull/3519
https://github.com/rust-lang/rust/issues/44874
r? `@wesleywiser`
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #130991 (Vectorized SliceContains)
- #131928 (rustdoc: Document `markdown` module.)
- #131955 (Set `signext` or `zeroext` for integer arguments on RISC-V and LoongArch64)
- #131979 (Minor tweaks to `compare_impl_item.rs`)
- #132036 (Add a test case for #131164)
- #132039 (Specialize `read_exact` and `read_buf_exact` for `VecDeque`)
- #132060 ("innermost", "outermost", "leftmost", and "rightmost" don't need hyphens)
- #132065 (Clarify documentation of `ptr::dangling()` function)
- #132066 (Fix a typo in documentation of `pointer::sub_ptr()`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
double_parens
filter_map_identity
needless_question_mark
redundant_guards
|
|
Fix a typo in documentation of `pointer::sub_ptr()`
Just a typo in docs.
|
|
Clarify documentation of `ptr::dangling()` function
Also fixes the safety comment in `NonNull::dangling()` function.
Fixes #132004.
|
|
"innermost", "outermost", "leftmost", and "rightmost" don't need hyphens
These are all standard dictionary words and don't require hyphenation.
-----
Encountered an instance of this in error messages and it bugged me, so I
figured I'd fix it across the entire codebase.
|
|
Specialize `read_exact` and `read_buf_exact` for `VecDeque`
|
|
Add a test case for #131164
The upstream has already been fixed, but it won't be backported to LLVM 19.
r? jieyouxu or compiler
try-job: x86_64-gnu-stable
|
|
Minor tweaks to `compare_impl_item.rs`
1. Stop using the `InstantiatedPredicates` struct for `hybrid_preds` in `compare_impl_item.rs`, since we never actually push anything into the `spans` part of it.
2. Remove redundant impl args and don't do useless identity substitution, prefer calling `instantiate_identity`.
|
|
Set `signext` or `zeroext` for integer arguments on RISC-V and LoongArch64
This PR contains 3 commits:
- the first one introduces a new function `adjust_for_rust_abi` in `rustc_target`, and moves the x86 specific adjustment code into it;
- the second one adds RISC-V specific adjustment code into it, which sets `signext` or `zeroext` attribute for integer arguments.
- **UPDATE**: added the 3rd commit to apply the same adjustment for LoongArch64.
|
|
rustdoc: Document `markdown` module.
Rustdoc markdown handling is currently split between:
- html::markdown, which contains all the meaty login
- markdown, which is only used for when rustdoc renders a standalone markdown file
Adds module-level doc-comment to markdown, and rename the function so it's clear that it's doing IO (instead of just rendering to a string).
|
|
Vectorized SliceContains
Godbolt for the u32 case: https://rust.godbolt.org/z/exT9xYWGs
Unsure about:
- Should align_to be used? It didn't seem to matter in my benchmark but maybe I was lucky with alignment?
- Should u8/i8 also be implemented? Currently uses memchr (SWAR)
Some benchmarks on x86 (contains called on an array with no matches, worst case may be slightly worse):
## Large N

## Small N

|
|
Rollup of 5 pull requests
Successful merges:
- #131043 (Refactor change detection for rustdoc and download-rustc)
- #131181 (Compiletest: Custom differ)
- #131487 (Add wasm32v1-none target (compiler-team/#791))
- #132054 (do not remove `.cargo` directory)
- #132058 (CI: rfl: use rust-next temporary commit)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
CI: rfl: use rust-next temporary commit
Commit c95bbb59a9b22f9b838b15d28319185c1c884329 within rust-next contains some changes required to be compatible with upcoming arbitraty self types work. Roll RFL CI forward to the latest rust-next to include that work.
Related:
https://github.com/rust-lang/rust/pull/130225
https://github.com/rust-lang/rust/issues/44874
r? ``@ojeda``
try-job: x86_64-rust-for-linux
|
|
do not remove `.cargo` directory
If vendoring isn't used bootstrap removes `.cargo` directory, which prevents developers from setting certain options in the `.cargo/config.toml` file. This was introduced in https://github.com/rust-lang/rust/pull/97513 (specifically in [this commit](https://github.com/rust-lang/rust/pull/97513/commits/345eb14f6c841cd38e76a5b0bbf99e1b94a90d40)). Also, since https://github.com/rust-lang/rust/pull/123942, vendoring is now possible even in git sources, which means we shouldn't remove `.cargo` directory in git sources anymore.
|
|
Add wasm32v1-none target (compiler-team/#791)
This is a preliminary implementation of the MCP discussed in [compiler-team#791](https://github.com/rust-lang/compiler-team/issues/791). It's not especially "major" but you know, process! Anyway it adds a new wasm32v1-none target which just pins down a set of wasm features. I think this is close to the consensus that emerged when discussing it on Zulip so I figured I'd sketch to see how hard it is. Turns out not very.
|
|
Compiletest: Custom differ
This adds support for a custom differ for compiletests. It’s purely visual and helps produce cleaner output when UI tests fail.
I’m using an environment variable for now since it’s experimental and I don’t want to drill the cli arguments all the way down. Also did a bit of general cleanup while I was at it.
This is how it looks [with debug info silenced](https://github.com/rust-lang/rust/pull/131182) (#131182)
`COMPILETEST_DIFF_TOOL="/usr/bin/env difft --color always --background light --display side-by-side" ./x test tests/ui/parser`

|
|
Refactor change detection for rustdoc and download-rustc
This pull request refactors the change detection logic in the build process by consolidating redundant code into a new helper method. The key changes include the removal of duplicate logic for checking changes in directories and the addition of a new method to handle this functionality.
Refactoring and code simplification:
* [`src/bootstrap/src/core/build_steps/tool.rs`](diffhunk://#diff-dc86e288bcf7b3ca3f8c127d3568fbafc785704883bc7fc336bd185910aed5daL588-R593): Removed redundant change detection logic and replaced it with a call to the new `check_for_changes` method.
* [`src/bootstrap/src/core/config/config.rs`](diffhunk://#diff-5f5330cfcdb0a89b85ac3547b761c3a45c2534a85c4aaae8fea88c711a7a65b2R2837-R2872): Added a new method `check_for_changes` to centralize the logic for detecting changes in specified directories since a given commit.
* [`src/bootstrap/src/core/config/config.rs`](diffhunk://#diff-5f5330cfcdb0a89b85ac3547b761c3a45c2534a85c4aaae8fea88c711a7a65b2L2728-R2740): Updated the existing change detection code to use the new `check_for_changes` method.
Cleanup:
* [`src/bootstrap/src/core/build_steps/tool.rs`](diffhunk://#diff-dc86e288bcf7b3ca3f8c127d3568fbafc785704883bc7fc336bd185910aed5daL13-R13): Removed the unused import `git` from the helpers module.
r? ``@AlbertLarsan68``
|
|
|
|
|
|
|