Skip to content

Commit

Permalink
Auto merge of #63926 - Centril:rollup-6kckn9n, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 6 pull requests

Successful merges:

 - #63317 (Do not complain about unused code when used in `impl` `Self` type)
 - #63693 (Fully implement or-pattern parsing)
 - #63836 (VxWorks does not provide a way to set the task name except at creation time)
 - #63845 (Removed a confusing FnOnce example)
 - #63855 (Refactor feature gates)
 - #63921 (add link to FileCheck docs)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Aug 27, 2019
2 parents 9b91b9c + 9c5c124 commit 0444b9f
Show file tree
Hide file tree
Showing 88 changed files with 1,675 additions and 564 deletions.
8 changes: 0 additions & 8 deletions src/libcore/ops/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,6 @@ pub trait FnMut<Args> : FnOnce<Args> {
///
/// # Examples
///
/// ## Calling a by-value closure
///
/// ```
/// let x = 5;
/// let square_x = move || x * x;
/// assert_eq!(square_x(), 25);
/// ```
///
/// ## Using a `FnOnce` parameter
///
/// ```
Expand Down
26 changes: 20 additions & 6 deletions src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ fn should_explore(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
Some(Node::Item(..)) |
Some(Node::ImplItem(..)) |
Some(Node::ForeignItem(..)) |
Some(Node::TraitItem(..)) =>
true,
_ =>
false
Some(Node::TraitItem(..)) |
Some(Node::Variant(..)) |
Some(Node::AnonConst(..)) |
Some(Node::Pat(..)) => true,
_ => false
}
}

Expand Down Expand Up @@ -75,7 +76,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
self.check_def_id(res.def_id());
}
_ if self.in_pat => {},
Res::PrimTy(..) | Res::SelfTy(..) | Res::SelfCtor(..) |
Res::PrimTy(..) | Res::SelfCtor(..) |
Res::Local(..) => {}
Res::Def(DefKind::Ctor(CtorOf::Variant, ..), ctor_def_id) => {
let variant_id = self.tcx.parent(ctor_def_id).unwrap();
Expand All @@ -92,6 +93,14 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
self.check_def_id(variant_id);
}
}
Res::SelfTy(t, i) => {
if let Some(t) = t {
self.check_def_id(t);
}
if let Some(i) = i {
self.check_def_id(i);
}
}
Res::ToolMod | Res::NonMacroAttr(..) | Res::Err => {}
_ => {
self.check_def_id(res.def_id());
Expand Down Expand Up @@ -271,7 +280,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
let res = self.tables.qpath_res(path, pat.hir_id);
self.handle_field_pattern_match(pat, res, fields);
}
PatKind::Path(ref qpath @ hir::QPath::TypeRelative(..)) => {
PatKind::Path(ref qpath) => {
let res = self.tables.qpath_res(qpath, pat.hir_id);
self.handle_res(res);
}
Expand All @@ -298,6 +307,11 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
}
intravisit::walk_ty(self, ty);
}

fn visit_anon_const(&mut self, c: &'tcx hir::AnonConst) {
self.live_symbols.insert(c.hir_id);
intravisit::walk_anon_const(self, c);
}
}

fn has_allow_dead_code_or_lang_attr(
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/vxworks/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Thread {
}

pub fn set_name(_name: &CStr) {
assert!(false, "FIXME: set_name");
// VxWorks does not provide a way to set the task name except at creation time
}

pub fn sleep(dur: Duration) {
Expand Down
234 changes: 123 additions & 111 deletions src/libsyntax/feature_gate/accepted.rs

Large diffs are not rendered by default.

Loading

0 comments on commit 0444b9f

Please sign in to comment.