Skip to content

Commit c13114d

Browse files
committed
Auto merge of #60311 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports Cherry-picked: * #59886: musl: do not compress debug section * #59891: Fix the link to sort_by_cached_key * #59911: Revert "compile crates under test w/ -Zemit-stack-sizes" * #59978: rustdoc: Remove default keyword from re-exported trait methods * #59989: Fix links to Atomic* in RELEASES.md * #60186: Temporarily accept [i|u][32|size] suffixes on a tuple index and warn * #60309: Add 1.34.1 release notes Rolled up: * #60273: [beta] bootstrap; remove redundant imports. r? @ghost
2 parents 2bc1d40 + e793a2f commit c13114d

File tree

11 files changed

+124
-65
lines changed

11 files changed

+124
-65
lines changed

RELEASES.md

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version 1.34.1 (2019-04-25)
2+
===========================
3+
4+
* [Fix false positives for the `redundant_closure` Clippy lint][clippy/3821]
5+
* [Fix false positives for the `missing_const_for_fn` Clippy lint][clippy/3844]
6+
* [Fix Clippy panic when checking some macros][clippy/3805]
7+
8+
[clippy/3821]: https://github.com/rust-lang/rust-clippy/pull/3821
9+
[clippy/3844]: https://github.com/rust-lang/rust-clippy/pull/3844
10+
[clippy/3805]: https://github.com/rust-lang/rust-clippy/pull/3805
11+
112
Version 1.34.0 (2019-04-11)
213
==========================
314

@@ -113,15 +124,15 @@ Compatibility Notes
113124
[56470]: https://github.com/rust-lang/rust/pull/56470/
114125
[cargo/6654]: https://github.com/rust-lang/cargo/pull/6654/
115126
[`Any::type_id`]: https://doc.rust-lang.org/std/any/trait.Any.html#tymethod.type_id
116-
[`Error::type_id`]: https://doc.rust-lang.org/std/error/trait.Error.html#tymethod.type_id
117-
[`atomic::AtomicI16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI16.html
118-
[`atomic::AtomicI32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI32.html
119-
[`atomic::AtomicI64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI64.html
120-
[`atomic::AtomicI8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI8.html
121-
[`atomic::AtomicU16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU16.html
122-
[`atomic::AtomicU32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU32.html
123-
[`atomic::AtomicU64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU64.html
124-
[`atomic::AtomicU8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU8.html
127+
[`Error::type_id`]: https://doc.rust-lang.org/std/error/trait.Error.html#method.type_id
128+
[`atomic::AtomicI16`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicI16.html
129+
[`atomic::AtomicI32`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicI32.html
130+
[`atomic::AtomicI64`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicI64.html
131+
[`atomic::AtomicI8`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicI8.html
132+
[`atomic::AtomicU16`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU16.html
133+
[`atomic::AtomicU32`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU32.html
134+
[`atomic::AtomicU64`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU64.html
135+
[`atomic::AtomicU8`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU8.html
125136
[`convert::Infallible`]: https://doc.rust-lang.org/std/convert/enum.Infallible.html
126137
[`convert::TryFrom`]: https://doc.rust-lang.org/std/convert/trait.TryFrom.html
127138
[`convert::TryInto`]: https://doc.rust-lang.org/std/convert/trait.TryInto.html
@@ -133,7 +144,7 @@ Compatibility Notes
133144
[`num::NonZeroI64`]: https://doc.rust-lang.org/std/num/struct.NonZeroI64.html
134145
[`num::NonZeroI8`]: https://doc.rust-lang.org/std/num/struct.NonZeroI8.html
135146
[`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
147+
[`slice::sort_by_cached_key`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key
137148
[`str::escape_debug`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_debug
138149
[`str::escape_default`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_default
139150
[`str::escape_unicode`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_unicode

src/bootstrap/bin/rustc.rs

-27
Original file line numberDiff line numberDiff line change
@@ -187,33 +187,6 @@ fn main() {
187187
cmd.arg("-C").arg(format!("debug-assertions={}", debug_assertions));
188188
}
189189

190-
// Build all crates in the `std` facade with `-Z emit-stack-sizes` to add stack usage
191-
// information.
192-
//
193-
// When you use this `-Z` flag with Cargo you get stack usage information on all crates
194-
// compiled from source, and when you are using LTO you also get information on pre-compiled
195-
// crates like `core` and `std`, even if they were not compiled with `-Z emit-stack-sizes`.
196-
// However, there's an exception: `compiler_builtins`. This crate is special and doesn't
197-
// participate in LTO because it's always linked as a separate object file. For this reason
198-
// it's impossible to get stack usage information about `compiler-builtins` using
199-
// `RUSTFLAGS` + Cargo, or `cargo rustc`.
200-
//
201-
// To make the stack usage information of all crates under the `std` facade available to
202-
// Cargo based stack usage analysis tools, in both LTO and non-LTO mode, we compile them
203-
// with the `-Z emit-stack-sizes` flag. The `RUSTC_EMIT_STACK_SIZES` var helps us apply this
204-
// flag only to the crates in the `std` facade. The `-Z` flag is known to currently work
205-
// with targets that produce ELF files so we limit its use flag to those targets.
206-
//
207-
// NOTE(japaric) if this ever causes problem with an LLVM upgrade or any PR feel free to
208-
// remove it or comment it out
209-
if env::var_os("RUSTC_EMIT_STACK_SIZES").is_some()
210-
&& (target.contains("-linux-")
211-
|| target.contains("-none-eabi")
212-
|| target.ends_with("-none-elf"))
213-
{
214-
cmd.arg("-Zemit-stack-sizes");
215-
}
216-
217190
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
218191
cmd.arg("-C").arg(format!("codegen-units={}", s));
219192
}

src/bootstrap/compile.rs

-4
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ impl Step for Std {
9797
let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage));
9898
builder.info(&format!("Building stage{} std artifacts ({} -> {})", compiler.stage,
9999
&compiler.host, target));
100-
// compile with `-Z emit-stack-sizes`; see bootstrap/src/rustc.rs for more details
101-
cargo.env("RUSTC_EMIT_STACK_SIZES", "1");
102100
run_cargo(builder,
103101
&mut cargo,
104102
&libstd_stamp(builder, compiler, target),
@@ -397,8 +395,6 @@ impl Step for Test {
397395
let _folder = builder.fold_output(|| format!("stage{}-test", compiler.stage));
398396
builder.info(&format!("Building stage{} test artifacts ({} -> {})", compiler.stage,
399397
&compiler.host, target));
400-
// compile with `-Z emit-stack-sizes`; see bootstrap/src/rustc.rs for more details
401-
cargo.env("RUSTC_EMIT_STACK_SIZES", "1");
402398
run_cargo(builder,
403399
&mut cargo,
404400
&libtest_stamp(builder, compiler, target),

src/bootstrap/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,6 @@ impl Build {
11251125
/// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be
11261126
/// done. The file is updated immediately after this function completes.
11271127
pub fn save_toolstate(&self, tool: &str, state: ToolState) {
1128-
use std::io::{Seek, SeekFrom};
1129-
11301128
if let Some(ref path) = self.config.save_toolstates {
11311129
let mut file = t!(fs::OpenOptions::new()
11321130
.create(true)

src/ci/docker/dist-x86_64-musl/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ WORKDIR /build/
2121

2222
COPY scripts/musl-toolchain.sh /build/
2323
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
24-
RUN CFLAGS="-Wa,-mrelax-relocations=no" \
25-
CXXFLAGS="-Wa,-mrelax-relocations=no" \
24+
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
25+
CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
2626
bash musl-toolchain.sh x86_64 && rm -rf build
2727

2828
COPY scripts/sccache.sh /scripts/
@@ -38,7 +38,9 @@ ENV RUST_CONFIGURE_ARGS \
3838
# way to produce "super compatible" binaries.
3939
#
4040
# See: https://github.com/rust-lang/rust/issues/34978
41-
ENV CFLAGS_x86_64_unknown_linux_musl=-Wa,-mrelax-relocations=no
41+
# And: https://github.com/rust-lang/rust/issues/59411
42+
ENV CFLAGS_x86_64_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none \
43+
-Wl,--compress-debug-sections=none"
4244

4345
ENV HOSTS=x86_64-unknown-linux-musl \
4446
CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \

src/librustdoc/clean/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2325,6 +2325,10 @@ impl<'tcx> Clean<Item> for ty::AssociatedItem {
23252325
} else {
23262326
hir::Constness::NotConst
23272327
};
2328+
let defaultness = match self.container {
2329+
ty::ImplContainer(_) => Some(self.defaultness),
2330+
ty::TraitContainer(_) => None,
2331+
};
23282332
MethodItem(Method {
23292333
generics,
23302334
decl,
@@ -2334,7 +2338,7 @@ impl<'tcx> Clean<Item> for ty::AssociatedItem {
23342338
constness,
23352339
asyncness: hir::IsAsync::NotAsync,
23362340
},
2337-
defaultness: Some(self.defaultness),
2341+
defaultness,
23382342
all_types,
23392343
ret_types,
23402344
})

src/libsyntax/parse/parser.rs

+31-3
Original file line numberDiff line numberDiff line change
@@ -1119,9 +1119,34 @@ impl<'a> Parser<'a> {
11191119
if text.is_empty() {
11201120
self.span_bug(sp, "found empty literal suffix in Some")
11211121
}
1122-
self.struct_span_err(sp, &format!("suffixes on {} are invalid", kind))
1123-
.span_label(sp, format!("invalid suffix `{}`", text))
1124-
.emit();
1122+
let mut err = if kind == "a tuple index" &&
1123+
["i32", "u32", "isize", "usize"].contains(&text.to_string().as_str())
1124+
{
1125+
// #59553: warn instead of reject out of hand to allow the fix to percolate
1126+
// through the ecosystem when people fix their macros
1127+
let mut err = self.struct_span_warn(
1128+
sp,
1129+
&format!("suffixes on {} are invalid", kind),
1130+
);
1131+
err.note(&format!(
1132+
"`{}` is *temporarily* accepted on tuple index fields as it was \
1133+
incorrectly accepted on stable for a few releases",
1134+
text,
1135+
));
1136+
err.help(
1137+
"on proc macros, you'll want to use `syn::Index::from` or \
1138+
`proc_macro::Literal::*_unsuffixed` for code that will desugar \
1139+
to tuple field access",
1140+
);
1141+
err.note(
1142+
"for more context, see https://github.com/rust-lang/rust/issues/60210",
1143+
);
1144+
err
1145+
} else {
1146+
self.struct_span_err(sp, &format!("suffixes on {} are invalid", kind))
1147+
};
1148+
err.span_label(sp, format!("invalid suffix `{}`", text));
1149+
err.emit();
11251150
}
11261151
}
11271152
}
@@ -1429,6 +1454,9 @@ impl<'a> Parser<'a> {
14291454
fn struct_span_err<S: Into<MultiSpan>>(&self, sp: S, m: &str) -> DiagnosticBuilder<'a> {
14301455
self.sess.span_diagnostic.struct_span_err(sp, m)
14311456
}
1457+
fn struct_span_warn<S: Into<MultiSpan>>(&self, sp: S, m: &str) -> DiagnosticBuilder<'a> {
1458+
self.sess.span_diagnostic.struct_span_warn(sp, m)
1459+
}
14321460
crate fn span_bug<S: Into<MultiSpan>>(&self, sp: S, m: &str) -> ! {
14331461
self.sess.span_diagnostic.span_bug(sp, m)
14341462
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#![feature(specialization)]
2+
3+
// @has default_trait_method/trait.Item.html
4+
// @has - '//*[@id="tymethod.foo"]' 'fn foo()'
5+
// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()'
6+
// @has - '//*[@id="tymethod.bar"]' 'fn bar()'
7+
// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()'
8+
// @has - '//*[@id="method.baz"]' 'fn baz()'
9+
// @!has - '//*[@id="method.baz"]' 'default fn baz()'
10+
pub trait Item {
11+
fn foo();
12+
fn bar();
13+
fn baz() {}
14+
}
15+
16+
// @has default_trait_method/struct.Foo.html
17+
// @has - '//*[@id="method.foo"]' 'default fn foo()'
18+
// @has - '//*[@id="method.bar"]' 'fn bar()'
19+
// @!has - '//*[@id="method.bar"]' 'default fn bar()'
20+
// @has - '//*[@id="method.baz"]' 'fn baz()'
21+
// @!has - '//*[@id="method.baz"]' 'default fn baz()'
22+
pub struct Foo;
23+
impl Item for Foo {
24+
default fn foo() {}
25+
fn bar() {}
26+
}

src/test/rustdoc/default_trait_method.rs

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![feature(specialization)]
2+
3+
#![crate_name = "foo"]
4+
5+
pub trait Item {
6+
fn foo();
7+
fn bar();
8+
fn baz() {}
9+
}
10+
11+
pub struct Foo;
12+
13+
impl Item for Foo {
14+
default fn foo() {}
15+
fn bar() {}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// aux-build:default-trait-method.rs
2+
3+
extern crate foo;
4+
5+
// @has default_trait_method/trait.Item.html
6+
// @has - '//*[@id="tymethod.foo"]' 'fn foo()'
7+
// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()'
8+
// @has - '//*[@id="tymethod.bar"]' 'fn bar()'
9+
// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()'
10+
// @has - '//*[@id="method.baz"]' 'fn baz()'
11+
// @!has - '//*[@id="method.baz"]' 'default fn baz()'
12+
pub use foo::Item;
13+
14+
// @has default_trait_method/struct.Foo.html
15+
// @has - '//*[@id="method.foo"]' 'default fn foo()'
16+
// @has - '//*[@id="method.bar"]' 'fn bar()'
17+
// @!has - '//*[@id="method.bar"]' 'default fn bar()'
18+
// @has - '//*[@id="method.baz"]' 'fn baz()'
19+
// @!has - '//*[@id="method.baz"]' 'default fn baz()'
20+
pub use foo::Foo;

0 commit comments

Comments
 (0)