Skip to content

Rollup of 6 pull requests #63926

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 52 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
053afa7
Do not complain about unused code when used in `impl` `Self` type
estebank Aug 6, 2019
352d97e
Add more tests covering more cases
estebank Aug 21, 2019
912feab
VxWorks does not provide a way to set the task name except at creatio…
bpangWR Aug 23, 2019
602bea3
Merge pull request #8 from Wind-River/set_name_003
BaoshanPang Aug 23, 2019
a577316
Removed the confusing FnOnce example. closes #47091
Aug 24, 2019
55f8dde
Added an extra line to make the formatting conform to the rest of the…
Aug 24, 2019
8ca9c7b
Fix tidy feature gate error reporting
Aug 24, 2019
c9619a4
Use doc comments for feature gate descriptions
Aug 24, 2019
5299d8a
parser: extract `ban_unexpected_or_or`.
Centril Aug 18, 2019
1ba7550
parser: type alias `type Expected = Option<&'static str>;`.
Centril Aug 18, 2019
0bbea47
parser: refactor `parse_pat_with_or` + use it in [p0, p1, ..] pats.
Centril Aug 18, 2019
30b841d
parser: improve or-patterns recovery.
Centril Aug 18, 2019
d34ee76
parser: move `multiple-pattern-typo` -> `or-patterns` directory.
Centril Aug 18, 2019
5f57fee
parser: `multiple-pattern-typo`: cover more or-pattern places.
Centril Aug 18, 2019
f852c7c
parser: simplify `parse_pat_with_or`.
Centril Aug 18, 2019
21d9b85
parser: extract `maybe_recover_unexpected_comma`.
Centril Aug 18, 2019
a4a34ab
parser: integrate `maybe_recover_unexpected_comma` in `parse_pat_with…
Centril Aug 18, 2019
7b59b4f
parser: extract `eat_or_separator`.
Centril Aug 18, 2019
dc5bbaf
parser: improve `parse_pat_with_or` docs.
Centril Aug 18, 2019
6498959
parser: use `eat_or_separator` for leading vert.
Centril Aug 18, 2019
39f5e5b
parser: move `maybe_recover_unexpected_comma` to a more appropriate p…
Centril Aug 18, 2019
8f6a0cd
parser: document `ban_unexpected_or_or`.
Centril Aug 18, 2019
b7178ef
parser: `parse_pats` -> `parse_top_pat{_unpack}`.
Centril Aug 18, 2019
92d66a1
parser: document `parse_pat`.
Centril Aug 18, 2019
95792b4
parser: `let` stmts & `for` exprs: allow or-patterns.
Centril Aug 18, 2019
5f6bec8
parser: drive-by: simplify `parse_arg_general`.
Centril Aug 18, 2019
a9af18b
move `ui/or-pattern-mismatch` -> `ui/or-patterns/`.
Centril Aug 18, 2019
f35432e
or-patterns: add syntactic tests.
Centril Aug 18, 2019
d3b3bce
move `feature-gate-or_patterns.*` -> `ui/or-patterns/`
Centril Aug 18, 2019
1ffea18
or-patterns: harden feature gating tests.
Centril Aug 18, 2019
b205055
parser: better recovery for || in inner pats.
Centril Aug 19, 2019
b2966e6
parser: bool -> GateOr.
Centril Aug 24, 2019
a9ef859
parser: bool -> TopLevel.
Centril Aug 24, 2019
3a40542
parse_top_pat: silence leading vert gating sometimes.
Centril Aug 24, 2019
e374772
parser: extract recover_inner_leading_vert.
Centril Aug 24, 2019
0ab8430
parser: reword || recovery.
Centril Aug 24, 2019
1202cb0
parser: simplify parse_pat_with_or_{inner}
Centril Aug 24, 2019
083963e
parser: 'while parsing this or-pattern...'
Centril Aug 24, 2019
1caaa40
parser: gracefully handle `fn foo(A | B: type)`.
Centril Aug 25, 2019
6a73199
or_patterns: add run-rustfix tests.
Centril Aug 25, 2019
acb1130
parser: TopLevel -> RecoverComma.
Centril Aug 25, 2019
c9d9616
Introduce and use `Feature` type for feature gates
Aug 24, 2019
94e8ff4
Refactor feature gate checking code
Aug 24, 2019
633f67a
add link to FileCheck docs
RalfJung Aug 26, 2019
2bd27fb
parser: fix span for leading vert.
Centril Aug 26, 2019
7def99a
review comment
estebank Aug 26, 2019
44cfa78
Rollup merge of #63317 - estebank:dead-code, r=matthewjasper
Centril Aug 26, 2019
7dc3c93
Rollup merge of #63693 - Centril:polish-parse-or-pats, r=estebank
Centril Aug 26, 2019
9eeb7d5
Rollup merge of #63836 - Wind-River:master_003, r=alexcrichton
Centril Aug 26, 2019
59fa966
Rollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakis
Centril Aug 26, 2019
b005a89
Rollup merge of #63855 - killercup:refactor/feature-gates, r=Centril
Centril Aug 26, 2019
9c5c124
Rollup merge of #63921 - RalfJung:file-check, r=alexcrichton
Centril Aug 26, 2019
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
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