Skip to content

Commit 247a018

Browse files
committed
Auto merge of #42738 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 7 pull requests - Successful merges: #42695, #42714, #42720, #42723, #42730, #42731, #42734 - Failed merges: #42722
2 parents 28cc0c5 + 3bed3bd commit 247a018

File tree

20 files changed

+323
-39
lines changed

20 files changed

+323
-39
lines changed

src/Cargo.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/dist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ pub fn rust_src(build: &Build) {
550550
"src/liballoc_jemalloc",
551551
"src/liballoc_system",
552552
"src/libbacktrace",
553+
"src/libcollections",
553554
"src/libcompiler_builtins",
554555
"src/libcore",
555556
"src/liblibc",

src/bootstrap/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub fn std(build: &Build, stage: u32, target: &str) {
254254
// for which docs must be built.
255255
if !build.config.compiler_docs {
256256
cargo.arg("--no-deps");
257-
for krate in &["alloc", "core", "std", "std_unicode"] {
257+
for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
258258
cargo.arg("-p").arg(krate);
259259
// Create all crate output directories first to make sure rustdoc uses
260260
// relative links.

src/bootstrap/flags.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,18 @@ Arguments:
242242
let cwd = t!(env::current_dir());
243243
let paths = matches.free[1..].iter().map(|p| cwd.join(p)).collect::<Vec<_>>();
244244

245+
let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| {
246+
if fs::metadata("config.toml").is_ok() {
247+
Some(PathBuf::from("config.toml"))
248+
} else {
249+
None
250+
}
251+
});
245252

246253
// All subcommands can have an optional "Available paths" section
247254
if matches.opt_present("verbose") {
248255
let flags = Flags::parse(&["build".to_string()]);
249-
let mut config = Config::default();
256+
let mut config = Config::parse(&flags.build, cfg_file.clone());
250257
config.build = flags.build.clone();
251258
let mut build = Build::new(flags, config);
252259
metadata::build(&mut build);
@@ -307,14 +314,6 @@ Arguments:
307314
};
308315

309316

310-
let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| {
311-
if fs::metadata("config.toml").is_ok() {
312-
Some(PathBuf::from("config.toml"))
313-
} else {
314-
None
315-
}
316-
});
317-
318317
let mut stage = matches.opt_str("stage").map(|j| j.parse().unwrap());
319318

320319
if matches.opt_present("incremental") {

src/doc/grammar.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,19 @@ token : simple_token | ident | literal | symbol | whitespace token ;
154154

155155
<p id="keyword-table-marker"></p>
156156

157-
| | | | | |
158-
|----------|----------|----------|----------|---------|
159-
| abstract | alignof | as | become | box |
160-
| break | const | continue | crate | do |
161-
| else | enum | extern | false | final |
162-
| fn | for | if | impl | in |
163-
| let | loop | macro | match | mod |
164-
| move | mut | offsetof | override | priv |
165-
| proc | pub | pure | ref | return |
166-
| Self | self | sizeof | static | struct |
167-
| super | trait | true | type | typeof |
168-
| unsafe | unsized | use | virtual | where |
169-
| while | yield | | | |
157+
| | | | | |
158+
|----------|----------|----------|----------|----------|
159+
| _ | abstract | alignof | as | become |
160+
| box | break | const | continue | crate |
161+
| do | else | enum | extern | false |
162+
| final | fn | for | if | impl |
163+
| in | let | loop | macro | match |
164+
| mod | move | mut | offsetof | override |
165+
| priv | proc | pub | pure | ref |
166+
| return | Self | self | sizeof | static |
167+
| struct | super | trait | true | type |
168+
| typeof | unsafe | unsized | use | virtual |
169+
| where | while | yield | | |
170170

171171

172172
Each of these keywords has special meaning in its grammar, and all of them are

src/doc/unstable-book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
- [char_escape_debug](library-features/char-escape-debug.md)
109109
- [coerce_unsized](library-features/coerce-unsized.md)
110110
- [collection_placement](library-features/collection-placement.md)
111+
- [collections](library-features/collections.md)
111112
- [collections_range](library-features/collections-range.md)
112113
- [command_envs](library-features/command-envs.md)
113114
- [compiler_builtins_lib](library-features/compiler-builtins-lib.md)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# `collections`
2+
3+
This feature is internal to the Rust compiler and is not intended for general use.
4+
5+
------------------------

src/libcollections/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
authors = ["The Rust Project Developers"]
3+
name = "collections"
4+
version = "0.0.0"
5+
6+
[lib]
7+
name = "collections"
8+
path = "lib.rs"
9+
10+
[dependencies]
11+
alloc = { path = "../liballoc" }
12+
core = { path = "../libcore" }

src/libcollections/lib.rs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
#![crate_name = "collections"]
12+
#![crate_type = "rlib"]
13+
#![allow(unused_attributes)]
14+
#![unstable(feature = "collections",
15+
reason = "this library is unlikely to be stabilized in its current \
16+
form or name",
17+
issue = "27783")]
18+
#![rustc_deprecated(since = "1.20.0",
19+
reason = "collections moved to `alloc`")]
20+
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
21+
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
22+
html_root_url = "https://doc.rust-lang.org/nightly/",
23+
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
24+
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
25+
#![no_std]
26+
#![needs_allocator]
27+
#![deny(warnings)]
28+
29+
#![feature(alloc)]
30+
#![feature(collections_range)]
31+
#![feature(macro_reexport)]
32+
#![feature(needs_allocator)]
33+
#![feature(staged_api)]
34+
35+
//! Collection types
36+
//!
37+
//! See [`std::collections`](../std/collections/index.html) for a detailed
38+
//! discussion of collections in Rust.
39+
40+
#[macro_reexport(vec, format)]
41+
extern crate alloc;
42+
43+
pub use alloc::Bound;
44+
45+
pub use alloc::binary_heap;
46+
pub use alloc::borrow;
47+
pub use alloc::fmt;
48+
pub use alloc::linked_list;
49+
pub use alloc::range;
50+
pub use alloc::slice;
51+
pub use alloc::str;
52+
pub use alloc::string;
53+
pub use alloc::vec;
54+
pub use alloc::vec_deque;
55+
56+
pub use alloc::btree_map;
57+
pub use alloc::btree_set;
58+
59+
#[doc(no_inline)]
60+
pub use alloc::binary_heap::BinaryHeap;
61+
#[doc(no_inline)]
62+
pub use alloc::btree_map::BTreeMap;
63+
#[doc(no_inline)]
64+
pub use alloc::btree_set::BTreeSet;
65+
#[doc(no_inline)]
66+
pub use alloc::linked_list::LinkedList;
67+
#[doc(no_inline)]
68+
pub use alloc::vec_deque::VecDeque;
69+
#[doc(no_inline)]
70+
pub use alloc::string::String;
71+
#[doc(no_inline)]
72+
pub use alloc::vec::Vec;

src/libcore/str/pattern.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,10 @@ impl<'a, 'b> StrSearcher<'a, 'b> {
618618
}
619619

620620
unsafe impl<'a, 'b> Searcher<'a> for StrSearcher<'a, 'b> {
621-
fn haystack(&self) -> &'a str { self.haystack }
621+
#[inline]
622+
fn haystack(&self) -> &'a str {
623+
self.haystack
624+
}
622625

623626
#[inline]
624627
fn next(&mut self) -> SearchStep {

0 commit comments

Comments
 (0)