Skip to content

Commit 0444b9f

Browse files
committed
Auto merge of #63926 - Centril:rollup-6kckn9n, r=Centril
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
2 parents 9b91b9c + 9c5c124 commit 0444b9f

File tree

88 files changed

+1675
-564
lines changed

Some content is hidden

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

88 files changed

+1675
-564
lines changed

src/libcore/ops/function.rs

-8
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,6 @@ pub trait FnMut<Args> : FnOnce<Args> {
185185
///
186186
/// # Examples
187187
///
188-
/// ## Calling a by-value closure
189-
///
190-
/// ```
191-
/// let x = 5;
192-
/// let square_x = move || x * x;
193-
/// assert_eq!(square_x(), 25);
194-
/// ```
195-
///
196188
/// ## Using a `FnOnce` parameter
197189
///
198190
/// ```

src/librustc/middle/dead.rs

+20-6
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ fn should_explore(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
3030
Some(Node::Item(..)) |
3131
Some(Node::ImplItem(..)) |
3232
Some(Node::ForeignItem(..)) |
33-
Some(Node::TraitItem(..)) =>
34-
true,
35-
_ =>
36-
false
33+
Some(Node::TraitItem(..)) |
34+
Some(Node::Variant(..)) |
35+
Some(Node::AnonConst(..)) |
36+
Some(Node::Pat(..)) => true,
37+
_ => false
3738
}
3839
}
3940

@@ -75,7 +76,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
7576
self.check_def_id(res.def_id());
7677
}
7778
_ if self.in_pat => {},
78-
Res::PrimTy(..) | Res::SelfTy(..) | Res::SelfCtor(..) |
79+
Res::PrimTy(..) | Res::SelfCtor(..) |
7980
Res::Local(..) => {}
8081
Res::Def(DefKind::Ctor(CtorOf::Variant, ..), ctor_def_id) => {
8182
let variant_id = self.tcx.parent(ctor_def_id).unwrap();
@@ -92,6 +93,14 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
9293
self.check_def_id(variant_id);
9394
}
9495
}
96+
Res::SelfTy(t, i) => {
97+
if let Some(t) = t {
98+
self.check_def_id(t);
99+
}
100+
if let Some(i) = i {
101+
self.check_def_id(i);
102+
}
103+
}
95104
Res::ToolMod | Res::NonMacroAttr(..) | Res::Err => {}
96105
_ => {
97106
self.check_def_id(res.def_id());
@@ -271,7 +280,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
271280
let res = self.tables.qpath_res(path, pat.hir_id);
272281
self.handle_field_pattern_match(pat, res, fields);
273282
}
274-
PatKind::Path(ref qpath @ hir::QPath::TypeRelative(..)) => {
283+
PatKind::Path(ref qpath) => {
275284
let res = self.tables.qpath_res(qpath, pat.hir_id);
276285
self.handle_res(res);
277286
}
@@ -298,6 +307,11 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
298307
}
299308
intravisit::walk_ty(self, ty);
300309
}
310+
311+
fn visit_anon_const(&mut self, c: &'tcx hir::AnonConst) {
312+
self.live_symbols.insert(c.hir_id);
313+
intravisit::walk_anon_const(self, c);
314+
}
301315
}
302316

303317
fn has_allow_dead_code_or_lang_attr(

src/libstd/sys/vxworks/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Thread {
7777
}
7878

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

8383
pub fn sleep(dur: Duration) {

src/libsyntax/feature_gate/accepted.rs

+123-111
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)