Skip to content

Commit f03704b

Browse files
committed
Transition librustc_traits to 2018 edition
1 parent b139669 commit f03704b

11 files changed

+20
-23
lines changed

src/librustc_traits/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
authors = ["The Rust Project Developers"]
33
name = "rustc_traits"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "rustc_traits"

src/librustc_traits/chalk_context/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ type ChalkHhGoal<'tcx> = HhGoal<ChalkArenas<'tcx>>;
502502
type ChalkExClause<'tcx> = ExClause<ChalkArenas<'tcx>>;
503503

504504
impl Debug for ChalkContext<'cx, 'gcx> {
505-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
505+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
506506
write!(f, "ChalkContext")
507507
}
508508
}
509509

510510
impl Debug for ChalkInferenceContext<'cx, 'gcx, 'tcx> {
511-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
511+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
512512
write!(f, "ChalkInferenceContext")
513513
}
514514
}
@@ -658,7 +658,7 @@ impl<'tcx, 'gcx: 'tcx, T> Upcast<'tcx, 'gcx> for Canonical<'gcx, T>
658658
}
659659
}
660660

661-
crate fn provide(p: &mut Providers) {
661+
crate fn provide(p: &mut Providers<'_>) {
662662
*p = Providers {
663663
evaluate_goal,
664664
..*p

src/librustc_traits/chalk_context/program_clauses.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fn wf_clause_for_slice<'tcx>(tcx: ty::TyCtxt<'_, '_, 'tcx>) -> Clauses<'tcx> {
220220
def_id: sized_trait,
221221
substs: tcx.mk_substs_trait(ty, ty::List::empty()),
222222
};
223-
let sized_implemented: DomainGoal = ty::TraitPredicate {
223+
let sized_implemented: DomainGoal<'_> = ty::TraitPredicate {
224224
trait_ref: sized_implemented
225225
}.lower();
226226

@@ -252,7 +252,7 @@ fn wf_clause_for_array<'tcx>(
252252
def_id: sized_trait,
253253
substs: tcx.mk_substs_trait(ty, ty::List::empty()),
254254
};
255-
let sized_implemented: DomainGoal = ty::TraitPredicate {
255+
let sized_implemented: DomainGoal<'_> = ty::TraitPredicate {
256256
trait_ref: sized_implemented
257257
}.lower();
258258

@@ -326,7 +326,7 @@ fn wf_clause_for_ref<'tcx>(
326326
mutbl,
327327
});
328328

329-
let _outlives: DomainGoal = ty::OutlivesPredicate(ty, region).lower();
329+
let _outlives: DomainGoal<'_> = ty::OutlivesPredicate(ty, region).lower();
330330
let wf_clause = ProgramClause {
331331
goal: DomainGoal::WellFormed(WellFormed::Ty(ref_ty)),
332332
hypotheses: ty::List::empty(),

src/librustc_traits/dropck_outlives.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc::util::nodemap::FxHashSet;
1010
use rustc_data_structures::sync::Lrc;
1111
use syntax::source_map::{Span, DUMMY_SP};
1212

13-
crate fn provide(p: &mut Providers) {
13+
crate fn provide(p: &mut Providers<'_>) {
1414
*p = Providers {
1515
dropck_outlives,
1616
adt_dtorck_constraint,
@@ -305,7 +305,7 @@ crate fn adt_dtorck_constraint<'a, 'tcx>(
305305
let mut result = def.all_fields()
306306
.map(|field| tcx.type_of(field.did))
307307
.map(|fty| dtorck_constraint_for_ty(tcx, span, fty, 0, fty))
308-
.collect::<Result<DtorckConstraint, NoSolution>>()?;
308+
.collect::<Result<DtorckConstraint<'_>, NoSolution>>()?;
309309
result.outlives.extend(tcx.destructor_constraints(def));
310310
dedup_dtorck_constraint(&mut result);
311311

src/librustc_traits/evaluate_obligation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc::ty::query::Providers;
66
use rustc::ty::{ParamEnvAnd, TyCtxt};
77
use syntax::source_map::DUMMY_SP;
88

9-
crate fn provide(p: &mut Providers) {
9+
crate fn provide(p: &mut Providers<'_>) {
1010
*p = Providers {
1111
evaluate_obligation,
1212
..*p

src/librustc_traits/implied_outlives_bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc::traits::FulfillmentContext;
1717

1818
use rustc_data_structures::sync::Lrc;
1919

20-
crate fn provide(p: &mut Providers) {
20+
crate fn provide(p: &mut Providers<'_>) {
2121
*p = Providers {
2222
implied_outlives_bounds,
2323
..*p

src/librustc_traits/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
//! New recursive solver modeled on Chalk's recursive solver. Most of
22
//! the guts are broken up into modules; see the comments in those modules.
33
4+
#![deny(rust_2018_idioms)]
5+
46
#![feature(crate_visibility_modifier)]
57
#![feature(in_band_lifetimes)]
68
#![feature(nll)]
79

810
#![recursion_limit="256"]
911

10-
extern crate chalk_engine;
1112
#[macro_use]
1213
extern crate log;
1314
#[macro_use]
1415
extern crate rustc;
15-
extern crate rustc_data_structures;
16-
extern crate rustc_target;
17-
extern crate syntax;
18-
extern crate syntax_pos;
19-
extern crate smallvec;
2016

2117
mod chalk_context;
2218
mod dropck_outlives;
@@ -30,7 +26,7 @@ mod type_op;
3026

3127
use rustc::ty::query::Providers;
3228

33-
pub fn provide(p: &mut Providers) {
29+
pub fn provide(p: &mut Providers<'_>) {
3430
dropck_outlives::provide(p);
3531
evaluate_obligation::provide(p);
3632
implied_outlives_bounds::provide(p);

src/librustc_traits/lowering/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use syntax::ast;
2323

2424
use std::iter;
2525

26-
crate fn provide(p: &mut Providers) {
26+
crate fn provide(p: &mut Providers<'_>) {
2727
*p = Providers {
2828
program_clauses_for,
2929
program_clauses_for_env: environment::program_clauses_for_env,
@@ -193,7 +193,7 @@ fn program_clauses_for_trait<'a, 'tcx>(
193193
};
194194

195195
// `Implemented(Self: Trait<P1..Pn>)`
196-
let impl_trait: DomainGoal = trait_pred.lower();
196+
let impl_trait: DomainGoal<'_> = trait_pred.lower();
197197

198198
// `FromEnv(Self: Trait<P1..Pn>)`
199199
let from_env_goal = tcx.mk_goal(impl_trait.into_from_env_goal().into_goal());
@@ -575,7 +575,7 @@ pub fn program_clauses_for_associated_type_value<'a, 'tcx>(
575575
let ty = tcx.type_of(item_id);
576576

577577
// `Implemented(A0: Trait<A1..An>)`
578-
let trait_implemented: DomainGoal = ty::TraitPredicate { trait_ref }.lower();
578+
let trait_implemented: DomainGoal<'_> = ty::TraitPredicate { trait_ref }.lower();
579579

580580
// `<A0 as Trait<A1..An>>::AssocType<Pn+1..Pm>`
581581
let projection_ty = ty::ProjectionTy::from_ref_and_name(tcx, trait_ref, item.ident);

src/librustc_traits/normalize_erasing_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc::ty::query::Providers;
44
use rustc::ty::{self, ParamEnvAnd, Ty, TyCtxt};
55
use std::sync::atomic::Ordering;
66

7-
crate fn provide(p: &mut Providers) {
7+
crate fn provide(p: &mut Providers<'_>) {
88
*p = Providers {
99
normalize_ty_after_erasing_regions,
1010
..*p

src/librustc_traits/normalize_projection_ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::atomic::Ordering;
88
use syntax::ast::DUMMY_NODE_ID;
99
use syntax_pos::DUMMY_SP;
1010

11-
crate fn provide(p: &mut Providers) {
11+
crate fn provide(p: &mut Providers<'_>) {
1212
*p = Providers {
1313
normalize_projection_ty,
1414
..*p

src/librustc_traits/type_op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::fmt;
2121
use syntax::ast;
2222
use syntax_pos::DUMMY_SP;
2323

24-
crate fn provide(p: &mut Providers) {
24+
crate fn provide(p: &mut Providers<'_>) {
2525
*p = Providers {
2626
type_op_ascribe_user_type,
2727
type_op_eq,

0 commit comments

Comments
 (0)