Skip to content

Commit 7b9b127

Browse files
committed
Auto merge of #113014 - matthiaskrgr:rollup-dasfmfc, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #112937 (rustdoc: Align search results horizontally for easy scanning) - #112950 (DirEntry::file_name: improve explanation) - #112956 (Expose `compiler-builtins-weak-intrinsics` feature for `-Zbuild-std`) - #113008 (Move some docs from the README to the dev-guide) - #113009 (Remove unnecessary `path` attribute) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f7ca9df + 4824788 commit 7b9b127

File tree

11 files changed

+34
-26
lines changed

11 files changed

+34
-26
lines changed

README.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,13 @@ format:
3333
```
3434

3535
This is how the documentation and examples assume you are running `x.py`.
36-
Some alternative ways are:
37-
38-
```sh
39-
# On a Unix shell if you don't have the necessary `python3` command
40-
./x <subcommand> [flags]
41-
42-
# On the Windows Command Prompt (if .py files are configured to run Python)
43-
x.py <subcommand> [flags]
44-
45-
# You can also run Python yourself, e.g.:
46-
python x.py <subcommand> [flags]
47-
```
36+
See the [rustc dev guide][rustcguidebuild] if this does not work on your platform.
4837

4938
More information about `x.py` can be found by running it with the `--help` flag
5039
or reading the [rustc dev guide][rustcguidebuild].
5140

5241
[gettingstarted]: https://rustc-dev-guide.rust-lang.org/getting-started.html
53-
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
42+
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy
5443

5544
### Dependencies
5645

library/alloc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ compiler-builtins-mem = ['compiler_builtins/mem']
3535
compiler-builtins-c = ["compiler_builtins/c"]
3636
compiler-builtins-no-asm = ["compiler_builtins/no-asm"]
3737
compiler-builtins-mangled-names = ["compiler_builtins/mangled-names"]
38+
compiler-builtins-weak-intrinsics = ["compiler_builtins/weak-intrinsics"]

library/std/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ compiler-builtins-c = ["alloc/compiler-builtins-c"]
6565
compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
6666
compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]
6767
compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"]
68+
compiler-builtins-weak-intrinsics = ["alloc/compiler-builtins-weak-intrinsics"]
6869
llvm-libunwind = ["unwind/llvm-libunwind"]
6970
system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
7071

library/std/src/fs.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1755,8 +1755,14 @@ impl DirEntry {
17551755
self.0.file_type().map(FileType)
17561756
}
17571757

1758-
/// Returns the bare file name of this directory entry without any other
1759-
/// leading path component.
1758+
/// Returns the file name of this directory entry without any
1759+
/// leading path component(s).
1760+
///
1761+
/// As an example,
1762+
/// the output of the function will result in "foo" for all the following paths:
1763+
/// - "./foo"
1764+
/// - "/the/foo"
1765+
/// - "../../foo"
17601766
///
17611767
/// # Examples
17621768
///

library/std/src/sys/windows/c.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::os::windows::io::{AsRawHandle, BorrowedHandle};
1212
use crate::ptr;
1313
use core::ffi::NonZero_c_ulong;
1414

15-
#[path = "c/windows_sys.rs"] // c.rs is included from two places so we need to specify this
1615
mod windows_sys;
1716
pub use windows_sys::*;
1817

library/sysroot/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ compiler-builtins-c = ["std/compiler-builtins-c"]
1717
compiler-builtins-mem = ["std/compiler-builtins-mem"]
1818
compiler-builtins-no-asm = ["std/compiler-builtins-no-asm"]
1919
compiler-builtins-mangled-names = ["std/compiler-builtins-mangled-names"]
20+
compiler-builtins-weak-intrinsics = ["std/compiler-builtins-weak-intrinsics"]
2021
llvm-libunwind = ["std/llvm-libunwind"]
2122
system-llvm-libunwind = ["std/system-llvm-libunwind"]
2223
panic-unwind = ["std/panic_unwind"]

src/librustdoc/html/static/css/rustdoc.css

+2
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,10 @@ so that we can apply CSS-filters to change the arrow color in themes */
891891
color: var(--search-results-grey-color);
892892
}
893893
.search-results .result-name .typename {
894+
display: inline-block;
894895
color: var(--search-results-grey-color);
895896
font-size: 0.875rem;
897+
width: 6.25rem;
896898
}
897899

898900
.popover {

src/librustdoc/html/static/js/search.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ const longItemTypes = [
5252
"enum variant",
5353
"macro",
5454
"primitive type",
55-
"associated type",
55+
"assoc type",
5656
"constant",
57-
"associated constant",
57+
"assoc const",
5858
"union",
5959
"foreign type",
6060
"keyword",

src/tools/tidy/src/features.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ pub fn check(
160160
for &(name, _) in gate_untested.iter() {
161161
println!("Expected a gate test for the feature '{name}'.");
162162
println!(
163-
"Hint: create a failing test file named 'feature-gate-{}.rs'\
164-
\n in the 'ui' test suite, with its failures due to\
165-
\n missing usage of `#![feature({})]`.",
166-
name, name
163+
"Hint: create a failing test file named 'tests/ui/feature-gates/feature-gate-{}.rs',\
164+
\n with its failures due to missing usage of `#![feature({})]`.",
165+
name.replace("_", "-"),
166+
name
167167
);
168168
println!(
169169
"Hint: If you already have such a test and don't want to rename it,\

tests/rustdoc-gui/search-result-display.goml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ set-window-size: (600, 100)
1414
assert-size: (".search-results div.desc", {"width": 566})
1515

1616
// The result set is all on one line.
17-
assert-css: (".search-results .result-name > span", {"display": "inline"})
17+
assert-css: (".search-results .result-name > span:not(.typename)", {"display": "inline"})
18+
assert-css: (".search-results .result-name > span.typename", {"display": "inline-block"})
1819

1920
// Check that the crate filter `<select>` is correctly handled when it goes to next line.
2021
// To do so we need to update the length of one of its `<option>`.

x.ps1

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$ErrorActionPreference = "Stop"
66

77
# syntax check
8-
Get-Command -syntax ${PSCommandPath}
8+
Get-Command -syntax ${PSCommandPath} >$null
99

1010
$xpy = Join-Path $PSScriptRoot x.py
1111
# Start-Process for some reason splits arguments on spaces. (Isn't powershell supposed to be simpler than bash?)
@@ -16,7 +16,13 @@ foreach ($arg in $args) {
1616
}
1717

1818
function Get-Application($app) {
19-
return Get-Command $app -ErrorAction SilentlyContinue -CommandType Application
19+
$cmd = Get-Command $app -ErrorAction SilentlyContinue -CommandType Application | Select-Object -First 1
20+
if ($cmd.source -match '.*AppData\\Local\\Microsoft\\WindowsApps\\.*exe') {
21+
# Windows for some reason puts a `python3.exe` executable in PATH that just opens the windows store.
22+
# Ignore it.
23+
return $false
24+
}
25+
return $cmd
2026
}
2127

2228
function Invoke-Application($application, $arguments) {
@@ -51,5 +57,7 @@ if (($null -ne $found) -and ($found.Length -ge 1)) {
5157
Invoke-Application $python $xpy_args
5258
}
5359

54-
Write-Error "${PSCommandPath}: error: did not find python installed"
60+
$msg = "${PSCommandPath}: error: did not find python installed`n"
61+
$msg += "help: consider installing it from https://www.python.org/downloads/"
62+
Write-Error $msg -Category NotInstalled
5563
Exit 1

0 commit comments

Comments
 (0)