Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6ea6e62
Update jemalloc-sys to version 0.3.0
gnzlbg Mar 26, 2019
b73886d
Update Cargo.lock
gnzlbg Mar 26, 2019
c728ae0
Update rustfmt to 1.2.0
topecongiro Mar 27, 2019
d59b46f
Add a test
taiki-e Mar 27, 2019
4d648ce
Better diagnostic for binary operation on BoxedValues
hgallagher1993 Mar 27, 2019
5113e73
Update books
ehuss Mar 22, 2019
b3011dd
Visit ItemKind::Impl for dead code lint
varkor Mar 28, 2019
40db575
Add a regression test for #47131
varkor Mar 28, 2019
0acb786
Do not suggest borrowing when the span comes from a macro
estebank Mar 28, 2019
925ca49
Add test
estebank Mar 28, 2019
326ec80
Account for fully overlapping multiline annotations
estebank Mar 28, 2019
81402db
Update stdsimd
gnzlbg Mar 28, 2019
7a5c82d
Add edition-guide to toolstate.
ehuss Mar 28, 2019
4644c3a
Add check for when left and right overlap and change span for explana…
hgallagher1993 Mar 28, 2019
8cdfad9
Walk all items for dead_code lint by default
varkor Mar 28, 2019
44813df
Rename `type_parameters` to `generics` and so on
varkor Mar 29, 2019
e13e9a5
review comments
estebank Mar 29, 2019
8fad69c
Add comemnts clarifying logic
estebank Mar 29, 2019
b5690c2
Fix MultilineAnnotation field name
estebank Mar 29, 2019
362d243
Fix error in Rust 2018 + no_core environment
taiki-e Mar 29, 2019
972a8ce
Rollup merge of #59366 - ehuss:update-books, r=QuietMisdreavus
Centril Mar 29, 2019
8e0855b
Rollup merge of #59436 - gnzlbg:update_jemalloc, r=alexcrichton
Centril Mar 29, 2019
38af98e
Rollup merge of #59454 - topecongiro:rustfmt-1.2.0, r=nrc
Centril Mar 29, 2019
647d09f
Rollup merge of #59462 - taiki-e:no-core, r=petrochenkov
Centril Mar 29, 2019
fda2066
Rollup merge of #59467 - hgallagher1993:local_branch, r=estebank
Centril Mar 29, 2019
c105f34
Rollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwco
Centril Mar 29, 2019
ee17267
Rollup merge of #59480 - gnzlbg:us, r=alexcrichton
Centril Mar 29, 2019
4aacc49
Rollup merge of #59486 - varkor:dead-code-impl, r=sanxiyn
Centril Mar 29, 2019
99e886d
Rollup merge of #59510 - varkor:rename-type_parameters, r=eddyb
Centril Mar 29, 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
Prev Previous commit
Next Next commit
Rename type_parameters to generics and so on
  • Loading branch information
varkor committed Mar 29, 2019
commit 44813dfcb68c670f6ff8b7d79cea5f75b9f02ab9
16 changes: 8 additions & 8 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,30 +485,30 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
ItemKind::GlobalAsm(_) => {
visitor.visit_id(item.hir_id);
}
ItemKind::Ty(ref typ, ref type_parameters) => {
ItemKind::Ty(ref ty, ref generics) => {
visitor.visit_id(item.hir_id);
visitor.visit_ty(typ);
visitor.visit_generics(type_parameters)
visitor.visit_ty(ty);
visitor.visit_generics(generics)
}
ItemKind::Existential(ExistTy { ref generics, ref bounds, impl_trait_fn: _ }) => {
visitor.visit_id(item.hir_id);
walk_generics(visitor, generics);
walk_list!(visitor, visit_param_bound, bounds);
}
ItemKind::Enum(ref enum_definition, ref type_parameters) => {
visitor.visit_generics(type_parameters);
ItemKind::Enum(ref enum_definition, ref generics) => {
visitor.visit_generics(generics);
// `visit_enum_def()` takes care of visiting the `Item`'s `HirId`.
visitor.visit_enum_def(enum_definition, type_parameters, item.hir_id, item.span)
visitor.visit_enum_def(enum_definition, generics, item.hir_id, item.span)
}
ItemKind::Impl(
..,
ref type_parameters,
ref generics,
ref opt_trait_reference,
ref typ,
ref impl_item_refs
) => {
visitor.visit_id(item.hir_id);
visitor.visit_generics(type_parameters);
visitor.visit_generics(generics);
walk_list!(visitor, visit_trait_ref, opt_trait_reference);
visitor.visit_ty(typ);
walk_list!(visitor, visit_impl_item_ref, impl_item_refs);
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/monomorphize/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ impl<'b, 'a, 'v> ItemLikeVisitor<'v> for RootCollector<'b, 'a, 'v> {

impl<'b, 'a, 'v> RootCollector<'b, 'a, 'v> {
fn is_root(&self, def_id: DefId) -> bool {
!item_has_type_parameters(self.tcx, def_id) && match self.mode {
!item_requires_monomorphization(self.tcx, def_id) && match self.mode {
MonoItemCollectionMode::Eager => {
true
}
Expand Down Expand Up @@ -1101,7 +1101,7 @@ impl<'b, 'a, 'v> RootCollector<'b, 'a, 'v> {
}
}

fn item_has_type_parameters<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> bool {
fn item_requires_monomorphization<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> bool {
let generics = tcx.generics_of(def_id);
generics.requires_monomorphization(tcx)
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
fn process_impl(
&mut self,
item: &'l ast::Item,
type_parameters: &'l ast::Generics,
generics: &'l ast::Generics,
trait_ref: &'l Option<ast::TraitRef>,
typ: &'l ast::Ty,
impl_items: &'l [ast::ImplItem],
Expand All @@ -678,7 +678,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
if let &Some(ref trait_ref) = trait_ref {
self.process_path(trait_ref.ref_id, &trait_ref.path);
}
self.process_generic_params(type_parameters, "", item.id);
self.process_generic_params(generics, "", item.id);
for impl_item in impl_items {
let map = &self.tcx.hir();
self.process_impl_item(impl_item, map.local_def_id(item.id));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
Neither if self.type_var_diverges(ty) => self.tcx.mk_diverging_default(),
Neither => return false,
};
debug!("default_type_parameters: defaulting `{:?}` to `{:?}`", ty, fallback);
debug!("fallback_if_possible: defaulting `{:?}` to `{:?}`", ty, fallback);
self.demand_eqtype(syntax_pos::DUMMY_SP, ty, fallback);
true
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/wfcheck.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::check::{Inherited, FnCtxt};
use crate::constrained_type_params::{identify_constrained_type_params, Parameter};
use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter};

use crate::hir::def_id::DefId;
use rustc::traits::{self, ObligationCauseCode};
Expand Down Expand Up @@ -941,7 +941,7 @@ fn check_variances_for_type_defn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
.map(|(index, _)| Parameter(index as u32))
.collect();

identify_constrained_type_params(tcx,
identify_constrained_generic_params(tcx,
&ty_predicates,
None,
&mut constrained_parameters);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! crate as a kind of pass. This should eventually be factored away.

use crate::astconv::{AstConv, Bounds};
use crate::constrained_type_params as ctp;
use crate::constrained_generic_params as ctp;
use crate::check::intrinsic::intrisic_operation_unsafety;
use crate::lint;
use crate::middle::lang_items::SizedTraitLangItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
}
}

pub fn identify_constrained_type_params<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>,
pub fn identify_constrained_generic_params<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>,
predicates: &ty::GenericPredicates<'tcx>,
impl_trait_ref: Option<ty::TraitRef<'tcx>>,
input_parameters: &mut FxHashSet<Parameter>)
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/impl_wf_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! specialization errors. These things can (and probably should) be
//! fixed, but for the moment it's easier to do these checks early.
use crate::constrained_type_params as ctp;
use crate::constrained_generic_params as ctp;
use rustc::hir;
use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::def_id::DefId;
Expand Down Expand Up @@ -103,7 +103,7 @@ fn enforce_impl_params_are_constrained<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let impl_trait_ref = tcx.impl_trait_ref(impl_def_id);

let mut input_parameters = ctp::parameters_for_impl(impl_self_ty, impl_trait_ref);
ctp::identify_constrained_type_params(
ctp::identify_constrained_generic_params(
tcx, &impl_predicates, impl_trait_ref, &mut input_parameters);

// Disallow unconstrained lifetimes, but only if they appear in assoc types.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mod check;
mod check_unused;
mod coherence;
mod collect;
mod constrained_type_params;
mod constrained_generic_params;
mod structured_errors;
mod impl_wf_check;
mod namespace;
Expand Down
18 changes: 9 additions & 9 deletions src/libsyntax/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,24 +244,24 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
walk_list!(visitor, visit_foreign_item, &foreign_module.items);
}
ItemKind::GlobalAsm(ref ga) => visitor.visit_global_asm(ga),
ItemKind::Ty(ref typ, ref type_parameters) => {
ItemKind::Ty(ref typ, ref generics) => {
visitor.visit_ty(typ);
visitor.visit_generics(type_parameters)
visitor.visit_generics(generics)
}
ItemKind::Existential(ref bounds, ref type_parameters) => {
ItemKind::Existential(ref bounds, ref generics) => {
walk_list!(visitor, visit_param_bound, bounds);
visitor.visit_generics(type_parameters)
visitor.visit_generics(generics)
}
ItemKind::Enum(ref enum_definition, ref type_parameters) => {
visitor.visit_generics(type_parameters);
visitor.visit_enum_def(enum_definition, type_parameters, item.id, item.span)
ItemKind::Enum(ref enum_definition, ref generics) => {
visitor.visit_generics(generics);
visitor.visit_enum_def(enum_definition, generics, item.id, item.span)
}
ItemKind::Impl(_, _, _,
ref type_parameters,
ref generics,
ref opt_trait_reference,
ref typ,
ref impl_items) => {
visitor.visit_generics(type_parameters);
visitor.visit_generics(generics);
walk_list!(visitor, visit_trait_ref, opt_trait_reference);
visitor.visit_ty(typ);
walk_list!(visitor, visit_impl_item, impl_items);
Expand Down