Skip to content

Commit d595db5

Browse files
committed
Auto merge of #51965 - pietroalbini:rollup, r=pietroalbini
Rollup of 7 pull requests Successful merges: - #51511 (Stabilize Iterator::flatten in 1.29, fixes #48213.) - #51853 (Fix some doc links) - #51890 (Fix inconsequential typo in GlobalAlloc doc example) - #51920 (use literal span for concrete type suggestion) - #51922 (rename the llvm-tools component to llvm-tools-preview and tweak its image) - #51936 (rename rustc's lld to rust-lld) - #51961 (Fix typo in /src/librustc_resolve/lib.rs) Failed merges: r? @ghost
2 parents 6af9f91 + 459b6d5 commit d595db5

File tree

15 files changed

+76
-43
lines changed

15 files changed

+76
-43
lines changed

src/bootstrap/compile.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,11 @@ fn copy_lld_to_sysroot(builder: &Builder,
786786
.join("bin");
787787
t!(fs::create_dir_all(&dst));
788788

789-
let exe = exe("lld", &target);
790-
builder.copy(&lld_install_root.join("bin").join(&exe), &dst.join(&exe));
789+
let src_exe = exe("lld", &target);
790+
let dst_exe = exe("rust-lld", &target);
791+
// we prepend this bin directory to the user PATH when linking Rust binaries. To
792+
// avoid shadowing the system LLD we rename the LLD we provide to `rust-lld`.
793+
builder.copy(&lld_install_root.join("bin").join(&src_exe), &dst.join(&dst_exe));
791794
}
792795

793796
/// Cargo's output path for the standard library in a given stage, compiled

src/bootstrap/dist.rs

+15-10
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,18 @@ impl Step for Rustc {
491491

492492
// Copy over lld if it's there
493493
if builder.config.lld_enabled {
494-
let exe = exe("lld", &compiler.host);
494+
let src_exe = exe("lld", &compiler.host);
495+
let dst_exe = exe("rust-lld", &compiler.host);
495496
let src = builder.sysroot_libdir(compiler, host)
496497
.parent()
497498
.unwrap()
498499
.join("bin")
499-
.join(&exe);
500+
.join(&src_exe);
501+
// for the rationale about this rename check `compile::copy_lld_to_sysroot`
500502
let dst = image.join("lib/rustlib")
501503
.join(&*host)
502504
.join("bin")
503-
.join(&exe);
505+
.join(&dst_exe);
504506
t!(fs::create_dir_all(&dst.parent().unwrap()));
505507
builder.copy(&src, &dst);
506508
}
@@ -1787,15 +1789,18 @@ impl Step for LlvmTools {
17871789
let tmp = tmpdir(builder);
17881790
let image = tmp.join("llvm-tools-image");
17891791
drop(fs::remove_dir_all(&image));
1790-
t!(fs::create_dir_all(&image.join("bin")));
17911792

17921793
// Prepare the image directory
1794+
let bindir = builder
1795+
.llvm_out(target)
1796+
.join("bin");
1797+
let dst = image.join("lib/rustlib")
1798+
.join(target)
1799+
.join("bin");
1800+
t!(fs::create_dir_all(&dst));
17931801
for tool in LLVM_TOOLS {
1794-
let exe = builder
1795-
.llvm_out(target)
1796-
.join("bin")
1797-
.join(exe(tool, &target));
1798-
builder.install(&exe, &image.join("bin"), 0o755);
1802+
let exe = bindir.join(exe(tool, &target));
1803+
builder.install(&exe, &dst, 0o755);
17991804
}
18001805

18011806
// Prepare the overlay
@@ -1818,7 +1823,7 @@ impl Step for LlvmTools {
18181823
.arg("--non-installed-overlay").arg(&overlay)
18191824
.arg(format!("--package-name={}-{}", name, target))
18201825
.arg("--legacy-manifest-dirs=rustlib,cargo")
1821-
.arg("--component-name=llvm-tools");
1826+
.arg("--component-name=llvm-tools-preview");
18221827

18231828

18241829
builder.run(&mut cmd);

src/libcore/future.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ pub trait Future {
4545
///
4646
/// This function returns:
4747
///
48-
/// - `Poll::Pending` if the future is not ready yet
49-
/// - `Poll::Ready(val)` with the result `val` of this future if it finished
50-
/// successfully.
48+
/// - [`Poll::Pending`] if the future is not ready yet
49+
/// - [`Poll::Ready(val)`] with the result `val` of this future if it
50+
/// finished successfully.
5151
///
5252
/// Once a future has finished, clients should not `poll` it again.
5353
///
5454
/// When a future is not ready yet, `poll` returns
55-
/// [`Poll::Pending`](::task::Poll). The future will *also* register the
55+
/// `Poll::Pending`. The future will *also* register the
5656
/// interest of the current task in the value being produced. For example,
5757
/// if the future represents the availability of data on a socket, then the
5858
/// task is recorded so that when data arrives, it is woken up (via
59-
/// [`cx.waker()`](::task::Context::waker)). Once a task has been woken up,
59+
/// [`cx.waker()`]). Once a task has been woken up,
6060
/// it should attempt to `poll` the future again, which may or may not
6161
/// produce a final value.
6262
///
@@ -90,6 +90,10 @@ pub trait Future {
9090
/// then any future calls to `poll` may panic, block forever, or otherwise
9191
/// cause bad behavior. The `Future` trait itself provides no guarantees
9292
/// about the behavior of `poll` after a future has completed.
93+
///
94+
/// [`Poll::Pending`]: ../task/enum.Poll.html#variant.Pending
95+
/// [`Poll::Ready(val)`]: ../task/enum.Poll.html#variant.Ready
96+
/// [`cx.waker()`]: ../task/struct.Context.html#method.waker
9397
fn poll(self: PinMut<Self>, cx: &mut task::Context) -> Poll<Self::Output>;
9498
}
9599

src/libcore/iter/iterator.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1036,8 +1036,6 @@ pub trait Iterator {
10361036
/// Basic usage:
10371037
///
10381038
/// ```
1039-
/// #![feature(iterator_flatten)]
1040-
///
10411039
/// let data = vec![vec![1, 2, 3, 4], vec![5, 6]];
10421040
/// let flattened = data.into_iter().flatten().collect::<Vec<u8>>();
10431041
/// assert_eq!(flattened, &[1, 2, 3, 4, 5, 6]);
@@ -1046,8 +1044,6 @@ pub trait Iterator {
10461044
/// Mapping and then flattening:
10471045
///
10481046
/// ```
1049-
/// #![feature(iterator_flatten)]
1050-
///
10511047
/// let words = ["alpha", "beta", "gamma"];
10521048
///
10531049
/// // chars() returns an iterator
@@ -1074,8 +1070,6 @@ pub trait Iterator {
10741070
/// Flattening once only removes one level of nesting:
10751071
///
10761072
/// ```
1077-
/// #![feature(iterator_flatten)]
1078-
///
10791073
/// let d3 = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];
10801074
///
10811075
/// let d2 = d3.iter().flatten().collect::<Vec<_>>();
@@ -1093,7 +1087,7 @@ pub trait Iterator {
10931087
///
10941088
/// [`flat_map()`]: #method.flat_map
10951089
#[inline]
1096-
#[unstable(feature = "iterator_flatten", issue = "48213")]
1090+
#[stable(feature = "iterator_flatten", since = "1.29")]
10971091
fn flatten(self) -> Flatten<Self>
10981092
where Self: Sized, Self::Item: IntoIterator {
10991093
Flatten { inner: flatten_compat(self) }

src/libcore/iter/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2575,13 +2575,13 @@ impl<I, U, F> FusedIterator for FlatMap<I, U, F>
25752575
/// [`flatten`]: trait.Iterator.html#method.flatten
25762576
/// [`Iterator`]: trait.Iterator.html
25772577
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
2578-
#[unstable(feature = "iterator_flatten", issue = "48213")]
2578+
#[stable(feature = "iterator_flatten", since = "1.29")]
25792579
pub struct Flatten<I: Iterator>
25802580
where I::Item: IntoIterator {
25812581
inner: FlattenCompat<I, <I::Item as IntoIterator>::IntoIter>,
25822582
}
25832583

2584-
#[unstable(feature = "iterator_flatten", issue = "48213")]
2584+
#[stable(feature = "iterator_flatten", since = "1.29")]
25852585
impl<I, U> fmt::Debug for Flatten<I>
25862586
where I: Iterator + fmt::Debug, U: Iterator + fmt::Debug,
25872587
I::Item: IntoIterator<IntoIter = U, Item = U::Item>,
@@ -2591,15 +2591,15 @@ impl<I, U> fmt::Debug for Flatten<I>
25912591
}
25922592
}
25932593

2594-
#[unstable(feature = "iterator_flatten", issue = "48213")]
2594+
#[stable(feature = "iterator_flatten", since = "1.29")]
25952595
impl<I, U> Clone for Flatten<I>
25962596
where I: Iterator + Clone, U: Iterator + Clone,
25972597
I::Item: IntoIterator<IntoIter = U, Item = U::Item>,
25982598
{
25992599
fn clone(&self) -> Self { Flatten { inner: self.inner.clone() } }
26002600
}
26012601

2602-
#[unstable(feature = "iterator_flatten", issue = "48213")]
2602+
#[stable(feature = "iterator_flatten", since = "1.29")]
26032603
impl<I, U> Iterator for Flatten<I>
26042604
where I: Iterator, U: Iterator,
26052605
I::Item: IntoIterator<IntoIter = U, Item = U::Item>
@@ -2627,7 +2627,7 @@ impl<I, U> Iterator for Flatten<I>
26272627
}
26282628
}
26292629

2630-
#[unstable(feature = "iterator_flatten", issue = "48213")]
2630+
#[stable(feature = "iterator_flatten", since = "1.29")]
26312631
impl<I, U> DoubleEndedIterator for Flatten<I>
26322632
where I: DoubleEndedIterator, U: DoubleEndedIterator,
26332633
I::Item: IntoIterator<IntoIter = U, Item = U::Item>
@@ -2650,7 +2650,7 @@ impl<I, U> DoubleEndedIterator for Flatten<I>
26502650
}
26512651
}
26522652

2653-
#[unstable(feature = "iterator_flatten", issue = "48213")]
2653+
#[stable(feature = "iterator_flatten", since = "1.29")]
26542654
impl<I, U> FusedIterator for Flatten<I>
26552655
where I: FusedIterator, U: Iterator,
26562656
I::Item: IntoIterator<IntoIter = U, Item = U::Item> {}

src/libcore/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
#![feature(extern_types)]
9090
#![feature(fundamental)]
9191
#![feature(intrinsics)]
92-
#![feature(iterator_flatten)]
9392
#![feature(lang_items)]
9493
#![feature(link_llvm_intrinsics)]
9594
#![feature(never_type)]

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(flt2dec)]
2424
#![feature(fmt_internals)]
2525
#![feature(hashmap_internals)]
26-
#![feature(iterator_flatten)]
2726
#![feature(pattern)]
2827
#![feature(range_is_empty)]
2928
#![feature(raw)]

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ impl<'a> Resolver<'a> {
27942794
/// A variant of `smart_resolve_path` where you also specify extra
27952795
/// information about where the path came from; this extra info is
27962796
/// sometimes needed for the lint that recommends rewriting
2797-
/// absoluate paths to `crate`, so that it knows how to frame the
2797+
/// absolute paths to `crate`, so that it knows how to frame the
27982798
/// suggestion. If you are just resolving a path like `foo::bar`
27992799
/// that appears...somewhere, though, then you just want
28002800
/// `CrateLint::SimplePath`, which is what `smart_resolve_path`

src/librustc_target/spec/wasm32_unknown_unknown.rs

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ pub fn target() -> Result<Target, String> {
5151
// no dynamic linking, no need for default visibility!
5252
default_hidden_visibility: true,
5353

54+
// we use the LLD shipped with the Rust toolchain by default
55+
linker: Some("rust-lld".to_owned()),
56+
5457
.. Default::default()
5558
};
5659
Ok(Target {

src/librustc_typeck/check/method/suggest.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
245245
"f32"
246246
};
247247
match expr.node {
248-
hir::ExprLit(_) => { // numeric literal
249-
let snippet = tcx.sess.codemap().span_to_snippet(expr.span)
248+
hir::ExprLit(ref lit) => { // numeric literal
249+
let snippet = tcx.sess.codemap().span_to_snippet(lit.span)
250250
.unwrap_or("<numeric literal>".to_string());
251-
// FIXME: use the literal for missing snippet
252251

253-
err.span_suggestion(expr.span,
252+
err.span_suggestion(lit.span,
254253
&format!("you must specify a concrete type for \
255254
this numeric value, like `{}`",
256255
concrete_type),

src/libstd/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
//! ```rust,ignore (demonstrates crates.io usage)
6262
//! extern crate jemallocator;
6363
//!
64-
//! use jemallacator::Jemalloc;
64+
//! use jemallocator::Jemalloc;
6565
//!
6666
//! #[global_allocator]
6767
//! static GLOBAL: Jemalloc = Jemalloc;

src/libstd/error.rs

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ use string;
4949
///
5050
/// [`Result<T, E>`]: ../result/enum.Result.html
5151
/// [`Display`]: ../fmt/trait.Display.html
52+
/// [`Debug`]: ../fmt/trait.Debug.html
5253
/// [`cause`]: trait.Error.html#method.cause
5354
#[stable(feature = "rust1", since = "1.0.0")]
5455
pub trait Error: Debug + Display {

src/test/ui/issue-51874.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2018 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+
let a = (1.0).pow(1.0); //~ ERROR can't call method `pow` on ambiguous numeric type
13+
}

src/test/ui/issue-51874.stderr

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0689]: can't call method `pow` on ambiguous numeric type `{float}`
2+
--> $DIR/issue-51874.rs:12:19
3+
|
4+
LL | let a = (1.0).pow(1.0); //~ ERROR can't call method `pow` on ambiguous numeric type
5+
| ^^^
6+
help: you must specify a concrete type for this numeric value, like `f32`
7+
|
8+
LL | let a = (1.0_f32).pow(1.0); //~ ERROR can't call method `pow` on ambiguous numeric type
9+
| ^^^^^^^
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0689`.

src/tools/build-manifest/src/main.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ impl Builder {
298298
self.package("rls-preview", &mut manifest.pkg, HOSTS);
299299
self.package("rustfmt-preview", &mut manifest.pkg, HOSTS);
300300
self.package("rust-analysis", &mut manifest.pkg, TARGETS);
301-
self.package("llvm-tools", &mut manifest.pkg, TARGETS);
301+
self.package("llvm-tools-preview", &mut manifest.pkg, TARGETS);
302302

303303
let rls_present = manifest.pkg.contains_key("rls-preview");
304304
let rustfmt_present = manifest.pkg.contains_key("rustfmt-preview");
305-
let llvm_tools_present = manifest.pkg.contains_key("llvm-tools");
305+
let llvm_tools_present = manifest.pkg.contains_key("llvm-tools-preview");
306306

307307
if rls_present {
308308
manifest.renames.insert("rls".to_owned(), Rename { to: "rls-preview".to_owned() });
@@ -359,7 +359,7 @@ impl Builder {
359359
}
360360
if llvm_tools_present {
361361
extensions.push(Component {
362-
pkg: "llvm-tools".to_string(),
362+
pkg: "llvm-tools-preview".to_string(),
363363
target: host.to_string(),
364364
});
365365
}
@@ -486,7 +486,7 @@ impl Builder {
486486
&self.rls_version
487487
} else if component == "rustfmt" || component == "rustfmt-preview" {
488488
&self.rustfmt_version
489-
} else if component == "llvm-tools" {
489+
} else if component == "llvm-tools" || component == "llvm-tools-preview" {
490490
&self.llvm_tools_version
491491
} else {
492492
&self.rust_version
@@ -500,7 +500,7 @@ impl Builder {
500500
&self.rls_git_commit_hash
501501
} else if component == "rustfmt" || component == "rustfmt-preview" {
502502
&self.rustfmt_git_commit_hash
503-
} else if component == "llvm-tools" {
503+
} else if component == "llvm-tools" || component == "llvm-tools-preview" {
504504
&self.llvm_tools_git_commit_hash
505505
} else {
506506
&self.rust_git_commit_hash

0 commit comments

Comments
 (0)