Skip to content

Commit a7a60dc

Browse files
committed
Auto merge of #51969 - 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) - #51921 (improve the error message when `#[panic_implementation]` is missing) - #51922 (rename the llvm-tools component to llvm-tools-preview and tweak its image) - #51961 (Fix typo in /src/librustc_resolve/lib.rs) Failed merges: r? @ghost
2 parents a2be769 + 3e95491 commit a7a60dc

File tree

16 files changed

+89
-42
lines changed

16 files changed

+89
-42
lines changed

src/bootstrap/dist.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,15 +1787,18 @@ impl Step for LlvmTools {
17871787
let tmp = tmpdir(builder);
17881788
let image = tmp.join("llvm-tools-image");
17891789
drop(fs::remove_dir_all(&image));
1790-
t!(fs::create_dir_all(&image.join("bin")));
17911790

17921791
// Prepare the image directory
1792+
let bindir = builder
1793+
.llvm_out(target)
1794+
.join("bin");
1795+
let dst = image.join("lib/rustlib")
1796+
.join(target)
1797+
.join("bin");
1798+
t!(fs::create_dir_all(&dst));
17931799
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);
1800+
let exe = bindir.join(exe(tool, &target));
1801+
builder.install(&exe, &dst, 0o755);
17991802
}
18001803

18011804
// Prepare the overlay
@@ -1818,7 +1821,7 @@ impl Step for LlvmTools {
18181821
.arg("--non-installed-overlay").arg(&overlay)
18191822
.arg(format!("--package-name={}-{}", name, target))
18201823
.arg("--legacy-manifest-dirs=rustlib,cargo")
1821-
.arg("--component-name=llvm-tools");
1824+
.arg("--component-name=llvm-tools-preview");
18221825

18231826

18241827
builder.run(&mut cmd);

src/libcore/future.rs

Lines changed: 9 additions & 5 deletions
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

Lines changed: 1 addition & 7 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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/middle/weak_lang_items.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ fn verify<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
112112
if missing.contains(&lang_items::$item) &&
113113
!whitelisted(tcx, lang_items::$item) &&
114114
items.$name().is_none() {
115-
tcx.sess.err(&format!("language item required, but not found: `{}`",
116-
stringify!($name)));
117-
115+
if lang_items::$item == lang_items::PanicImplLangItem {
116+
tcx.sess.err(&format!("`#[panic_implementation]` function required, \
117+
but not found"));
118+
} else {
119+
tcx.sess.err(&format!("language item required, but not found: `{}`",
120+
stringify!($name)));
121+
}
118122
}
119123
)*
120124
}

src/librustc_resolve/lib.rs

Lines changed: 1 addition & 1 deletion
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_typeck/check/method/suggest.rs

Lines changed: 3 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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;

0 commit comments

Comments
 (0)