Skip to content

Commit cb6eedd

Browse files
committed
Auto merge of #54969 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests Successful merges: - #54747 (codegen_llvm: verify that inline assembly operands are scalars) - #54848 (Better Diagnostic for Trait Object Capture) - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls) - #54858 (second round of refactorings for universes) - #54862 (Implement RFC 2539: cfg_attr with multiple attributes) - #54869 (Fix mobile docs) - #54870 (Stabilize tool lints) - #54893 (Fix internal compiler error on malformed match arm pattern.) - #54904 (Stabilize the `Option::replace` method) Failed merges: - #54909 ( Add chalk rules related to associated type defs) r? @ghost
2 parents 9746a2d + be64bf3 commit cb6eedd

File tree

71 files changed

+597
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+597
-240
lines changed

src/Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
270270

271271
[[package]]
272272
name = "chalk-engine"
273-
version = "0.7.0"
273+
version = "0.8.0"
274274
source = "registry+https://github.com/rust-lang/crates.io-index"
275275
dependencies = [
276276
"chalk-macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1898,7 +1898,7 @@ dependencies = [
18981898
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
18991899
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
19001900
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
1901-
"chalk-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
1901+
"chalk-engine 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
19021902
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
19031903
"fmt_macros 0.0.0",
19041904
"graphviz 0.0.0",
@@ -2434,7 +2434,7 @@ name = "rustc_traits"
24342434
version = "0.0.0"
24352435
dependencies = [
24362436
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
2437-
"chalk-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
2437+
"chalk-engine 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
24382438
"graphviz 0.0.0",
24392439
"log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
24402440
"rustc 0.0.0",
@@ -3195,7 +3195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
31953195
"checksum cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6809b327f87369e6f3651efd2c5a96c49847a3ed2559477ecba79014751ee1"
31963196
"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
31973197
"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
3198-
"checksum chalk-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "25ce2f28f55ed544a2a3756b7acf41dd7d6f27acffb2086439950925506af7d0"
3198+
"checksum chalk-engine 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6749eb72e7d4355d944a99f15fbaea701b978c18c5e184a025fcde942b0c9779"
31993199
"checksum chalk-macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "295635afd6853aa9f20baeb7f0204862440c0fe994c5a253d5f479dac41d047e"
32003200
"checksum chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6962c635d530328acc53ac6a955e83093fedc91c5809dfac1fa60fa470830a37"
32013201
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# `cfg_attr_multi`
2+
3+
The tracking issue for this feature is: [#54881]
4+
The RFC for this feature is: [#2539]
5+
6+
[#54881]: https://github.com/rust-lang/rust/issues/54881
7+
[#2539]: https://github.com/rust-lang/rfcs/pull/2539
8+
9+
------------------------
10+
11+
This feature flag lets you put multiple attributes into a `cfg_attr` attribute.
12+
13+
Example:
14+
15+
```rust,ignore
16+
#[cfg_attr(all(), must_use, optimize)]
17+
```
18+
19+
Because `cfg_attr` resolves before procedural macros, this does not affect
20+
macro resolution at all.

src/doc/unstable-book/src/language-features/tool-lints.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/libcore/option.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,6 @@ impl<T> Option<T> {
867867
/// # Examples
868868
///
869869
/// ```
870-
/// #![feature(option_replace)]
871-
///
872870
/// let mut x = Some(2);
873871
/// let old = x.replace(5);
874872
/// assert_eq!(x, Some(5));
@@ -880,7 +878,7 @@ impl<T> Option<T> {
880878
/// assert_eq!(old, None);
881879
/// ```
882880
#[inline]
883-
#[unstable(feature = "option_replace", issue = "51998")]
881+
#[stable(feature = "option_replace", since = "1.31.0")]
884882
pub fn replace(&mut self, value: T) -> Option<T> {
885883
mem::replace(self, Some(value))
886884
}

src/libcore/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(reverse_bits)]
4040
#![feature(inner_deref)]
4141
#![feature(slice_internals)]
42-
#![feature(option_replace)]
4342
#![feature(slice_partition_dedup)]
4443
#![feature(copy_within)]
4544

src/librustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ syntax_pos = { path = "../libsyntax_pos" }
3131
backtrace = "0.3.3"
3232
parking_lot = "0.6"
3333
byteorder = { version = "1.1", features = ["i128"]}
34-
chalk-engine = { version = "0.7.0", default-features=false }
34+
chalk-engine = { version = "0.8.0", default-features=false }
3535
rustc_fs_util = { path = "../librustc_fs_util" }
3636
smallvec = { version = "0.6.5", features = ["union"] }
3737

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::Goal<'tcx> {
13701370
fn hash_stable<W: StableHasherResult>(&self,
13711371
hcx: &mut StableHashingContext<'a>,
13721372
hasher: &mut StableHasher<W>) {
1373-
use traits::Goal::*;
1373+
use traits::GoalKind::*;
13741374

13751375
mem::discriminant(self).hash_stable(hcx, hasher);
13761376
match self {

src/librustc/lint/levels.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ use lint::context::CheckLintNameResult;
1818
use lint::{self, Lint, LintId, Level, LintSource};
1919
use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey,
2020
StableHasher, StableHasherResult};
21-
use session::{config::nightly_options, Session};
21+
use session::Session;
2222
use syntax::ast;
2323
use syntax::attr;
2424
use syntax::source_map::MultiSpan;
25-
use syntax::feature_gate;
2625
use syntax::symbol::Symbol;
2726
use util::nodemap::FxHashMap;
2827

@@ -228,28 +227,14 @@ impl<'a> LintLevelsBuilder<'a> {
228227
}
229228
};
230229
let tool_name = if let Some(lint_tool) = word.is_scoped() {
231-
let gate_feature = !self.sess.features_untracked().tool_lints;
232-
let known_tool = attr::is_known_lint_tool(lint_tool);
233-
if gate_feature {
234-
feature_gate::emit_feature_err(
235-
&sess.parse_sess,
236-
"tool_lints",
237-
word.span,
238-
feature_gate::GateIssue::Language,
239-
&format!("scoped lint `{}` is experimental", word.ident),
240-
);
241-
}
242-
if !known_tool {
230+
if !attr::is_known_lint_tool(lint_tool) {
243231
span_err!(
244232
sess,
245233
lint_tool.span,
246234
E0710,
247235
"an unknown tool name found in scoped lint: `{}`",
248236
word.ident
249237
);
250-
}
251-
252-
if gate_feature || !known_tool {
253238
continue;
254239
}
255240

@@ -299,13 +284,7 @@ impl<'a> LintLevelsBuilder<'a> {
299284
"change it to",
300285
new_lint_name.to_string(),
301286
Applicability::MachineApplicable,
302-
);
303-
304-
if nightly_options::is_nightly_build() {
305-
err.emit();
306-
} else {
307-
err.cancel();
308-
}
287+
).emit();
309288

310289
let src = LintSource::Node(Symbol::intern(&new_lint_name), li.span);
311290
for id in ids {

src/librustc/traits/mod.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -318,31 +318,33 @@ pub enum QuantifierKind {
318318
}
319319

320320
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
321-
pub enum Goal<'tcx> {
322-
Implies(Clauses<'tcx>, &'tcx Goal<'tcx>),
323-
And(&'tcx Goal<'tcx>, &'tcx Goal<'tcx>),
324-
Not(&'tcx Goal<'tcx>),
321+
pub enum GoalKind<'tcx> {
322+
Implies(Clauses<'tcx>, Goal<'tcx>),
323+
And(Goal<'tcx>, Goal<'tcx>),
324+
Not(Goal<'tcx>),
325325
DomainGoal(DomainGoal<'tcx>),
326-
Quantified(QuantifierKind, ty::Binder<&'tcx Goal<'tcx>>),
326+
Quantified(QuantifierKind, ty::Binder<Goal<'tcx>>),
327327
CannotProve,
328328
}
329329

330+
pub type Goal<'tcx> = &'tcx GoalKind<'tcx>;
331+
330332
pub type Goals<'tcx> = &'tcx List<Goal<'tcx>>;
331333

332334
impl<'tcx> DomainGoal<'tcx> {
333-
pub fn into_goal(self) -> Goal<'tcx> {
334-
Goal::DomainGoal(self)
335+
pub fn into_goal(self) -> GoalKind<'tcx> {
336+
GoalKind::DomainGoal(self)
335337
}
336338
}
337339

338-
impl<'tcx> Goal<'tcx> {
340+
impl<'tcx> GoalKind<'tcx> {
339341
pub fn from_poly_domain_goal<'a>(
340342
domain_goal: PolyDomainGoal<'tcx>,
341343
tcx: TyCtxt<'a, 'tcx, 'tcx>,
342-
) -> Goal<'tcx> {
344+
) -> GoalKind<'tcx> {
343345
match domain_goal.no_late_bound_regions() {
344346
Some(p) => p.into_goal(),
345-
None => Goal::Quantified(
347+
None => GoalKind::Quantified(
346348
QuantifierKind::Universal,
347349
domain_goal.map_bound(|p| tcx.mk_goal(p.into_goal()))
348350
),

src/librustc/traits/structural_impls.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl fmt::Display for traits::QuantifierKind {
469469

470470
impl<'tcx> fmt::Display for traits::Goal<'tcx> {
471471
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
472-
use traits::Goal::*;
472+
use traits::GoalKind::*;
473473

474474
match self {
475475
Implies(hypotheses, goal) => {
@@ -598,25 +598,25 @@ CloneTypeFoldableAndLiftImpls! {
598598
}
599599

600600
EnumTypeFoldableImpl! {
601-
impl<'tcx> TypeFoldable<'tcx> for traits::Goal<'tcx> {
602-
(traits::Goal::Implies)(hypotheses, goal),
603-
(traits::Goal::And)(goal1, goal2),
604-
(traits::Goal::Not)(goal),
605-
(traits::Goal::DomainGoal)(domain_goal),
606-
(traits::Goal::Quantified)(qkind, goal),
607-
(traits::Goal::CannotProve),
601+
impl<'tcx> TypeFoldable<'tcx> for traits::GoalKind<'tcx> {
602+
(traits::GoalKind::Implies)(hypotheses, goal),
603+
(traits::GoalKind::And)(goal1, goal2),
604+
(traits::GoalKind::Not)(goal),
605+
(traits::GoalKind::DomainGoal)(domain_goal),
606+
(traits::GoalKind::Quantified)(qkind, goal),
607+
(traits::GoalKind::CannotProve),
608608
}
609609
}
610610

611611
EnumLiftImpl! {
612-
impl<'a, 'tcx> Lift<'tcx> for traits::Goal<'a> {
613-
type Lifted = traits::Goal<'tcx>;
614-
(traits::Goal::Implies)(hypotheses, goal),
615-
(traits::Goal::And)(goal1, goal2),
616-
(traits::Goal::Not)(goal),
617-
(traits::Goal::DomainGoal)(domain_goal),
618-
(traits::Goal::Quantified)(kind, goal),
619-
(traits::Goal::CannotProve),
612+
impl<'a, 'tcx> Lift<'tcx> for traits::GoalKind<'a> {
613+
type Lifted = traits::GoalKind<'tcx>;
614+
(traits::GoalKind::Implies)(hypotheses, goal),
615+
(traits::GoalKind::And)(goal1, goal2),
616+
(traits::GoalKind::Not)(goal),
617+
(traits::GoalKind::DomainGoal)(domain_goal),
618+
(traits::GoalKind::Quantified)(kind, goal),
619+
(traits::GoalKind::CannotProve),
620620
}
621621
}
622622

@@ -633,7 +633,7 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<traits::Goal<'tcx>> {
633633
}
634634
}
635635

636-
impl<'tcx> TypeFoldable<'tcx> for &'tcx traits::Goal<'tcx> {
636+
impl<'tcx> TypeFoldable<'tcx> for traits::Goal<'tcx> {
637637
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
638638
let v = (**self).fold_with(folder);
639639
folder.tcx().mk_goal(v)

0 commit comments

Comments
 (0)