Skip to content

Commit 92aff72

Browse files
committed
Auto merge of #54575 - pietroalbini:rollup, r=pietroalbini
Rollup of 12 pull requests Successful merges: - #53518 (Add doc for impl From in char_convert) - #54058 (Introduce the partition_dedup/by/by_key methods for slices) - #54281 (Search box) - #54368 (Reduce code block sides padding) - #54498 (The project moved under the Mozilla umbrella) - #54518 (resolve: Do not block derive helper resolutions on single import resolutions) - #54522 (Fixed three small typos.) - #54529 (aarch64-pc-windows-msvc: Don't link libpanic_unwind to libtest.) - #54537 (Rename slice::exact_chunks() to slice::chunks_exact()) - #54539 (Fix js error) - #54557 (incr.comp.: Don't automatically enable -Zshare-generics for incr. comp. builds.) - #54558 (Improvements to finding LLVM's FileCheck) Failed merges: r? @ghost
2 parents 4141a40 + cc9dea4 commit 92aff72

File tree

27 files changed

+538
-224
lines changed

27 files changed

+538
-224
lines changed

config.toml.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@
322322

323323
# Flag indicating whether codegen tests will be run or not. If you get an error
324324
# saying that the FileCheck executable is missing, you may want to disable this.
325+
# Also see the target's llvm-filecheck option.
325326
#codegen-tests = true
326327

327328
# Flag indicating whether git info will be retrieved from .git automatically.
@@ -416,6 +417,10 @@
416417
# target.
417418
#llvm-config = "../path/to/llvm/root/bin/llvm-config"
418419

420+
# Normally the build system can find LLVM's FileCheck utility, but if
421+
# not, you can specify an explicit file name for it.
422+
#llvm-filecheck = "/path/to/FileCheck"
423+
419424
# Path to the custom jemalloc static library to link into the standard library
420425
# by default. This is only used if jemalloc is still enabled above
421426
#jemalloc = "/path/to/jemalloc/libjemalloc_pic.a"

src/bootstrap/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ pub struct Config {
162162
pub struct Target {
163163
/// Some(path to llvm-config) if using an external LLVM.
164164
pub llvm_config: Option<PathBuf>,
165+
/// Some(path to FileCheck) if one was specified.
166+
pub llvm_filecheck: Option<PathBuf>,
165167
pub jemalloc: Option<PathBuf>,
166168
pub cc: Option<PathBuf>,
167169
pub cxx: Option<PathBuf>,
@@ -330,6 +332,7 @@ struct Rust {
330332
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
331333
struct TomlTarget {
332334
llvm_config: Option<String>,
335+
llvm_filecheck: Option<String>,
333336
jemalloc: Option<String>,
334337
cc: Option<String>,
335338
cxx: Option<String>,
@@ -583,6 +586,9 @@ impl Config {
583586
if let Some(ref s) = cfg.llvm_config {
584587
target.llvm_config = Some(config.src.join(s));
585588
}
589+
if let Some(ref s) = cfg.llvm_filecheck {
590+
target.llvm_filecheck = Some(config.src.join(s));
591+
}
586592
if let Some(ref s) = cfg.jemalloc {
587593
target.jemalloc = Some(config.src.join(s));
588594
}

src/bootstrap/configure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ def v(*args):
9595
v("bindir", "install.bindir", "install binaries")
9696

9797
v("llvm-root", None, "set LLVM root")
98+
v("llvm-config", None, "set path to llvm-config")
99+
v("llvm-filecheck", None, "set path to LLVM's FileCheck utility")
98100
v("python", "build.python", "set path to python")
99101
v("jemalloc-root", None, "set directory where libjemalloc_pic.a is located")
100102
v("android-cross-path", "target.arm-linux-androideabi.android-ndk",
@@ -323,6 +325,10 @@ def set(key, value):
323325
set('build.cargo', value + '/bin/cargo')
324326
elif option.name == 'llvm-root':
325327
set('target.{}.llvm-config'.format(build()), value + '/bin/llvm-config')
328+
elif option.name == 'llvm-config':
329+
set('target.{}.llvm-config'.format(build()), value)
330+
elif option.name == 'llvm-filecheck':
331+
set('target.{}.llvm-filecheck'.format(build()), value)
326332
elif option.name == 'jemalloc-root':
327333
set('target.{}.jemalloc'.format(build()), value + '/libjemalloc_pic.a')
328334
elif option.name == 'tools':

src/bootstrap/lib.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,28 @@ impl Build {
641641
/// Returns the path to `FileCheck` binary for the specified target
642642
fn llvm_filecheck(&self, target: Interned<String>) -> PathBuf {
643643
let target_config = self.config.target_config.get(&target);
644-
if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
644+
if let Some(s) = target_config.and_then(|c| c.llvm_filecheck.as_ref()) {
645+
s.to_path_buf()
646+
} else if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
645647
let llvm_bindir = output(Command::new(s).arg("--bindir"));
646-
Path::new(llvm_bindir.trim()).join(exe("FileCheck", &*target))
648+
let filecheck = Path::new(llvm_bindir.trim()).join(exe("FileCheck", &*target));
649+
if filecheck.exists() {
650+
filecheck
651+
} else {
652+
// On Fedora the system LLVM installs FileCheck in the
653+
// llvm subdirectory of the libdir.
654+
let llvm_libdir = output(Command::new(s).arg("--libdir"));
655+
let lib_filecheck = Path::new(llvm_libdir.trim())
656+
.join("llvm").join(exe("FileCheck", &*target));
657+
if lib_filecheck.exists() {
658+
lib_filecheck
659+
} else {
660+
// Return the most normal file name, even though
661+
// it doesn't exist, so that any error message
662+
// refers to that.
663+
filecheck
664+
}
665+
}
647666
} else {
648667
let base = self.llvm_out(self.config.build).join("build");
649668
let base = if !self.config.ninja && self.config.build.contains("msvc") {

src/doc/index.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
nav {
55
display: none;
66
}
7+
#search-input {
8+
width: calc(100% - 58px);
9+
}
10+
#search-but {
11+
cursor: pointer;
12+
}
13+
#search-but, #search-input {
14+
padding: 4px;
15+
border: 1px solid #ccc;
16+
border-radius: 3px;
17+
outline: none;
18+
font-size: 0.7em;
19+
background-color: #fff;
20+
}
21+
#search-but:hover, #search-input:focus {
22+
border-color: #55a9ff;
23+
}
724
</style>
825

926
Welcome to an overview of the documentation provided by the Rust project.
@@ -45,8 +62,9 @@ accomplishing various tasks.
4562

4663
<div>
4764
<form action="std/index.html" method="get">
48-
<input type="search" name="search"/>
49-
<button>Search</button>
65+
<input id="search-input" type="search" name="search"
66+
placeholder="Search through the standard library"/>
67+
<button id="search-but">Search</button>
5068
</form>
5169
</div>
5270

src/doc/unstable-book/src/compiler-flags/profile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ cargo run
1818
```
1919

2020
Once you've built and run your program, files with the `gcno` (after build) and `gcda` (after execution) extensions will be created.
21-
You can parse them with [llvm-cov gcov](http://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-gcov) or [grcov](https://github.com/marco-c/grcov).
21+
You can parse them with [llvm-cov gcov](https://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-gcov) or [grcov](https://github.com/mozilla/grcov).

src/liballoc/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@
116116
#![feature(unsize)]
117117
#![feature(allocator_internals)]
118118
#![feature(on_unimplemented)]
119-
#![feature(exact_chunks)]
119+
#![feature(chunks_exact)]
120120
#![feature(rustc_const_unstable)]
121121
#![feature(const_vec_new)]
122+
#![feature(slice_partition_dedup)]
122123
#![feature(maybe_uninit)]
123124

124125
// Allow testing this library

src/liballoc/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ pub use core::slice::{from_raw_parts, from_raw_parts_mut};
123123
pub use core::slice::{from_ref, from_mut};
124124
#[stable(feature = "slice_get_slice", since = "1.28.0")]
125125
pub use core::slice::SliceIndex;
126-
#[unstable(feature = "exact_chunks", issue = "47115")]
127-
pub use core::slice::{ExactChunks, ExactChunksMut};
126+
#[unstable(feature = "chunks_exact", issue = "47115")]
127+
pub use core::slice::{ChunksExact, ChunksExactMut};
128128

129129
////////////////////////////////////////////////////////////////////////////////
130130
// Basic slice extension methods

src/liballoc/tests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#![feature(str_escape)]
2121
#![feature(try_reserve)]
2222
#![feature(unboxed_closures)]
23-
#![feature(exact_chunks)]
23+
#![feature(chunks_exact)]
2424
#![feature(repeat_generic_slice)]
2525

2626
extern crate alloc_system;

src/liballoc/tests/slice.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -975,27 +975,27 @@ fn test_chunksator_0() {
975975
}
976976

977977
#[test]
978-
fn test_exact_chunksator() {
978+
fn test_chunks_exactator() {
979979
let v = &[1, 2, 3, 4, 5];
980980

981-
assert_eq!(v.exact_chunks(2).len(), 2);
981+
assert_eq!(v.chunks_exact(2).len(), 2);
982982

983983
let chunks: &[&[_]] = &[&[1, 2], &[3, 4]];
984-
assert_eq!(v.exact_chunks(2).collect::<Vec<_>>(), chunks);
984+
assert_eq!(v.chunks_exact(2).collect::<Vec<_>>(), chunks);
985985
let chunks: &[&[_]] = &[&[1, 2, 3]];
986-
assert_eq!(v.exact_chunks(3).collect::<Vec<_>>(), chunks);
986+
assert_eq!(v.chunks_exact(3).collect::<Vec<_>>(), chunks);
987987
let chunks: &[&[_]] = &[];
988-
assert_eq!(v.exact_chunks(6).collect::<Vec<_>>(), chunks);
988+
assert_eq!(v.chunks_exact(6).collect::<Vec<_>>(), chunks);
989989

990990
let chunks: &[&[_]] = &[&[3, 4], &[1, 2]];
991-
assert_eq!(v.exact_chunks(2).rev().collect::<Vec<_>>(), chunks);
991+
assert_eq!(v.chunks_exact(2).rev().collect::<Vec<_>>(), chunks);
992992
}
993993

994994
#[test]
995995
#[should_panic]
996-
fn test_exact_chunksator_0() {
996+
fn test_chunks_exactator_0() {
997997
let v = &[1, 2, 3, 4];
998-
let _it = v.exact_chunks(0);
998+
let _it = v.chunks_exact(0);
999999
}
10001000

10011001
#[test]
@@ -1235,10 +1235,10 @@ fn test_mut_chunks_0() {
12351235
}
12361236

12371237
#[test]
1238-
fn test_mut_exact_chunks() {
1238+
fn test_mut_chunks_exact() {
12391239
let mut v = [0, 1, 2, 3, 4, 5, 6];
1240-
assert_eq!(v.exact_chunks_mut(2).len(), 3);
1241-
for (i, chunk) in v.exact_chunks_mut(3).enumerate() {
1240+
assert_eq!(v.chunks_exact_mut(2).len(), 3);
1241+
for (i, chunk) in v.chunks_exact_mut(3).enumerate() {
12421242
for x in chunk {
12431243
*x = i as u8;
12441244
}
@@ -1248,9 +1248,9 @@ fn test_mut_exact_chunks() {
12481248
}
12491249

12501250
#[test]
1251-
fn test_mut_exact_chunks_rev() {
1251+
fn test_mut_chunks_exact_rev() {
12521252
let mut v = [0, 1, 2, 3, 4, 5, 6];
1253-
for (i, chunk) in v.exact_chunks_mut(3).rev().enumerate() {
1253+
for (i, chunk) in v.chunks_exact_mut(3).rev().enumerate() {
12541254
for x in chunk {
12551255
*x = i as u8;
12561256
}
@@ -1261,9 +1261,9 @@ fn test_mut_exact_chunks_rev() {
12611261

12621262
#[test]
12631263
#[should_panic]
1264-
fn test_mut_exact_chunks_0() {
1264+
fn test_mut_chunks_exact_0() {
12651265
let mut v = [1, 2, 3, 4];
1266-
let _it = v.exact_chunks_mut(0);
1266+
let _it = v.chunks_exact_mut(0);
12671267
}
12681268

12691269
#[test]

0 commit comments

Comments
 (0)