Skip to content

Rollup of 10 pull requests #72120

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

Merged
merged 22 commits into from
May 12, 2020
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
abbc736
Add emoji for deprecated messages
GuillaumeGomez May 8, 2020
9d83108
Add test for deprecated emoji
GuillaumeGomez May 8, 2020
619c605
Fix debug assertion in error code
matthewjasper 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
8bfd845
Fix clippy warnings
matthiaskrgr May 11, 2020
dd595fa
Rollup merge of #72014 - GuillaumeGomez:deprecated-emoji, r=kinnison,…
Dylan-DPC May 11, 2020
705671e
Rollup merge of #72019 - matthewjasper:dont-skip-binder, r=davidtwco
Dylan-DPC May 11, 2020
9c4c52f
Rollup merge of #72027 - Mark-Simulacrum:ci-caches, r=pietroalbini
Dylan-DPC May 11, 2020
eade6f7
Rollup merge of #72044 - RalfJung:min-spec, r=matthewjasper
Dylan-DPC May 11, 2020
a14af7f
Rollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morse
Dylan-DPC May 11, 2020
d9c3110
Rollup merge of #72067 - jonas-schievink:fuel-warn, r=varkor
Dylan-DPC May 11, 2020
6a8ac8b
Rollup merge of #72072 - tspiteri:minus-inf, r=Dylan-DPC
Dylan-DPC May 11, 2020
400a9ba
Rollup merge of #72077 - GuillaumeGomez:cleanup-E0571, r=Dylan-DPC
Dylan-DPC May 11, 2020
dd53768
Rollup merge of #72107 - GuillaumeGomez:cleanup-e0579, r=Dylan-DPC
Dylan-DPC May 11, 2020
dfa3677
Rollup merge of #72109 - matthiaskrgr:cl8ppy, 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
@@ -34,6 +34,7 @@ jobs:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'pull_request'"
strategy:
matrix:
@@ -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:
@@ -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:
@@ -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
10 changes: 6 additions & 4 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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
2 changes: 2 additions & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ x--expand-yaml-anchors--remove:
- &public-variables
SCCACHE_BUCKET: rust-lang-gha-caches
TOOLSTATE_REPO: https://github.com/pietroalbini/rust-toolstate
CACHE_DOMAIN: ci-caches-gha.rust-lang.org

- &prod-variables
SCCACHE_BUCKET: rust-lang-gha-caches
@@ -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: {}
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
@@ -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;

2 changes: 1 addition & 1 deletion src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
@@ -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;

2 changes: 1 addition & 1 deletion src/librustc_ast_lowering/lib.rs
Original file line number Diff line number Diff line change
@@ -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"]

2 changes: 1 addition & 1 deletion src/librustc_attr/builtin.rs
Original file line number Diff line number Diff line change
@@ -634,7 +634,7 @@ pub fn eval_condition(
[NestedMetaItem::Literal(Lit { span, .. })
| NestedMetaItem::MetaItem(MetaItem { span, .. })] => {
sess.span_diagnostic
.struct_span_err(*span, &*format!("expected a version literal"))
.struct_span_err(*span, "expected a version literal")
.emit();
return false;
}
2 changes: 1 addition & 1 deletion src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
4 changes: 2 additions & 2 deletions src/librustc_data_structures/tiny_list.rs
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ impl<T: PartialEq> TinyList<T> {
if &e.data == data {
return true;
}
elem = e.next.as_ref().map(|e| &**e);
elem = e.next.as_deref();
}
false
}
@@ -62,7 +62,7 @@ impl<T: PartialEq> TinyList<T> {
let (mut elem, mut count) = (self.head.as_ref(), 0);
while let Some(ref e) = elem {
count += 1;
elem = e.next.as_ref().map(|e| &**e);
elem = e.next.as_deref();
}
count
}
6 changes: 3 additions & 3 deletions src/librustc_error_codes/error_codes/E0571.md
Original file line number Diff line number Diff line change
@@ -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;
};
@@ -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;
};
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:

@@ -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
@@ -8,7 +8,7 @@
#![feature(const_panic)]
#![feature(in_band_lifetimes)]
#![feature(or_patterns)]
#![feature(specialization)]
#![feature(min_specialization)]
#![recursion_limit = "256"]

#[macro_use]
5 changes: 2 additions & 3 deletions src/librustc_infer/traits/util.rs
Original file line number Diff line number Diff line change
@@ -112,8 +112,7 @@ pub fn elaborate_predicates<'tcx>(
tcx: TyCtxt<'tcx>,
predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
) -> Elaborator<'tcx> {
let obligations =
predicates.into_iter().map(|predicate| predicate_obligation(predicate, None)).collect();
let obligations = predicates.map(|predicate| predicate_obligation(predicate, None)).collect();
elaborate_obligations(tcx, obligations)
}

@@ -149,7 +148,7 @@ impl Elaborator<'tcx> {
// Get predicates declared on the trait.
let predicates = tcx.super_predicates_of(data.def_id());

let obligations = predicates.predicates.into_iter().map(|(pred, span)| {
let obligations = predicates.predicates.iter().map(|(pred, span)| {
predicate_obligation(
pred.subst_supertrait(tcx, &data.to_poly_trait_ref()),
Some(*span),
2 changes: 1 addition & 1 deletion src/librustc_interface/queries.rs
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ impl<'tcx> Queries<'tcx> {
let result = passes::register_plugins(
self.session(),
&*self.codegen_backend().metadata_loader(),
self.compiler.register_lints.as_ref().map(|p| &**p).unwrap_or_else(|| empty),
self.compiler.register_lints.as_deref().unwrap_or_else(|| empty),
krate,
&crate_name,
);
2 changes: 1 addition & 1 deletion src/librustc_metadata/lib.rs
Original file line number Diff line number Diff line change
@@ -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"]

4 changes: 2 additions & 2 deletions src/librustc_middle/dep_graph/mod.rs
Original file line number Diff line number Diff line change
@@ -72,9 +72,9 @@ impl rustc_query_system::dep_graph::DepKind for DepKind {
})
}

fn read_deps<OP>(op: OP) -> ()
fn read_deps<OP>(op: OP)
where
OP: for<'a> FnOnce(Option<&'a Lock<TaskDeps>>) -> (),
OP: for<'a> FnOnce(Option<&'a Lock<TaskDeps>>),
{
ty::tls::with_context_opt(|icx| {
let icx = if let Some(icx) = icx { icx } else { return };
3 changes: 1 addition & 2 deletions src/librustc_middle/hir/mod.rs
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@ pub fn provide(providers: &mut Providers<'_>) {
&tcx.untracked_crate.modules[&module]
};
providers.hir_owner = |tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].signature;
providers.hir_owner_nodes =
|tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].with_bodies.as_ref().map(|nodes| &**nodes);
providers.hir_owner_nodes = |tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].with_bodies.as_deref();
map::provide(providers);
}
2 changes: 1 addition & 1 deletion src/librustc_middle/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion src/librustc_middle/ty/mod.rs
Original file line number Diff line number Diff line change
@@ -280,7 +280,7 @@ impl<'tcx> AssociatedItems<'tcx> {
&self,
name: Symbol,
) -> impl '_ + Iterator<Item = &ty::AssocItem> {
self.items.get_by_key(&name).map(|v| *v)
self.items.get_by_key(&name).copied()
}

/// Returns an iterator over all associated items with the given name.
4 changes: 3 additions & 1 deletion src/librustc_middle/ty/print/pretty.rs
Original file line number Diff line number Diff line change
@@ -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("_"));
}
5 changes: 1 addition & 4 deletions src/librustc_middle/ty/trait_def.rs
Original file line number Diff line number Diff line change
@@ -171,10 +171,7 @@ impl<'tcx> TyCtxt<'tcx> {
pub fn all_impls(self, def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
let TraitImpls { blanket_impls, non_blanket_impls } = self.trait_impls_of(def_id);

blanket_impls
.into_iter()
.chain(non_blanket_impls.into_iter().map(|(_, v)| v).flatten())
.cloned()
blanket_impls.iter().chain(non_blanket_impls.iter().map(|(_, v)| v).flatten()).cloned()
}
}

2 changes: 1 addition & 1 deletion src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion src/librustc_mir_build/hair/pattern/check_match.rs
Original file line number Diff line number Diff line change
@@ -246,7 +246,7 @@ impl<'tcx> MatchVisitor<'_, 'tcx> {
);
}

adt_defined_here(&mut cx, &mut err, pattern_ty, &witnesses);
adt_defined_here(&cx, &mut err, pattern_ty, &witnesses);
err.note(&format!("the matched value is of type `{}`", pattern_ty));
err.emit();
}
2 changes: 1 addition & 1 deletion src/librustc_mir_build/hair/pattern/const_to_pat.rs
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
)
}
traits::NonStructuralMatchTy::Dynamic => {
format!("trait objects cannot be used in patterns")
"trait objects cannot be used in patterns".to_string()
}
traits::NonStructuralMatchTy::Param => {
bug!("use of constant whose type is a parameter inside a pattern")
4 changes: 2 additions & 2 deletions src/librustc_passes/liveness.rs
Original file line number Diff line number Diff line change
@@ -931,7 +931,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
if blk.targeted_by_break {
self.break_ln.insert(blk.hir_id, succ);
}
let succ = self.propagate_through_opt_expr(blk.expr.as_ref().map(|e| &**e), succ);
let succ = self.propagate_through_opt_expr(blk.expr.as_deref(), succ);
blk.stmts.iter().rev().fold(succ, |succ, stmt| self.propagate_through_stmt(stmt, succ))
}

@@ -952,7 +952,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
// initialization, which is mildly more complex than checking
// once at the func header but otherwise equivalent.

let succ = self.propagate_through_opt_expr(local.init.as_ref().map(|e| &**e), succ);
let succ = self.propagate_through_opt_expr(local.init.as_deref(), succ);
self.define_bindings_in_pat(&local.pat, succ)
}
hir::StmtKind::Item(..) => succ,
2 changes: 1 addition & 1 deletion src/librustc_passes/region.rs
Original file line number Diff line number Diff line change
@@ -797,7 +797,7 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
resolve_expr(self, ex);
}
fn visit_local(&mut self, l: &'tcx Local<'tcx>) {
resolve_local(self, Some(&l.pat), l.init.as_ref().map(|e| &**e));
resolve_local(self, Some(&l.pat), l.init.as_deref());
}
}

2 changes: 1 addition & 1 deletion src/librustc_query_system/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ impl<K: DepKind> DepNode<K> {
}
}

return dep_node;
dep_node
}
}

4 changes: 2 additions & 2 deletions src/librustc_query_system/dep_graph/mod.rs
Original file line number Diff line number Diff line change
@@ -77,9 +77,9 @@ pub trait DepKind: Copy + fmt::Debug + Eq + Ord + Hash {
OP: FnOnce() -> R;

/// Access dependencies from current implicit context.
fn read_deps<OP>(op: OP) -> ()
fn read_deps<OP>(op: OP)
where
OP: for<'a> FnOnce(Option<&'a Lock<TaskDeps<Self>>>) -> ();
OP: for<'a> FnOnce(Option<&'a Lock<TaskDeps<Self>>>);

fn can_reconstruct_query_key(&self) -> bool;
}
2 changes: 1 addition & 1 deletion src/librustc_query_system/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]

2 changes: 1 addition & 1 deletion src/librustc_session/session.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/librustc_span/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
Loading