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

Rustup to latest nightly #2703

Merged
merged 1 commit into from Apr 28, 2018
Jump to file or symbol
Failed to load files and symbols.
+20 −20
Diff settings

Always

Just for now

@@ -3,7 +3,7 @@ use rustc::ty::Ty;
use rustc::hir::*;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use syntax::util::small_vector::SmallVector;
use utils::{SpanlessEq, SpanlessHash};
use utils::{get_parent_expr, in_macro, snippet, span_lint_and_then, span_note_and_lint};
@@ -262,8 +262,8 @@ fn if_sequence(mut expr: &Expr) -> (SmallVector<&Expr>, SmallVector<&Block>) {
}
/// Return the list of bindings in a pattern.
fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap<InternedString, Ty<'tcx>> {
fn bindings_impl<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat, map: &mut HashMap<InternedString, Ty<'tcx>>) {
fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap<LocalInternedString, Ty<'tcx>> {
fn bindings_impl<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat, map: &mut HashMap<LocalInternedString, Ty<'tcx>>) {
match pat.node {
PatKind::Box(ref pat) | PatKind::Ref(ref pat, _) => bindings_impl(cx, pat, map),
PatKind::TupleStruct(_, ref pats, _) => for pat in pats {
@@ -3,7 +3,7 @@
use rustc::lint::*;
use syntax::ast::*;
use syntax::codemap::Span;
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use utils::{span_help_and_lint, span_lint};
use utils::{camel_case_from, camel_case_until, in_macro};
@@ -99,7 +99,7 @@ declare_clippy_lint! {
}
pub struct EnumVariantNames {
modules: Vec<(InternedString, String)>,
modules: Vec<(LocalInternedString, String)>,
threshold: u64,
}
@@ -118,7 +118,7 @@ impl LintPass for EnumVariantNames {
}
}
fn var2str(var: &Variant) -> InternedString {
fn var2str(var: &Variant) -> LocalInternedString {
var.node.ident.name.as_str()
}
@@ -1,6 +1,6 @@
use rustc::lint::*;
use syntax::codemap::Span;
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use syntax::ast::*;
use syntax::attr;
use syntax::visit::{walk_block, walk_expr, walk_pat, Visitor};
@@ -73,7 +73,7 @@ impl LintPass for NonExpressiveNames {
}
struct ExistingName {
interned: InternedString,
interned: LocalInternedString,
span: Span,
len: usize,
whitelist: &'static [&'static str],
@@ -1,7 +1,7 @@
use rustc::lint::*;
use syntax::ast::*;
use syntax::codemap::Span;
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use utils::span_lint;
/// **What it does:** Checks for imports that remove "unsafe" from an item's
@@ -75,6 +75,6 @@ fn unsafe_to_safe_check(old_name: Ident, new_name: Ident, cx: &EarlyContext, spa
}
}
fn contains_unsafe(name: &InternedString) -> bool {
fn contains_unsafe(name: &LocalInternedString) -> bool {
name.contains("Unsafe") || name.contains("unsafe")
}
@@ -4,7 +4,7 @@ use rustc::hir::intravisit::{walk_expr, walk_fn, FnKind, NestedVisitorMap, Visit
use std::collections::HashMap;
use syntax::ast;
use syntax::codemap::Span;
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use utils::{in_macro, span_lint};
/// **What it does:** Checks for unused labels.
@@ -30,7 +30,7 @@ declare_clippy_lint! {
pub struct UnusedLabel;
struct UnusedLabelVisitor<'a, 'tcx: 'a> {
labels: HashMap<InternedString, Span>,
labels: HashMap<LocalInternedString, Span>,
cx: &'a LateContext<'a, 'tcx>,
}
@@ -2,7 +2,7 @@ use rustc::lint::*;
use rustc::hir::*;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use utils::{match_qpath, paths, span_lint};
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use syntax::ast::{Crate as AstCrate, ItemKind, Name, NodeId};
use syntax::codemap::Span;
use std::collections::{HashMap, HashSet};
@@ -76,7 +76,7 @@ impl EarlyLintPass for Clippy {
.find(|item| item.ident.name == "paths")
{
if let ItemKind::Mod(ref paths_mod) = paths.node {
let mut last_name: Option<InternedString> = None;
let mut last_name: Option<LocalInternedString> = None;
for item in &paths_mod.items {
let name = item.ident.name.as_str();
if let Some(ref last_name) = last_name {
@@ -116,7 +116,7 @@ pub fn match_def_path(tcx: TyCtxt, def_id: DefId, path: &[&str]) -> bool {
use syntax::symbol;
struct AbsolutePathBuffer {
names: Vec<symbol::InternedString>,
names: Vec<symbol::LocalInternedString>,
}
impl ty::item_path::ItemPathBuffer for AbsolutePathBuffer {
@@ -302,7 +302,7 @@ pub fn implements_trait<'a, 'tcx>(
cx.tcx
.predicate_for_trait_def(cx.param_env, traits::ObligationCause::dummy(), trait_id, 0, ty, ty_params);
cx.tcx.infer_ctxt().enter(|infcx| {
traits::SelectionContext::new(&infcx).evaluate_obligation_conservatively(&obligation)
traits::SelectionContext::new(&infcx).infcx().predicate_must_hold(&obligation)

This comment has been minimized.

@aravind-pg

aravind-pg Apr 30, 2018

Sorry, didn't see this PR earlier but this could just be infcx.predicate_must_hold(...) --- i.e., no need to create a SelectionContext. No functional difference though, and I suppose not much perf difference in practice either, so not a big deal.

})
}
@@ -4,7 +4,7 @@ use rustc::lint::*;
use std::ops::Deref;
use syntax::ast::LitKind;
use syntax::ptr;
use syntax::symbol::InternedString;
use syntax::symbol::LocalInternedString;
use syntax_pos::Span;
use utils::{is_expn_of, match_def_path, match_path, resolve_node, span_lint, span_lint_and_sugg};
use utils::{opt_def_id, paths, last_path_segment};
@@ -389,7 +389,7 @@ where
}
/// Check for fmtstr = "... \n"
fn has_newline_end(args: &HirVec<Expr>, fmtstr: InternedString, fmtlen: usize) -> bool {
fn has_newline_end(args: &HirVec<Expr>, fmtstr: LocalInternedString, fmtlen: usize) -> bool {
if_chain! {
// check the final format string part
if let Some('\n') = fmtstr.chars().last();
@@ -407,7 +407,7 @@ fn has_newline_end(args: &HirVec<Expr>, fmtstr: InternedString, fmtlen: usize) -
}
/// Check for writeln!(v, "") / println!("")
fn has_empty_arg<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, fmtstr: InternedString, fmtlen: usize) -> Option<Span> {
fn has_empty_arg<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, fmtstr: LocalInternedString, fmtlen: usize) -> Option<Span> {
if_chain! {
// check that the string is empty
if fmtlen == 1;
@@ -427,7 +427,7 @@ fn has_empty_arg<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, fmtstr: Inter
}
/// Returns the slice of format string parts in an `Arguments::new_v1` call.
fn get_argument_fmtstr_parts(expr: &Expr) -> Option<(InternedString, usize)> {
fn get_argument_fmtstr_parts(expr: &Expr) -> Option<(LocalInternedString, usize)> {
if_chain! {
if let ExprAddrOf(_, ref expr) = expr.node; // &["…", "…", …]
if let ExprArray(ref exprs) = expr.node;
ProTip! Use n and p to navigate between commits in a pull request.