Skip to content
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

Rollup of 5 pull requests #67455

Merged
merged 43 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d419a5f
Fix pointing at arg when cause is outside of call
VirrageS Dec 1, 2019
e305bf8
Rename tests and add short test description
VirrageS Dec 3, 2019
c4bbe9c
Alias `TraitItem` & `ImplItem`.
Centril Nov 30, 2019
73557fa
Use `Option` in `ImplItemKind::Const`.
Centril Dec 1, 2019
f6403c6
Use `Option` in `ImplItemKind::Method`.
Centril Dec 1, 2019
c02fd31
`TraitItemKind::Type` -> `TraitItemKind::TyAlias`.
Centril Dec 1, 2019
3907376
Unify `{Trait,Impl}ItemKind::TyAlias` structures.
Centril Dec 1, 2019
92a372b
Unify `{Impl,Trait}Item` as `AssocItem`.
Centril Dec 1, 2019
2d92aa5
Fuse associated constant parsing.
Centril Dec 1, 2019
10270bc
Fuse associated type parsing.
Centril Dec 1, 2019
7672bff
Unify associated function parsing.
Centril Dec 1, 2019
63a9030
Unify associated item parsing.
Centril Dec 1, 2019
fa828d7
Relocate `is_const_item`.
Centril Dec 1, 2019
404013e
Leave a FIXME re. `allow_plus`.
Centril Dec 1, 2019
34d9170
parse: refactor fun ret ty & param ty
Centril Dec 1, 2019
9193d7a
Unify associated item pretty printing.
Centril Dec 1, 2019
76576d4
Unify associated item mut visitors.
Centril Dec 1, 2019
c6c17e3
Simplify `nt_to_tokenstream`.
Centril Dec 1, 2019
0d8a9d7
Unify associated item visitor.
Centril Dec 1, 2019
51ccdeb
Unify associated item parsing more.
Centril Dec 1, 2019
b499a88
Unify assoc item visitors more.
Centril Dec 2, 2019
0d41d0f
Move `allow_c_varadic` logic to `ast_validation`.
Centril Dec 2, 2019
3a57a2c
`ast_validation`: move trait item logic to proper place.
Centril Dec 2, 2019
35e9e09
More c-variadic errors as semantic restrictions.
Centril Dec 2, 2019
abf2e7a
Remove `ast::{Impl,Trait}{Item,ItemKind}`.
Centril Dec 7, 2019
e52f902
`AssocImplKind::{Method -> Fn}`.
Centril Dec 7, 2019
74d4fbc
De-fatalize `...` parsing.
Centril Dec 8, 2019
054458b
make visitor uses more robust
Centril Dec 11, 2019
2d8d813
Update tokio crates to latest versions
mati865 Dec 4, 2019
aa0ef5a
Fix handling of wasm import modules and names
alexcrichton Dec 16, 2019
3a19fbf
Add Rvalue::AddressOf to MIR
matthewjasper Dec 23, 2018
35919ac
Start generating AddressOf rvalues in MIR
matthewjasper Apr 20, 2019
5fb797c
Make slice drop shims use AddressOf
matthewjasper Apr 20, 2019
7081c79
Add mir opt test for AddressOf
matthewjasper Apr 20, 2019
7b0cc6a
Check const-propagation of borrows of unsized places
matthewjasper Sep 17, 2019
1593194
Update test now that reference to pointer casts have more checks
matthewjasper Sep 17, 2019
6dcc789
Add more tests for raw_ref_op
matthewjasper Sep 18, 2019
a749116
Fix comment ordering
matthewjasper Dec 2, 2019
ef01330
Rollup merge of #64588 - matthewjasper:mir-address-of, r=oli-obk
Centril Dec 20, 2019
ba1a488
Rollup merge of #67031 - mati865:tokio-update, r=nikomatsakis
Centril Dec 20, 2019
ec82174
Rollup merge of #67131 - Centril:item-merge, r=petrochenkov
Centril Dec 20, 2019
5a8083c
Rollup merge of #67354 - VirrageS:blame-wrong-line, r=estebank
Centril Dec 20, 2019
43d1532
Rollup merge of #67363 - alexcrichton:wasm-import-modules, r=eddyb
Centril Dec 20, 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
TraitItemKind::Type -> TraitItemKind::TyAlias.
  • Loading branch information
Centril committed Dec 12, 2019
commit c02fd3130284921f7077f78271b5501b402ec469
4 changes: 2 additions & 2 deletions src/librustc/hir/lowering/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ impl LoweringContext<'_> {
);
(generics, hir::TraitItemKind::Method(sig, hir::TraitMethod::Provided(body_id)))
}
TraitItemKind::Type(ref bounds, ref default) => {
TraitItemKind::TyAlias(ref bounds, ref default) => {
let generics = self.lower_generics(&i.generics, ImplTraitContext::disallowed());
let kind = hir::TraitItemKind::Type(
self.lower_param_bounds(bounds, ImplTraitContext::disallowed()),
Expand Down Expand Up @@ -877,7 +877,7 @@ impl LoweringContext<'_> {
TraitItemKind::Const(_, ref default) => {
(hir::AssocItemKind::Const, default.is_some())
}
TraitItemKind::Type(_, ref default) => {
TraitItemKind::TyAlias(_, ref default) => {
(hir::AssocItemKind::Type, default.is_some())
}
TraitItemKind::Method(ref sig, ref default) => (
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_parse/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ impl<'a> Parser<'a> {
};
self.expect_semi()?;

Ok((ident, TraitItemKind::Type(bounds, default), generics))
Ok((ident, TraitItemKind::TyAlias(bounds, default), generics))
}

/// Parses a `UseTree`.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
}
(Res::Def(DefKind::Method, item_def_id), ValueNS)
}
TraitItemKind::Type(..) => (Res::Def(DefKind::AssocTy, item_def_id), TypeNS),
TraitItemKind::TyAlias(..) => (Res::Def(DefKind::AssocTy, item_def_id), TypeNS),
TraitItemKind::Macro(_) => bug!(), // handled above
};

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/def_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
let def_data = match ti.kind {
TraitItemKind::Method(..) | TraitItemKind::Const(..) =>
DefPathData::ValueNs(ti.ident.name),
TraitItemKind::Type(..) => {
TraitItemKind::TyAlias(..) => {
DefPathData::TypeNs(ti.ident.name)
},
TraitItemKind::Macro(..) => return self.visit_macro_invoc(ti.id),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_resolve/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
TraitItemKind::Method(_, _) => {
visit::walk_trait_item(this, trait_item)
}
TraitItemKind::Type(..) => {
TraitItemKind::TyAlias(..) => {
visit::walk_trait_item(this, trait_item)
}
TraitItemKind::Macro(_) => {
Expand Down Expand Up @@ -995,7 +995,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
let trait_assoc_types = replace(
&mut self.diagnostic_metadata.current_trait_assoc_types,
trait_items.iter().filter_map(|item| match &item.kind {
TraitItemKind::Type(bounds, _) if bounds.len() == 0 => Some(item.ident),
TraitItemKind::TyAlias(bounds, _) if bounds.len() == 0 => Some(item.ident),
_ => None,
}).collect(),
);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
trait_item.span,
);
}
ast::TraitItemKind::Type(ref bounds, ref default_ty) => {
ast::TraitItemKind::TyAlias(ref bounds, ref default_ty) => {
// FIXME do something with _bounds (for type refs)
let name = trait_item.ident.name.to_string();
let qualname = format!("::{}",
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ pub type TraitItem = ImplItem<TraitItemKind>;
pub enum TraitItemKind {
Const(P<Ty>, Option<P<Expr>>),
Method(FnSig, Option<P<Block>>),
Type(GenericBounds, Option<P<Ty>>),
TyAlias(GenericBounds, Option<P<Ty>>),
Macro(Mac),
}

Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
gate_feature_post!(&self, const_fn, ti.span, "const fn is unstable");
}
}
ast::TraitItemKind::Type(_, ref default) => {
ast::TraitItemKind::TyAlias(_, ref default) => {
if let Some(ty) = default {
self.check_impl_trait(ty);
gate_feature_post!(&self, associated_type_defaults, ti.span,
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/mut_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ pub fn noop_flat_map_trait_item<T: MutVisitor>(mut item: TraitItem, visitor: &mu
visit_fn_sig(sig, visitor);
visit_opt(body, |body| visitor.visit_block(body));
}
TraitItemKind::Type(bounds, default) => {
TraitItemKind::TyAlias(bounds, default) => {
visit_bounds(bounds, visitor);
visit_opt(default, |default| visitor.visit_ty(default));
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ impl<'a> State<'a> {
self.s.word(";");
}
}
ast::TraitItemKind::Type(ref bounds, ref default) => {
ast::TraitItemKind::TyAlias(ref bounds, ref default) => {
self.print_associated_type(ti.ident, Some(bounds),
default.as_ref().map(|ty| &**ty));
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ pub fn walk_trait_item<'a, V: Visitor<'a>>(visitor: &mut V, trait_item: &'a Trai
visitor.visit_fn(FnKind::Method(trait_item.ident, sig, &trait_item.vis, body),
&sig.decl, trait_item.span, trait_item.id);
}
TraitItemKind::Type(ref bounds, ref default) => {
TraitItemKind::TyAlias(ref bounds, ref default) => {
walk_list!(visitor, visit_param_bound, bounds);
walk_list!(visitor, visit_ty, default);
}
Expand Down