Skip to content

Commit 5b96425

Browse files
committed
Auto merge of #59910 - Centril:rollup-yjv7b06, r=Centril
Rollup of 15 pull requests Successful merges: - #59680 (Document the -Z flag to the rustc book) - #59711 (Add back the substring test) - #59806 (compiletest: Improve no_prefer_dynamic docs) - #59809 (Make trait_methods_not_found use a lock) - #59811 (Kill dead code dominator code.) - #59814 (Fix broken links on std::boxed doc page) - #59821 (improve unknown enum variant errors) - #59831 (Remove strange formatting in `Ordering` docs.) - #59836 (std::ops::Div examples: correct nominator to numerator) - #59857 (SGX target: fix cfg(test) build) - #59876 (Update TRPL to use mdbook 0.2) - #59880 (Remove note about transmute for float bitpatterns.) - #59889 (Update diagnostics.rs) - #59891 (Fix the link to sort_by_cached_key) - #59894 (save-analysis: Pull associated type definition using `qpath_def`) Failed merges: r? @ghost
2 parents 876a3bc + 7a8329f commit 5b96425

Some content is hidden

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

41 files changed

+295
-209
lines changed

RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Compatibility Notes
133133
[`num::NonZeroI64`]: https://doc.rust-lang.org/std/num/struct.NonZeroI64.html
134134
[`num::NonZeroI8`]: https://doc.rust-lang.org/std/num/struct.NonZeroI8.html
135135
[`num::NonZeroIsize`]: https://doc.rust-lang.org/std/num/struct.NonZeroIsize.html
136-
[`slice::sort_by_cached_key`]: https://doc.rust-lang.org/std/slice/fn.sort_by_cached_key
136+
[`slice::sort_by_cached_key`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key
137137
[`str::escape_debug`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_debug
138138
[`str::escape_default`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_default
139139
[`str::escape_unicode`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_unicode

src/bootstrap/doc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl Step for TheBook {
277277
builder.ensure(Rustbook {
278278
target,
279279
name: INTERNER.intern_string(name.to_string()),
280-
version: RustbookVersion::MdBook1,
280+
version: RustbookVersion::MdBook2,
281281
});
282282

283283
// building older edition redirects
@@ -286,21 +286,21 @@ impl Step for TheBook {
286286
builder.ensure(Rustbook {
287287
target,
288288
name: INTERNER.intern_string(source_name),
289-
version: RustbookVersion::MdBook1,
289+
version: RustbookVersion::MdBook2,
290290
});
291291

292292
let source_name = format!("{}/second-edition", name);
293293
builder.ensure(Rustbook {
294294
target,
295295
name: INTERNER.intern_string(source_name),
296-
version: RustbookVersion::MdBook1,
296+
version: RustbookVersion::MdBook2,
297297
});
298298

299299
let source_name = format!("{}/2018-edition", name);
300300
builder.ensure(Rustbook {
301301
target,
302302
name: INTERNER.intern_string(source_name),
303-
version: RustbookVersion::MdBook1,
303+
version: RustbookVersion::MdBook2,
304304
});
305305

306306
// build the version info page and CSS

src/doc/rustc/src/command-line-arguments.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ This flag will set which lints should be set to the [deny level](lints/levels.ht
8686

8787
This flag will set which lints should be set to the [forbid level](lints/levels.html#forbid).
8888

89+
## `-Z`: set unstable options
90+
91+
This flag will allow you to set unstable options of rustc. In order to set multiple options,
92+
the -Z flag can be used multiple times. For example: `rustc -Z verbose -Z time`.
93+
Specifying options with -Z is only available on nightly. To view all available options
94+
run: `rustc -Z help`.
95+
8996
## `--cap-lints`: set the most restrictive lint level
9097

9198
This flag lets you 'cap' lints, for more, [see here](lints/levels.html#capping-lints).

src/liballoc/boxed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
//!
6464
//! [dereferencing]: ../../std/ops/trait.Deref.html
6565
//! [`Box`]: struct.Box.html
66+
//! [`Global`]: ../alloc/struct.Global.html
67+
//! [`Layout`]: ../alloc/struct.Layout.html
6668
6769
#![stable(feature = "rust1", since = "1.0.0")]
6870

src/libcore/cmp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> { _field: ::marker::PhantomData<T> }
286286
#[derive(Clone, Copy, PartialEq, Debug, Hash)]
287287
#[stable(feature = "rust1", since = "1.0.0")]
288288
pub enum Ordering {
289-
/// An ordering where a compared value is less [than another].
289+
/// An ordering where a compared value is less than another.
290290
#[stable(feature = "rust1", since = "1.0.0")]
291291
Less = -1,
292-
/// An ordering where a compared value is equal [to another].
292+
/// An ordering where a compared value is equal to another.
293293
#[stable(feature = "rust1", since = "1.0.0")]
294294
Equal = 0,
295-
/// An ordering where a compared value is greater [than another].
295+
/// An ordering where a compared value is greater than another.
296296
#[stable(feature = "rust1", since = "1.0.0")]
297297
Greater = 1,
298298
}

src/libcore/intrinsics.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -737,16 +737,6 @@ extern "rust-intrinsic" {
737737
///
738738
/// There are a few things that `transmute` is really useful for.
739739
///
740-
/// Getting the bitpattern of a floating point type (or, more generally,
741-
/// type punning, when `T` and `U` aren't pointers):
742-
///
743-
/// ```
744-
/// let bitpattern = unsafe {
745-
/// std::mem::transmute::<f32, u32>(1.0)
746-
/// };
747-
/// assert_eq!(bitpattern, 0x3F800000);
748-
/// ```
749-
///
750740
/// Turning a pointer into a function pointer. This is *not* portable to
751741
/// machines where function pointers and data pointers have different sizes.
752742
///

src/libcore/ops/arith.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,21 +220,21 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
220220
/// // derive `Eq` and `PartialEq`.
221221
/// #[derive(Debug, Eq, PartialEq)]
222222
/// struct Rational {
223-
/// nominator: usize,
223+
/// numerator: usize,
224224
/// denominator: usize,
225225
/// }
226226
///
227227
/// impl Rational {
228-
/// fn new(nominator: usize, denominator: usize) -> Self {
228+
/// fn new(numerator: usize, denominator: usize) -> Self {
229229
/// if denominator == 0 {
230230
/// panic!("Zero is an invalid denominator!");
231231
/// }
232232
///
233233
/// // Reduce to lowest terms by dividing by the greatest common
234234
/// // divisor.
235-
/// let gcd = gcd(nominator, denominator);
235+
/// let gcd = gcd(numerator, denominator);
236236
/// Rational {
237-
/// nominator: nominator / gcd,
237+
/// numerator: numerator / gcd,
238238
/// denominator: denominator / gcd,
239239
/// }
240240
/// }
@@ -245,9 +245,9 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
245245
/// type Output = Self;
246246
///
247247
/// fn mul(self, rhs: Self) -> Self {
248-
/// let nominator = self.nominator * rhs.nominator;
248+
/// let numerator = self.numerator * rhs.numerator;
249249
/// let denominator = self.denominator * rhs.denominator;
250-
/// Rational::new(nominator, denominator)
250+
/// Rational::new(numerator, denominator)
251251
/// }
252252
/// }
253253
///
@@ -340,21 +340,21 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
340340
/// // derive `Eq` and `PartialEq`.
341341
/// #[derive(Debug, Eq, PartialEq)]
342342
/// struct Rational {
343-
/// nominator: usize,
343+
/// numerator: usize,
344344
/// denominator: usize,
345345
/// }
346346
///
347347
/// impl Rational {
348-
/// fn new(nominator: usize, denominator: usize) -> Self {
348+
/// fn new(numerator: usize, denominator: usize) -> Self {
349349
/// if denominator == 0 {
350350
/// panic!("Zero is an invalid denominator!");
351351
/// }
352352
///
353353
/// // Reduce to lowest terms by dividing by the greatest common
354354
/// // divisor.
355-
/// let gcd = gcd(nominator, denominator);
355+
/// let gcd = gcd(numerator, denominator);
356356
/// Rational {
357-
/// nominator: nominator / gcd,
357+
/// numerator: numerator / gcd,
358358
/// denominator: denominator / gcd,
359359
/// }
360360
/// }
@@ -365,13 +365,13 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
365365
/// type Output = Self;
366366
///
367367
/// fn div(self, rhs: Self) -> Self::Output {
368-
/// if rhs.nominator == 0 {
368+
/// if rhs.numerator == 0 {
369369
/// panic!("Cannot divide by zero-valued `Rational`!");
370370
/// }
371371
///
372-
/// let nominator = self.nominator * rhs.denominator;
373-
/// let denominator = self.denominator * rhs.nominator;
374-
/// Rational::new(nominator, denominator)
372+
/// let numerator = self.numerator * rhs.denominator;
373+
/// let denominator = self.denominator * rhs.numerator;
374+
/// Rational::new(numerator, denominator)
375375
/// }
376376
/// }
377377
///

src/librustc/session/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub struct Session {
166166
pub driver_lint_caps: FxHashMap<lint::LintId, lint::Level>,
167167

168168
/// `Span`s of trait methods that weren't found to avoid emitting object safety errors
169-
pub trait_methods_not_found: OneThread<RefCell<FxHashSet<Span>>>,
169+
pub trait_methods_not_found: Lock<FxHashSet<Span>>,
170170
}
171171

172172
pub struct PerfStats {
@@ -1236,7 +1236,7 @@ fn build_session_(
12361236
has_global_allocator: Once::new(),
12371237
has_panic_handler: Once::new(),
12381238
driver_lint_caps,
1239-
trait_methods_not_found: OneThread::new(RefCell::new(Default::default())),
1239+
trait_methods_not_found: Lock::new(Default::default()),
12401240
};
12411241

12421242
validate_commandline_args_with_session_available(&sess);

src/librustc_data_structures/graph/dominators/mod.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ use super::super::indexed_vec::{Idx, IndexVec};
88
use super::iterate::reverse_post_order;
99
use super::ControlFlowGraph;
1010

11-
use std::fmt;
12-
1311
#[cfg(test)]
1412
mod test;
1513

@@ -158,48 +156,3 @@ impl<'dom, Node: Idx> Iterator for Iter<'dom, Node> {
158156
}
159157
}
160158
}
161-
162-
pub struct DominatorTree<N: Idx> {
163-
root: N,
164-
children: IndexVec<N, Vec<N>>,
165-
}
166-
167-
impl<Node: Idx> DominatorTree<Node> {
168-
pub fn children(&self, node: Node) -> &[Node] {
169-
&self.children[node]
170-
}
171-
}
172-
173-
impl<Node: Idx> fmt::Debug for DominatorTree<Node> {
174-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
175-
fmt::Debug::fmt(
176-
&DominatorTreeNode {
177-
tree: self,
178-
node: self.root,
179-
},
180-
fmt,
181-
)
182-
}
183-
}
184-
185-
struct DominatorTreeNode<'tree, Node: Idx> {
186-
tree: &'tree DominatorTree<Node>,
187-
node: Node,
188-
}
189-
190-
impl<'tree, Node: Idx> fmt::Debug for DominatorTreeNode<'tree, Node> {
191-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
192-
let subtrees: Vec<_> = self.tree
193-
.children(self.node)
194-
.iter()
195-
.map(|&child| DominatorTreeNode {
196-
tree: self.tree,
197-
node: child,
198-
})
199-
.collect();
200-
fmt.debug_tuple("")
201-
.field(&self.node)
202-
.field(&subtrees)
203-
.finish()
204-
}
205-
}

src/librustc_driver/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn usage(verbose: bool, include_unstable_options: bool) {
744744
}
745745
let message = "Usage: rustc [OPTIONS] INPUT";
746746
let nightly_help = if nightly_options::is_nightly_build() {
747-
"\n -Z help Print internal options for debugging rustc"
747+
"\n -Z help Print unstable compiler options"
748748
} else {
749749
""
750750
};
@@ -892,7 +892,7 @@ Available lint options:
892892
}
893893

894894
fn describe_debug_flags() {
895-
println!("\nAvailable debug options:\n");
895+
println!("\nAvailable options:\n");
896896
print_flag_list("-Z", config::DB_OPTIONS);
897897
}
898898

0 commit comments

Comments
 (0)