Skip to content

Commit 2fd7606

Browse files
author
Ellen Arteca
committed
removing miri submodule updates
1 parent 04f29dc commit 2fd7606

File tree

11 files changed

+52
-82
lines changed

11 files changed

+52
-82
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,6 @@ dependencies = [
35543554
"crossbeam-utils",
35553555
"libc",
35563556
"libz-sys",
3557-
"memchr",
35583557
"proc-macro2",
35593558
"quote",
35603559
"rand_core 0.5.1",

src/tools/clippy/clippy_lints/src/crate_in_macro_def.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ fn contains_unhygienic_crate_reference(tts: &TokenStream) -> Option<Span> {
110110

111111
fn is_crate_keyword(tt: &TokenTree) -> Option<Span> {
112112
if_chain! {
113-
if let TokenTree::Token(Token { kind: TokenKind::Ident(symbol, _), span }, _) = tt;
113+
if let TokenTree::Token(Token { kind: TokenKind::Ident(symbol, _), span }) = tt;
114114
if symbol.as_str() == "crate";
115115
then { Some(*span) } else { None }
116116
}
117117
}
118118

119119
fn is_token(tt: &TokenTree, kind: &TokenKind) -> bool {
120-
if let TokenTree::Token(Token { kind: other, .. }, _) = tt {
120+
if let TokenTree::Token(Token { kind: other, .. }) = tt {
121121
kind == other
122122
} else {
123123
false

src/tools/clippy/clippy_lints/src/matches/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ fn span_contains_cfg(cx: &LateContext<'_>, s: Span) -> bool {
11121112
let mut pos = 0usize;
11131113
let mut iter = tokenize(&snip).map(|t| {
11141114
let start = pos;
1115-
pos += t.len as usize;
1115+
pos += t.len;
11161116
(t.kind, start..pos)
11171117
});
11181118

src/tools/clippy/clippy_lints/src/methods/suspicious_map.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ pub fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, count_recv: &hi
1212
if_chain! {
1313
if is_trait_method(cx, count_recv, sym::Iterator);
1414
let closure = expr_or_init(cx, map_arg);
15-
if let Some(def_id) = cx.tcx.hir().opt_local_def_id(closure.hir_id);
16-
if let Some(body_id) = cx.tcx.hir().maybe_body_owned_by(def_id);
15+
if let Some(body_id) = cx.tcx.hir().maybe_body_owned_by(closure.hir_id);
1716
let closure_body = cx.tcx.hir().body(body_id);
1817
if !cx.typeck_results().expr_ty(&closure_body.value).is_unit();
1918
then {

src/tools/clippy/clippy_lints/src/undocumented_unsafe_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn text_has_safety_comment(src: &str, line_starts: &[BytePos], offset: usize) ->
345345
if line.starts_with("/*") {
346346
let src = src[line_start..line_starts.last().unwrap().to_usize() - offset].trim_start();
347347
let mut tokens = tokenize(src);
348-
return src[..tokens.next().unwrap().len as usize]
348+
return src[..tokens.next().unwrap().len]
349349
.to_ascii_uppercase()
350350
.contains("SAFETY:")
351351
&& tokens.all(|t| t.kind == TokenKind::Whitespace);

src/tools/clippy/clippy_lints/src/utils/author.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'tcx> LateLintPass<'tcx> for Author {
138138

139139
fn check_item(cx: &LateContext<'_>, hir_id: HirId) {
140140
let hir = cx.tcx.hir();
141-
if let Some(body_id) = hir.maybe_body_owned_by(hir_id.expect_owner()) {
141+
if let Some(body_id) = hir.maybe_body_owned_by(hir_id) {
142142
check_node(cx, hir_id, |v| {
143143
v.expr(&v.bind("expr", &hir.body(body_id).value));
144144
});

src/tools/clippy/clippy_utils/src/hir_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl HirEqInterExpr<'_, '_, '_> {
141141
let mut left_pos = 0;
142142
let left = tokenize(&left)
143143
.map(|t| {
144-
let end = left_pos + t.len as usize;
144+
let end = left_pos + t.len;
145145
let s = &left[left_pos..end];
146146
left_pos = end;
147147
(t, s)
@@ -156,7 +156,7 @@ impl HirEqInterExpr<'_, '_, '_> {
156156
let mut right_pos = 0;
157157
let right = tokenize(&right)
158158
.map(|t| {
159-
let end = right_pos + t.len as usize;
159+
let end = right_pos + t.len;
160160
let s = &right[right_pos..end];
161161
right_pos = end;
162162
(t, s)

src/tools/clippy/clippy_utils/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ pub fn can_move_expr_to_closure<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'
968968
}
969969
},
970970
ExprKind::Closure { .. } => {
971-
let closure_id = self.cx.tcx.hir().local_def_id(e.hir_id);
971+
let closure_id = self.cx.tcx.hir().local_def_id(e.hir_id).to_def_id();
972972
for capture in self.cx.typeck_results().closure_min_captures_flattened(closure_id) {
973973
let local_id = match capture.place.base {
974974
PlaceBase::Local(id) => id,
@@ -1353,7 +1353,7 @@ pub fn is_integer_const(cx: &LateContext<'_>, e: &Expr<'_>, value: u128) -> bool
13531353
if is_integer_literal(e, value) {
13541354
return true;
13551355
}
1356-
let enclosing_body = cx.tcx.hir().enclosing_body_owner(e.hir_id);
1356+
let enclosing_body = cx.tcx.hir().local_def_id(cx.tcx.hir().enclosing_body_owner(e.hir_id));
13571357
if let Some((Constant::Int(v), _)) = constant(cx, cx.tcx.typeck(enclosing_body), e) {
13581358
return value == v;
13591359
}

src/tools/rustc-workspace-hack/Cargo.toml

+2-6
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,16 @@ features = [
7171
]
7272

7373
[dependencies]
74-
bstr = { version = "0.2.17", features = ["default"] }
74+
bstr = { version = "0.2.13", features = ["default"] }
7575
byteorder = { version = "1", features = ['default', 'std'] }
7676
clap = { version = "3.1.1", features = ["derive", "clap_derive"]}
7777
curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true }
7878
crossbeam-utils = { version = "0.8.0", features = ["nightly"] }
7979
libc = { version = "0.2.79", features = ["align"] }
8080
# Ensure default features of libz-sys, which are disabled in some scenarios.
8181
libz-sys = { version = "1.1.2" }
82-
83-
# looks like the only user of deprecated `use_std` feature is `combine`, so this
84-
# can be removed if/when https://github.com/Marwes/combine/pull/348 be merged and released.
85-
memchr = { version = "2.5", features = ["std", "use_std"] }
8682
# same for regex
87-
regex = { version = "1.5.6" }
83+
regex = { version = "1.5.5" }
8884
proc-macro2 = { version = "1", features = ["default"] }
8985
quote = { version = "1", features = ["default"] }
9086
rand_core_0_5 = { package = "rand_core", version = "0.5.1", features = ["getrandom", "alloc", "std"] }

src/tools/rustfmt/src/macros.rs

+37-61
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::collections::HashMap;
1313
use std::panic::{catch_unwind, AssertUnwindSafe};
1414

1515
use rustc_ast::token::{BinOpToken, Delimiter, Token, TokenKind};
16-
use rustc_ast::tokenstream::{Cursor, TokenStream, TokenTree};
16+
use rustc_ast::tokenstream::{Cursor, Spacing, TokenStream, TokenTree};
1717
use rustc_ast::{ast, ptr};
1818
use rustc_ast_pretty::pprust;
1919
use rustc_span::{
@@ -682,7 +682,7 @@ struct MacroArgParser {
682682

683683
fn last_tok(tt: &TokenTree) -> Token {
684684
match *tt {
685-
TokenTree::Token(ref t, _) => t.clone(),
685+
TokenTree::Token(ref t) => t.clone(),
686686
TokenTree::Delimited(delim_span, delim, _) => Token {
687687
kind: TokenKind::CloseDelim(delim),
688688
span: delim_span.close,
@@ -737,13 +737,10 @@ impl MacroArgParser {
737737

738738
fn add_meta_variable(&mut self, iter: &mut Cursor) -> Option<()> {
739739
match iter.next() {
740-
Some(TokenTree::Token(
741-
Token {
742-
kind: TokenKind::Ident(name, _),
743-
..
744-
},
745-
_,
746-
)) => {
740+
Some(TokenTree::Token(Token {
741+
kind: TokenKind::Ident(name, _),
742+
..
743+
})) => {
747744
self.result.push(ParsedMacroArg {
748745
kind: MacroArgKind::MetaVariable(name, self.buf.clone()),
749746
});
@@ -780,30 +777,21 @@ impl MacroArgParser {
780777
}
781778

782779
match tok {
783-
TokenTree::Token(
784-
Token {
785-
kind: TokenKind::BinOp(BinOpToken::Plus),
786-
..
787-
},
788-
_,
789-
)
790-
| TokenTree::Token(
791-
Token {
792-
kind: TokenKind::Question,
793-
..
794-
},
795-
_,
796-
)
797-
| TokenTree::Token(
798-
Token {
799-
kind: TokenKind::BinOp(BinOpToken::Star),
800-
..
801-
},
802-
_,
803-
) => {
780+
TokenTree::Token(Token {
781+
kind: TokenKind::BinOp(BinOpToken::Plus),
782+
..
783+
})
784+
| TokenTree::Token(Token {
785+
kind: TokenKind::Question,
786+
..
787+
})
788+
| TokenTree::Token(Token {
789+
kind: TokenKind::BinOp(BinOpToken::Star),
790+
..
791+
}) => {
804792
break;
805793
}
806-
TokenTree::Token(ref t, _) => {
794+
TokenTree::Token(ref t) => {
807795
buffer.push_str(&pprust::token_to_string(t));
808796
}
809797
_ => return None,
@@ -871,13 +859,10 @@ impl MacroArgParser {
871859

872860
while let Some(tok) = iter.next() {
873861
match tok {
874-
TokenTree::Token(
875-
Token {
876-
kind: TokenKind::Dollar,
877-
span,
878-
},
879-
_,
880-
) => {
862+
TokenTree::Token(Token {
863+
kind: TokenKind::Dollar,
864+
span,
865+
}) => {
881866
// We always want to add a separator before meta variables.
882867
if !self.buf.is_empty() {
883868
self.add_separator();
@@ -890,16 +875,13 @@ impl MacroArgParser {
890875
span,
891876
};
892877
}
893-
TokenTree::Token(
894-
Token {
895-
kind: TokenKind::Colon,
896-
..
897-
},
898-
_,
899-
) if self.is_meta_var => {
878+
TokenTree::Token(Token {
879+
kind: TokenKind::Colon,
880+
..
881+
}) if self.is_meta_var => {
900882
self.add_meta_variable(&mut iter)?;
901883
}
902-
TokenTree::Token(ref t, _) => self.update_buffer(t),
884+
TokenTree::Token(ref t) => self.update_buffer(t),
903885
TokenTree::Delimited(_delimited_span, delimited, ref tts) => {
904886
if !self.buf.is_empty() {
905887
if next_space(&self.last_tok.kind) == SpaceState::Always {
@@ -1141,15 +1123,12 @@ impl MacroParser {
11411123
TokenTree::Token(..) => return None,
11421124
TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
11431125
};
1144-
let args = TokenStream::new(vec![tok]);
1126+
let args = TokenStream::new(vec![(tok, Spacing::Joint)]);
11451127
match self.toks.next()? {
1146-
TokenTree::Token(
1147-
Token {
1148-
kind: TokenKind::FatArrow,
1149-
..
1150-
},
1151-
_,
1152-
) => {}
1128+
TokenTree::Token(Token {
1129+
kind: TokenKind::FatArrow,
1130+
..
1131+
}) => {}
11531132
_ => return None,
11541133
}
11551134
let (mut hi, body, whole_body) = match self.toks.next()? {
@@ -1168,13 +1147,10 @@ impl MacroParser {
11681147
)
11691148
}
11701149
};
1171-
if let Some(TokenTree::Token(
1172-
Token {
1173-
kind: TokenKind::Semi,
1174-
span,
1175-
},
1176-
_,
1177-
)) = self.toks.look_ahead(0)
1150+
if let Some(TokenTree::Token(Token {
1151+
kind: TokenKind::Semi,
1152+
span,
1153+
})) = self.toks.look_ahead(0)
11781154
{
11791155
hi = span.hi();
11801156
self.toks.next();

src/tools/x/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ fn python() -> &'static str {
4141
} else if python2 {
4242
PYTHON2
4343
} else {
44-
// Python was not found on path, so exit
45-
eprintln!("Unable to find python in your PATH. Please check it is installed.");
46-
process::exit(1);
44+
// We would have returned early if we found that python is installed ...
45+
// maybe this should panic with an error instead?
46+
PYTHON
4747
}
4848
}
4949

0 commit comments

Comments
 (0)