Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #72112

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6b96fb7
Pointer printing: do not print 0 offset
RalfJung May 1, 2020
6f7e9a8
Add strikethrough support to rustdoc
mibac138 May 5, 2020
abbc736
Add emoji for deprecated messages
GuillaumeGomez May 8, 2020
9d83108
Add test for deprecated emoji
GuillaumeGomez May 8, 2020
bbda107
Add test for strikethrough in rustdoc
mibac138 May 8, 2020
54b7d45
Use CDN for ci-caches on download
Mark-Simulacrum May 8, 2020
0db2aec
display `ConstKind::Param`
lcnr May 9, 2020
0ceacd0
doc: minus (U+2212) instead of dash (U+002D) for negative infinity
tspiteri May 10, 2020
c82103c
use min_specialization for some rustc crates where it requires no cha…
RalfJung May 9, 2020
0aaff14
Improve E0571 wording
GuillaumeGomez May 10, 2020
62116c3
Emit a warning when optimization fuel runs out
jonas-schievink May 9, 2020
806f09c
Clean up E0579 explanation
GuillaumeGomez May 11, 2020
9a4e718
Configure cache domain for GHA
Mark-Simulacrum May 11, 2020
bb8d391
Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obk
Dylan-DPC May 11, 2020
90c1815
Rollup merge of #71928 - mibac138:strikethrough, r=GuillaumeGomez
Dylan-DPC May 11, 2020
eeec611
Rollup merge of #72014 - GuillaumeGomez:deprecated-emoji, r=kinnison,…
Dylan-DPC May 11, 2020
8cc7d5d
Rollup merge of #72027 - Mark-Simulacrum:ci-caches, r=pietroalbini
Dylan-DPC May 11, 2020
d2e24f4
Rollup merge of #72044 - RalfJung:min-spec, r=matthewjasper
Dylan-DPC May 11, 2020
d58d31e
Rollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morse
Dylan-DPC May 11, 2020
c29dc3e
Rollup merge of #72067 - jonas-schievink:fuel-warn, r=varkor
Dylan-DPC May 11, 2020
bdb0179
Rollup merge of #72072 - tspiteri:minus-inf, r=Dylan-DPC
Dylan-DPC May 11, 2020
46eb9e0
Rollup merge of #72077 - GuillaumeGomez:cleanup-E0571, r=Dylan-DPC
Dylan-DPC May 11, 2020
ea603f8
Rollup merge of #72107 - GuillaumeGomez:cleanup-e0579, r=Dylan-DPC
Dylan-DPC May 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
TOOLSTATE_REPO: "https:/pietroalbini/rust-toolstate"
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'pull_request'"
strategy:
matrix:
Expand Down Expand Up @@ -146,6 +147,7 @@ jobs:
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
strategy:
matrix:
Expand Down Expand Up @@ -255,6 +257,7 @@ jobs:
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
strategy:
matrix:
Expand Down Expand Up @@ -606,6 +609,7 @@ jobs:
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'"
steps:
- name: checkout the source code
Expand Down
10 changes: 6 additions & 4 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ dist=$objdir/build/dist

source "$ci_dir/shared.sh"

CACHE_DOMAIN="${CACHE_DOMAIN:-ci-caches.rust-lang.org}"

if [ -f "$docker_dir/$image/Dockerfile" ]; then
if [ "$CI" != "" ]; then
hash_key=/tmp/.docker-hash-key.txt
Expand All @@ -38,9 +40,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
cksum=$(sha512sum $hash_key | \
awk '{print $1}')

s3url="s3://$SCCACHE_BUCKET/docker/$cksum"
url="https://$SCCACHE_BUCKET.s3.amazonaws.com/docker/$cksum"
upload="aws s3 cp - $s3url"
url="https://$CACHE_DOMAIN/docker/$cksum"

echo "Attempting to download $url"
rm -f /tmp/rustci_docker_cache
Expand All @@ -65,7 +65,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
-f "$dockerfile" \
"$context"

if [ "$upload" != "" ]; then
if [ "$CI" != "" ]; then
s3url="s3://$SCCACHE_BUCKET/docker/$cksum"
upload="aws s3 cp - $s3url"
digest=$(docker inspect rust-ci --format '{{.Id}}')
echo "Built container $digest"
if ! grep -q "$digest" <(echo "$loaded_images"); then
Expand Down
2 changes: 2 additions & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ x--expand-yaml-anchors--remove:
- &public-variables
SCCACHE_BUCKET: rust-lang-gha-caches
TOOLSTATE_REPO: https:/pietroalbini/rust-toolstate
CACHE_DOMAIN: ci-caches-gha.rust-lang.org

- &prod-variables
SCCACHE_BUCKET: rust-lang-gha-caches
Expand All @@ -51,6 +52,7 @@ x--expand-yaml-anchors--remove:
# (caches, artifacts...).
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org

- &base-job
env: {}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl f32 {
/// Infinity (∞).
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
pub const INFINITY: f32 = 1.0_f32 / 0.0_f32;
/// Negative infinity (-∞).
/// Negative infinity (∞).
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
pub const NEG_INFINITY: f32 = -1.0_f32 / 0.0_f32;

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl f64 {
/// Infinity (∞).
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
pub const INFINITY: f64 = 1.0_f64 / 0.0_f64;
/// Negative infinity (-∞).
/// Negative infinity (∞).
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
pub const NEG_INFINITY: f64 = -1.0_f64 / 0.0_f64;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_lowering/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#![feature(array_value_iter)]
#![feature(crate_visibility_modifier)]
#![feature(marker_trait_attr)]
#![feature(specialization)]
#![feature(specialization)] // FIXME: min_specialization does not work
#![feature(or_patterns)]
#![recursion_limit = "256"]

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![feature(generators)]
#![feature(generator_trait)]
#![feature(fn_traits)]
#![feature(specialization)]
#![feature(min_specialization)]
#![feature(optin_builtin_traits)]
#![feature(nll)]
#![feature(allow_internal_unstable)]
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_error_codes/error_codes/E0571.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Example of erroneous code:
# fn satisfied(n: usize) -> bool { n % 23 == 0 }
let result = while true {
if satisfied(i) {
break 2*i; // error: `break` with value from a `while` loop
break 2 * i; // error: `break` with value from a `while` loop
}
i += 1;
};
Expand All @@ -22,9 +22,9 @@ Make sure `break value;` statements only occur in `loop` loops:
```
# let mut i = 1;
# fn satisfied(n: usize) -> bool { n % 23 == 0 }
let result = loop { // ok!
let result = loop { // This is now a "loop" loop.
if satisfied(i) {
break 2*i;
break 2 * i; // ok!
}
i += 1;
};
Expand Down
10 changes: 6 additions & 4 deletions src/librustc_error_codes/error_codes/E0579.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
When matching against an exclusive range, the compiler verifies that the range
is non-empty. Exclusive range patterns include the start point but not the end
point, so this is equivalent to requiring the start of the range to be less
than the end of the range.
A lower range wasn't less than the upper range.

Erroneous code example:

Expand All @@ -17,3 +14,8 @@ fn main() {
}
}
```

When matching against an exclusive range, the compiler verifies that the range
is non-empty. Exclusive range patterns include the start point but not the end
point, so this is equivalent to requiring the start of the range to be less
than the end of the range.
2 changes: 1 addition & 1 deletion src/librustc_hir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#![feature(const_panic)]
#![feature(in_band_lifetimes)]
#![feature(or_patterns)]
#![feature(specialization)]
#![feature(min_specialization)]
#![recursion_limit = "256"]

#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![feature(nll)]
#![feature(or_patterns)]
#![feature(proc_macro_internals)]
#![feature(specialization)]
#![feature(specialization)] // FIXME: min_specialization ICEs
#![feature(stmt_expr_attributes)]
#![recursion_limit = "256"]

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_middle/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#![feature(option_expect_none)]
#![feature(or_patterns)]
#![feature(range_is_empty)]
#![feature(specialization)]
#![feature(specialization)] // FIXME: min_specialization does not work
#![feature(track_caller)]
#![feature(trusted_len)]
#![feature(vec_remove_item)]
Expand Down
31 changes: 21 additions & 10 deletions src/librustc_middle/mir/interpret/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,38 @@ pub struct Pointer<Tag = ()> {

static_assert_size!(Pointer, 16);

/// Print the address of a pointer (without the tag)
fn print_ptr_addr<Tag, Id: fmt::Debug>(
ptr: &Pointer<Tag, Id>,
f: &mut fmt::Formatter<'_>,
) -> fmt::Result {
// Forward `alternate` flag to `alloc_id` printing.
if f.alternate() {
write!(f, "{:#?}", ptr.alloc_id)?;
} else {
write!(f, "{:?}", ptr.alloc_id)?;
}
// Print offset only if it is non-zero.
if ptr.offset.bytes() > 0 {
write!(f, "+0x{:x}", ptr.offset.bytes())?;
}
Ok(())
}

// We want the `Debug` output to be readable as it is used by `derive(Debug)` for
// all the Miri types.
// We have to use `Debug` output for the tag, because `()` does not implement
// `Display` so we cannot specialize that.
impl<Tag: fmt::Debug> fmt::Debug for Pointer<Tag> {
default fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if f.alternate() {
write!(f, "{:#?}+0x{:x}[{:?}]", self.alloc_id, self.offset.bytes(), self.tag)
} else {
write!(f, "{:?}+0x{:x}[{:?}]", self.alloc_id, self.offset.bytes(), self.tag)
}
print_ptr_addr(self, f)?;
write!(f, "[{:?}]", self.tag)
}
}
// Specialization for no tag
impl fmt::Debug for Pointer<()> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if f.alternate() {
write!(f, "{:#?}+0x{:x}", self.alloc_id, self.offset.bytes())
} else {
write!(f, "{:?}+0x{:x}", self.alloc_id, self.offset.bytes())
}
print_ptr_addr(self, f)
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/librustc_middle/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,14 @@ pub trait PrettyPrinter<'tcx>:
if self.tcx().sess.verbose() {
p!(write("{:?}", sz));
} else if let ty::ConstKind::Unevaluated(..) = sz.val {
// do not try to evaluate unevaluated constants. If we are const evaluating an
// Do not try to evaluate unevaluated constants. If we are const evaluating an
// array length anon const, rustc will (with debug assertions) print the
// constant's path. Which will end up here again.
p!(write("_"));
} else if let Some(n) = sz.val.try_to_bits(self.tcx().data_layout.pointer_size) {
p!(write("{}", n));
} else if let ty::ConstKind::Param(param) = sz.val {
p!(write("{}", param));
} else {
p!(write("_"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Rust MIR: a lowered representation of Rust.
#![feature(exhaustive_patterns)]
#![feature(iter_order_by)]
#![feature(never_type)]
#![feature(specialization)]
#![feature(min_specialization)]
#![feature(trusted_len)]
#![feature(try_blocks)]
#![feature(associated_type_bounds)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_query_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![feature(const_panic)]
#![feature(core_intrinsics)]
#![feature(hash_raw_entry)]
#![feature(specialization)]
#![feature(specialization)] // FIXME: min_specialization rejects `default const`
#![feature(stmt_expr_attributes)]
#![feature(vec_remove_item)]

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_session/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ impl Session {
let mut fuel = self.optimization_fuel.lock();
ret = fuel.remaining != 0;
if fuel.remaining == 0 && !fuel.out_of_fuel {
eprintln!("optimization-fuel-exhausted: {}", msg());
self.warn(&format!("optimization-fuel-exhausted: {}", msg()));
fuel.out_of_fuel = true;
} else if fuel.remaining > 0 {
fuel.remaining -= 1;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_span/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![feature(negative_impls)]
#![feature(nll)]
#![feature(optin_builtin_traits)]
#![feature(specialization)]
#![feature(min_specialization)]

// FIXME(#56935): Work around ICEs during cross-compilation.
#[allow(unused)]
Expand Down
14 changes: 11 additions & 3 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use pulldown_cmark::{html, CodeBlockKind, CowStr, Event, Options, Parser, Tag};
mod tests;

fn opts() -> Options {
Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES
Options::ENABLE_TABLES | Options::ENABLE_FOOTNOTES | Options::ENABLE_STRIKETHROUGH
}

/// When `to_string` is called, this struct will emit the HTML corresponding to
Expand Down Expand Up @@ -933,7 +933,11 @@ impl MarkdownSummaryLine<'_> {
}
};

let p = Parser::new_with_broken_link_callback(md, Options::empty(), Some(&replacer));
let p = Parser::new_with_broken_link_callback(
md,
Options::ENABLE_STRIKETHROUGH,
Some(&replacer),
);

let mut s = String::new();

Expand Down Expand Up @@ -975,7 +979,11 @@ pub fn plain_summary_line(md: &str) -> String {
}
}
let mut s = String::with_capacity(md.len() * 3 / 2);
let p = ParserWrapper { inner: Parser::new(md), is_in: 0, is_first: true };
let p = ParserWrapper {
inner: Parser::new_ext(md, Options::ENABLE_STRIKETHROUGH),
is_in: 0,
is_first: true,
};
p.filter(|t| !t.is_empty()).for_each(|i| s.push_str(&i));
s
}
Expand Down
5 changes: 4 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,10 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
);
message.push_str(&format!(": {}", html.to_string()));
}
stability.push(format!("<div class='stab deprecated'>{}</div>", message));
stability.push(format!(
"<div class='stab deprecated'><span class='emoji'>👎</span> {}</div>",
message,
));
}

if let Some(stab) = item.stability.as_ref().filter(|stab| stab.level == stability::Unstable) {
Expand Down
2 changes: 1 addition & 1 deletion src/libserialize/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Core encoding and decoding interfaces.
test(attr(allow(unused_variables), deny(warnings)))
)]
#![feature(box_syntax)]
#![feature(specialization)]
#![feature(specialization)] // FIXME: min_specialization does not work
#![feature(never_type)]
#![feature(nll)]
#![feature(associated_type_bounds)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ fn main() -> () {
_1 = const b"foo"; // scope 0 at $DIR/byte_slice.rs:5:13: 5:19
// ty::Const
// + ty: &[u8; 3]
// + val: Value(Scalar(alloc0+0x0))
// + val: Value(Scalar(alloc0))
// mir::Constant
// + span: $DIR/byte_slice.rs:5:13: 5:19
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc0+0x0)) }
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc0)) }
StorageLive(_2); // scope 1 at $DIR/byte_slice.rs:6:9: 6:10
_2 = [const 5u8, const 120u8]; // scope 1 at $DIR/byte_slice.rs:6:13: 6:24
// ty::Const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ promoted[0] in BAR: &[&i32; 1] = {
let mut _3: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34

bb0: {
_3 = const {alloc0+0x0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
_3 = const {alloc0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
// ty::Const
// + ty: &i32
// + val: Value(Scalar(alloc0+0x0))
// + val: Value(Scalar(alloc0))
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
// + literal: Const { ty: &i32, val: Value(Scalar(alloc0+0x0)) }
// + literal: Const { ty: &i32, val: Value(Scalar(alloc0)) }
_2 = _3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
_1 = [move _2]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
_0 = &_1; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
- StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
- _5 = const {alloc0+0x0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
- _5 = const {alloc0: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
// ty::Const
- // + ty: &i32
- // + val: Value(Scalar(alloc0+0x0))
- // + val: Value(Scalar(alloc0))
+ // + ty: &[&i32; 1]
+ // + val: Unevaluated(DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), [], Some(promoted[0]))
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc0+0x0)) }
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc0)) }
- _4 = &(*_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
Expand Down
Loading