Skip to content

Commit 4d406cd

Browse files
committed
Rustup to rustc 1.37.0-nightly (0dc9e9c10 2019-06-15)
1 parent 80ab0ca commit 4d406cd

11 files changed

+50
-73
lines changed

patches/0016-Apply-rust-lang-pr61828.patch

-23
This file was deleted.

src/abi.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn scalar_to_clif_type(tcx: TyCtxt, scalar: Scalar) -> Type {
4040
}
4141

4242
fn get_pass_mode<'tcx>(
43-
tcx: TyCtxt<'tcx, 'tcx>,
43+
tcx: TyCtxt<'tcx>,
4444
ty: Ty<'tcx>,
4545
) -> PassMode {
4646
let layout = tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap();
@@ -76,7 +76,7 @@ fn adjust_arg_for_abi<'a, 'tcx: 'a>(
7676
}
7777
}
7878

79-
fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, sig: FnSig<'tcx>) -> Signature {
79+
fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx>, sig: FnSig<'tcx>) -> Signature {
8080
let (call_conv, inputs, output): (CallConv, Vec<Ty>, Ty) = match sig.abi {
8181
Abi::Rust => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
8282
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
@@ -129,7 +129,7 @@ fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, sig: FnSig<'tcx>) -> Sign
129129
}
130130

131131
pub fn get_function_name_and_sig<'tcx>(
132-
tcx: TyCtxt<'tcx, 'tcx>,
132+
tcx: TyCtxt<'tcx>,
133133
inst: Instance<'tcx>,
134134
support_vararg: bool,
135135
) -> (String, Signature) {
@@ -144,7 +144,7 @@ pub fn get_function_name_and_sig<'tcx>(
144144

145145
/// Instance must be monomorphized
146146
pub fn import_function<'tcx>(
147-
tcx: TyCtxt<'tcx, 'tcx>,
147+
tcx: TyCtxt<'tcx>,
148148
module: &mut Module<impl Backend>,
149149
inst: Instance<'tcx>,
150150
) -> FuncId {

src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
1818
// Check sig for u128 and i128
1919
let fn_sig = tcx.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &instance.fn_sig(tcx));
2020

21-
struct UI128Visitor<'tcx>(TyCtxt<'tcx, 'tcx>, bool);
21+
struct UI128Visitor<'tcx>(TyCtxt<'tcx>, bool);
2222

2323
impl<'tcx> rustc::ty::fold::TypeVisitor<'tcx> for UI128Visitor<'tcx> {
2424
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {

src/common.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub fn pointer_ty(tcx: TyCtxt) -> types::Type {
1717
}
1818
}
1919

20-
pub fn clif_type_from_ty<'a, 'tcx: 'a>(
21-
tcx: TyCtxt<'tcx, 'tcx>,
20+
pub fn clif_type_from_ty<'tcx>(
21+
tcx: TyCtxt<'tcx>,
2222
ty: Ty<'tcx>,
2323
) -> Option<types::Type> {
2424
Some(match ty.sty {
@@ -95,7 +95,7 @@ pub fn clif_intcast<'a, 'tcx: 'a>(
9595

9696
pub struct FunctionCx<'a, 'tcx: 'a, B: Backend> {
9797
// FIXME use a reference to `CodegenCx` instead of `tcx`, `module` and `constants` and `caches`
98-
pub tcx: TyCtxt<'tcx, 'tcx>,
98+
pub tcx: TyCtxt<'tcx>,
9999
pub module: &'a mut Module<B>,
100100
pub pointer_type: Type, // Cached from module
101101

@@ -123,7 +123,7 @@ impl<'a, 'tcx: 'a, B: Backend> LayoutOf for FunctionCx<'a, 'tcx, B> {
123123
}
124124

125125
impl<'a, 'tcx, B: Backend + 'a> layout::HasTyCtxt<'tcx> for FunctionCx<'a, 'tcx, B> {
126-
fn tcx<'b>(&'b self) -> TyCtxt<'tcx, 'tcx> {
126+
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
127127
self.tcx
128128
}
129129
}

src/constant.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ enum TodoItem {
2626
}
2727

2828
impl ConstantCx {
29-
pub fn finalize<'a, 'tcx: 'a, B: Backend>(
29+
pub fn finalize(
3030
mut self,
31-
tcx: TyCtxt<'tcx, 'tcx>,
32-
module: &mut Module<B>,
31+
tcx: TyCtxt<'_>,
32+
module: &mut Module<impl Backend>,
3333
) {
3434
//println!("todo {:?}", self.todo);
3535
define_all_allocs(tcx, module, &mut self);
@@ -38,7 +38,7 @@ impl ConstantCx {
3838
}
3939
}
4040

41-
pub fn codegen_static<'a, 'tcx: 'a>(ccx: &mut ConstantCx, def_id: DefId) {
41+
pub fn codegen_static(ccx: &mut ConstantCx, def_id: DefId) {
4242
ccx.todo.insert(TodoItem::Static(def_id));
4343
}
4444

@@ -177,15 +177,15 @@ fn trans_const_place<'a, 'tcx: 'a>(
177177
cplace_for_dataid(fx, const_.ty, data_id)
178178
}
179179

180-
fn data_id_for_alloc_id<B: Backend>(module: &mut Module<B>, alloc_id: AllocId) -> DataId {
180+
fn data_id_for_alloc_id(module: &mut Module<impl Backend>, alloc_id: AllocId) -> DataId {
181181
module
182182
.declare_data(&format!("__alloc_{}", alloc_id.0), Linkage::Local, false, None)
183183
.unwrap()
184184
}
185185

186-
fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
187-
tcx: TyCtxt<'tcx, 'tcx>,
188-
module: &mut Module<B>,
186+
fn data_id_for_static(
187+
tcx: TyCtxt<'_>,
188+
module: &mut Module<impl Backend>,
189189
def_id: DefId,
190190
linkage: Linkage,
191191
) -> DataId {
@@ -237,9 +237,9 @@ fn cplace_for_dataid<'a, 'tcx: 'a>(
237237
CPlace::for_addr(global_ptr, layout)
238238
}
239239

240-
fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
241-
tcx: TyCtxt<'tcx, 'tcx>,
242-
module: &mut Module<B>,
240+
fn define_all_allocs(
241+
tcx: TyCtxt<'_>,
242+
module: &mut Module<impl Backend>,
243243
cx: &mut ConstantCx,
244244
) {
245245
let memory = Memory::<TransPlaceInterpreter>::new(tcx.at(DUMMY_SP));
@@ -374,7 +374,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
374374

375375
fn find_foreign_static(
376376
_: DefId,
377-
_: ::rustc::ty::query::TyCtxtAt<'tcx, 'tcx>,
377+
_: ::rustc::ty::query::TyCtxtAt<'tcx>,
378378
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
379379
panic!();
380380
}

src/debuginfo.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub struct DebugContext<'tcx> {
9292
_dummy: PhantomData<&'tcx ()>,
9393
}
9494

95-
impl<'a, 'tcx: 'a> DebugContext<'tcx> {
95+
impl<'tcx> DebugContext<'tcx> {
9696
pub fn new(tcx: TyCtxt, address_size: u8) -> Self {
9797
let encoding = Encoding {
9898
format: Format::Dwarf32,
@@ -155,7 +155,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
155155
}
156156
}
157157

158-
fn emit_location(&mut self, tcx: TyCtxt<'tcx, 'tcx>, entry_id: UnitEntryId, span: Span) {
158+
fn emit_location(&mut self, tcx: TyCtxt<'tcx>, entry_id: UnitEntryId, span: Span) {
159159
let loc = tcx.sess.source_map().lookup_char_pos(span.lo());
160160

161161
let file_id = line_program_add_file(
@@ -230,9 +230,9 @@ pub struct FunctionDebugContext<'a, 'tcx> {
230230
mir_span: Span,
231231
}
232232

233-
impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
233+
impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
234234
pub fn new(
235-
tcx: TyCtxt<'tcx, 'tcx>,
235+
tcx: TyCtxt<'tcx>,
236236
debug_context: &'a mut DebugContext<'tcx>,
237237
mir: &Body,
238238
name: &str,

src/driver.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use cranelift_faerie::*;
1313

1414
use crate::prelude::*;
1515

16-
pub fn codegen_crate<'a, 'tcx>(
17-
tcx: TyCtxt<'tcx, 'tcx>,
16+
pub fn codegen_crate(
17+
tcx: TyCtxt<'_>,
1818
metadata: EncodedMetadata,
1919
need_metadata_module: bool,
2020
) -> Box<dyn Any> {
@@ -45,7 +45,7 @@ pub fn codegen_crate<'a, 'tcx>(
4545
}
4646

4747
#[cfg(not(target_arch = "wasm32"))]
48-
fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, log: &mut Option<File>) -> ! {
48+
fn run_jit(tcx: TyCtxt<'_>, log: &mut Option<File>) -> ! {
4949
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
5050

5151
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new(
@@ -95,8 +95,8 @@ fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, log: &mut Option<File>) -> ! {
9595
std::process::exit(ret);
9696
}
9797

98-
fn run_aot<'a, 'tcx: 'a>(
99-
tcx: TyCtxt<'tcx, 'tcx>,
98+
fn run_aot(
99+
tcx: TyCtxt<'_>,
100100
metadata: EncodedMetadata,
101101
need_metadata_module: bool,
102102
log: &mut Option<File>,
@@ -224,8 +224,8 @@ fn run_aot<'a, 'tcx: 'a>(
224224
})
225225
}
226226

227-
fn codegen_cgus<'a, 'tcx: 'a>(
228-
tcx: TyCtxt<'tcx, 'tcx>,
227+
fn codegen_cgus<'tcx>(
228+
tcx: TyCtxt<'tcx>,
229229
module: &mut Module<impl Backend + 'static>,
230230
debug: &mut Option<DebugContext<'tcx>>,
231231
log: &mut Option<File>,
@@ -242,8 +242,8 @@ fn codegen_cgus<'a, 'tcx: 'a>(
242242
crate::main_shim::maybe_create_entry_wrapper(tcx, module);
243243
}
244244

245-
fn codegen_mono_items<'a, 'tcx: 'a>(
246-
tcx: TyCtxt<'tcx, 'tcx>,
245+
fn codegen_mono_items<'tcx>(
246+
tcx: TyCtxt<'tcx>,
247247
module: &mut Module<impl Backend + 'static>,
248248
debug_context: Option<&mut DebugContext<'tcx>>,
249249
log: &mut Option<File>,
@@ -262,7 +262,7 @@ fn codegen_mono_items<'a, 'tcx: 'a>(
262262
});
263263
}
264264

265-
fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
265+
fn trans_mono_item<'clif, 'tcx, B: Backend + 'static>(
266266
cx: &mut crate::CodegenCx<'clif, 'tcx, B>,
267267
mono_item: MonoItem<'tcx>,
268268
linkage: Linkage,

src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub struct Caches<'tcx> {
113113
pub vtables: HashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), DataId>,
114114
}
115115

116-
impl<'tcx> Default for Caches<'tcx> {
116+
impl Default for Caches<'_> {
117117
fn default() -> Self {
118118
Caches {
119119
context: Context::new(),
@@ -123,7 +123,7 @@ impl<'tcx> Default for Caches<'tcx> {
123123
}
124124

125125
pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
126-
tcx: TyCtxt<'tcx, 'tcx>,
126+
tcx: TyCtxt<'tcx>,
127127
module: &'clif mut Module<B>,
128128
ccx: ConstantCx,
129129
caches: Caches<'tcx>,
@@ -132,7 +132,7 @@ pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
132132

133133
impl<'clif, 'tcx, B: Backend + 'static> CodegenCx<'clif, 'tcx, B> {
134134
fn new(
135-
tcx: TyCtxt<'tcx, 'tcx>,
135+
tcx: TyCtxt<'tcx>,
136136
module: &'clif mut Module<B>,
137137
debug_context: Option<&'clif mut DebugContext<'tcx>>,
138138
) -> Self {
@@ -193,9 +193,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
193193
rustc_codegen_ssa::back::symbol_export::provide_extern(providers);
194194
}
195195

196-
fn codegen_crate<'a, 'tcx>(
196+
fn codegen_crate<'tcx>(
197197
&self,
198-
tcx: TyCtxt<'tcx, 'tcx>,
198+
tcx: TyCtxt<'tcx>,
199199
metadata: EncodedMetadata,
200200
need_metadata_module: bool,
201201
_rx: mpsc::Receiver<Box<dyn Any + Send>>,

src/main_shim.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use crate::prelude::*;
22

33
/// Create the `main` function which will initialize the rust runtime and call
44
/// users main function.
5-
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
6-
tcx: TyCtxt<'tcx, 'tcx>,
5+
pub fn maybe_create_entry_wrapper(
6+
tcx: TyCtxt<'_>,
77
module: &mut Module<impl Backend + 'static>,
88
) {
99
use rustc::middle::lang_items::StartFnLangItem;
@@ -22,8 +22,8 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
2222

2323
create_entry_fn(tcx, module, main_def_id, use_start_lang_item);;
2424

25-
fn create_entry_fn<'a, 'tcx: 'a>(
26-
tcx: TyCtxt<'tcx, 'tcx>,
25+
fn create_entry_fn(
26+
tcx: TyCtxt<'_>,
2727
m: &mut Module<impl Backend + 'static>,
2828
rust_main_def_id: DefId,
2929
use_start_lang_item: bool,

src/metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ impl MetadataLoader for CraneliftMetadataLoader {
4848
}
4949

5050
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
51-
pub fn write_metadata<'a, 'gcx>(
52-
tcx: TyCtxt<'gcx, 'gcx>,
51+
pub fn write_metadata(
52+
tcx: TyCtxt<'_>,
5353
artifact: &mut faerie::Artifact
5454
) -> EncodedMetadata {
5555
use std::io::Write;

src/pretty_clif.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct CommentWriter {
7777
}
7878

7979
impl CommentWriter {
80-
pub fn new<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, instance: Instance<'tcx>) -> Self {
80+
pub fn new<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> Self {
8181
CommentWriter {
8282
global_comments: vec![
8383
format!("symbol {}", tcx.symbol_name(instance).as_str()),
@@ -91,7 +91,7 @@ impl CommentWriter {
9191
}
9292
}
9393

94-
impl<'a> FuncWriter for &'a CommentWriter {
94+
impl FuncWriter for &'_ CommentWriter {
9595
fn write_preamble(
9696
&mut self,
9797
w: &mut dyn fmt::Write,
@@ -193,8 +193,8 @@ impl<'a, 'tcx: 'a, B: Backend + 'a> FunctionCx<'a, 'tcx, B> {
193193
}
194194
}
195195

196-
pub fn write_clif_file<'a, 'tcx: 'a>(
197-
tcx: TyCtxt<'tcx, 'tcx>,
196+
pub fn write_clif_file<'tcx>(
197+
tcx: TyCtxt<'tcx>,
198198
postfix: &str,
199199
instance: Instance<'tcx>,
200200
func: &ir::Function,

0 commit comments

Comments
 (0)