Skip to content

Commit 598eddf

Browse files
committed
Auto merge of #43454 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 11 pull requests - Successful merges: #43297, #43322, #43342, #43361, #43366, #43374, #43379, #43401, #43421, #43428, #43446 - Failed merges:
2 parents b80e946 + 0bb4291 commit 598eddf

File tree

43 files changed

+275
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+275
-196
lines changed

configure

+4-4
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,8 @@ case "$CFG_RELEASE_CHANNEL" in
560560
*-pc-windows-gnu)
561561
;;
562562
*)
563-
CFG_ENABLE_DEBUGINFO_LINES=1
564-
CFG_ENABLE_DEBUGINFO_ONLY_STD=1
563+
enable_if_not_disabled debuginfo-lines
564+
enable_if_not_disabled debuginfo-only-std
565565
;;
566566
esac
567567

@@ -572,8 +572,8 @@ case "$CFG_RELEASE_CHANNEL" in
572572
*-pc-windows-gnu)
573573
;;
574574
*)
575-
CFG_ENABLE_DEBUGINFO_LINES=1
576-
CFG_ENABLE_DEBUGINFO_ONLY_STD=1
575+
enable_if_not_disabled debuginfo-lines
576+
enable_if_not_disabled debuginfo-only-std
577577
;;
578578
esac
579579
;;

src/doc/unstable-book/src/language-features/lang-items.md

+8
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
194194
}
195195
```
196196

197+
In many cases, you may need to manually link to the `compiler_builtins` crate
198+
when building a `no_std` binary. You may observe this via linker error messages
199+
such as "```undefined reference to `__rust_probestack'```". Using this crate
200+
also requires enabling the library feature `compiler_builtins_lib`. You can read
201+
more about this [here][compiler-builtins-lib].
202+
203+
[compiler-builtins-lib]: library-features/compiler-builtins-lib.html
204+
197205
## More about the language items
198206

199207
The compiler currently makes a few assumptions about symbols which are
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# `compiler_builtins_lib`
2+
3+
The tracking issue for this feature is: None.
4+
5+
------------------------
6+
7+
This feature is required to link to the `compiler_builtins` crate which contains
8+
"compiler intrinsics". Compiler intrinsics are software implementations of basic
9+
operations like multiplication of `u64`s. These intrinsics are only required on
10+
platforms where these operations don't directly map to a hardware instruction.
11+
12+
You should never need to explicitly link to the `compiler_builtins` crate when
13+
building "std" programs as `compiler_builtins` is already in the dependency
14+
graph of `std`. But you may need it when building `no_std` **binary** crates. If
15+
you get a *linker* error like:
16+
17+
``` text
18+
$PWD/src/main.rs:11: undefined reference to `__aeabi_lmul'
19+
$PWD/src/main.rs:11: undefined reference to `__aeabi_uldivmod'
20+
```
21+
22+
That means that you need to link to this crate.
23+
24+
When you link to this crate, make sure it only appears once in your crate
25+
dependency graph. Also, it doesn't matter where in the dependency graph you
26+
place the `compiler_builtins` crate.
27+
28+
<!-- NOTE(ignore) doctests don't support `no_std` binaries -->
29+
30+
``` rust,ignore
31+
#![feature(compiler_builtins_lib)]
32+
#![no_std]
33+
34+
extern crate compiler_builtins;
35+
```

src/liballoc/slice.rs

+18-15
Original file line numberDiff line numberDiff line change
@@ -1252,12 +1252,13 @@ impl<T> [T] {
12521252
///
12531253
/// # Current implementation
12541254
///
1255-
/// The current algorithm is based on Orson Peters' [pattern-defeating quicksort][pdqsort],
1256-
/// which is a quicksort variant designed to be very fast on certain kinds of patterns,
1257-
/// sometimes achieving linear time. It is randomized but deterministic, and falls back to
1258-
/// heapsort on degenerate inputs.
1255+
/// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
1256+
/// which combines the fast average case of randomized quicksort with the fast worst case of
1257+
/// heapsort, while achieving linear time on slices with certain patterns. It uses some
1258+
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
1259+
/// deterministic behavior.
12591260
///
1260-
/// It is generally faster than stable sorting, except in a few special cases, e.g. when the
1261+
/// It is typically faster than stable sorting, except in a few special cases, e.g. when the
12611262
/// slice consists of several concatenated sorted sequences.
12621263
///
12631264
/// # Examples
@@ -1286,12 +1287,13 @@ impl<T> [T] {
12861287
///
12871288
/// # Current implementation
12881289
///
1289-
/// The current algorithm is based on Orson Peters' [pattern-defeating quicksort][pdqsort],
1290-
/// which is a quicksort variant designed to be very fast on certain kinds of patterns,
1291-
/// sometimes achieving linear time. It is randomized but deterministic, and falls back to
1292-
/// heapsort on degenerate inputs.
1290+
/// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
1291+
/// which combines the fast average case of randomized quicksort with the fast worst case of
1292+
/// heapsort, while achieving linear time on slices with certain patterns. It uses some
1293+
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
1294+
/// deterministic behavior.
12931295
///
1294-
/// It is generally faster than stable sorting, except in a few special cases, e.g. when the
1296+
/// It is typically faster than stable sorting, except in a few special cases, e.g. when the
12951297
/// slice consists of several concatenated sorted sequences.
12961298
///
12971299
/// # Examples
@@ -1323,12 +1325,13 @@ impl<T> [T] {
13231325
///
13241326
/// # Current implementation
13251327
///
1326-
/// The current algorithm is based on Orson Peters' [pattern-defeating quicksort][pdqsort],
1327-
/// which is a quicksort variant designed to be very fast on certain kinds of patterns,
1328-
/// sometimes achieving linear time. It is randomized but deterministic, and falls back to
1329-
/// heapsort on degenerate inputs.
1328+
/// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
1329+
/// which combines the fast average case of randomized quicksort with the fast worst case of
1330+
/// heapsort, while achieving linear time on slices with certain patterns. It uses some
1331+
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
1332+
/// deterministic behavior.
13301333
///
1331-
/// It is generally faster than stable sorting, except in a few special cases, e.g. when the
1334+
/// It is typically faster than stable sorting, except in a few special cases, e.g. when the
13321335
/// slice consists of several concatenated sorted sequences.
13331336
///
13341337
/// # Examples

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ macro_rules! generate_pattern_iterators {
847847
internal:
848848
$internal_iterator:ident yielding ($iterty:ty);
849849

850-
// Kind of delgation - either single ended or double ended
850+
// Kind of delegation - either single ended or double ended
851851
delegate $($t:tt)*
852852
} => {
853853
$(#[$forward_iterator_attribute])*

src/libcore/str/pattern.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub enum SearchStep {
8383
/// Note that there might be more than one `Reject` between two `Match`es,
8484
/// there is no requirement for them to be combined into one.
8585
Reject(usize, usize),
86-
/// Expresses that every byte of the haystack has been visted, ending
86+
/// Expresses that every byte of the haystack has been visited, ending
8787
/// the iteration.
8888
Done
8989
}
@@ -101,7 +101,7 @@ pub enum SearchStep {
101101
/// the haystack. This enables consumers of this trait to
102102
/// slice the haystack without additional runtime checks.
103103
pub unsafe trait Searcher<'a> {
104-
/// Getter for the underlaying string to be searched in
104+
/// Getter for the underlying string to be searched in
105105
///
106106
/// Will always return the same `&str`
107107
fn haystack(&self) -> &'a str;
@@ -1153,7 +1153,7 @@ impl TwoWaySearcher {
11531153
// The maximal suffix is a possible critical factorization (u', v') of `arr`.
11541154
//
11551155
// Returns `i` where `i` is the starting index of v', from the back;
1156-
// returns immedately when a period of `known_period` is reached.
1156+
// returns immediately when a period of `known_period` is reached.
11571157
//
11581158
// `order_greater` determines if lexical order is `<` or `>`. Both
11591159
// orders must be computed -- the ordering with the largest `i` gives

src/liblibc

Submodule liblibc updated 62 files

src/librustc/build.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
println!("cargo:rerun-if-changed=build.rs");
13+
println!("cargo:rerun-if-env-changed=CFG_LIBDIR_RELATIVE");
14+
println!("cargo:rerun-if-env-changed=CFG_COMPILER_HOST_TRIPLE");
15+
}

src/librustc/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ not apply to structs.
17081708
representation of enums isn't strictly defined in Rust, and this attribute
17091709
won't work on enums.
17101710
1711-
`#[repr(simd)]` will give a struct consisting of a homogenous series of machine
1711+
`#[repr(simd)]` will give a struct consisting of a homogeneous series of machine
17121712
types (i.e. `u8`, `i32`, etc) a representation that permits vectorization via
17131713
SIMD. This doesn't make much sense for enums since they don't consist of a
17141714
single list of data.

src/librustc/hir/def_id.rs

+4
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ impl DefIndex {
136136
pub fn as_array_index(&self) -> usize {
137137
(self.0 & !DEF_INDEX_HI_START.0) as usize
138138
}
139+
140+
pub fn from_array_index(i: usize, address_space: DefIndexAddressSpace) -> DefIndex {
141+
DefIndex::new(address_space.start() + i)
142+
}
139143
}
140144

141145
/// The start of the "high" range of DefIndexes.

0 commit comments

Comments
 (0)