Skip to content

Commit 675f4d1

Browse files
committed
Fix warnings
1 parent d629302 commit 675f4d1

26 files changed

+340
-488
lines changed

Cargo.lock

Lines changed: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ path = "tests/lib.rs"
1414
harness = false
1515

1616
[dependencies]
17-
#gccjit = { git = "https://github.com/antoyo/gccjit.rs", branch = "feature/rustc" }
18-
gccjit = { path = "/home/bouanto/Ordinateur/Programmation/Rust/Projets/gccjit.rs" }
17+
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
1918

2019
target-lexicon = "0.10.0"
2120

2221
ar = "0.8.0"
2322

2423
[dependencies.object]
25-
version = "0.18.0"
24+
version = "0.25.0"
2625
default-features = false
27-
features = ["read", "std", "write"] # We don't need WASM support
26+
features = ["read", "std", "write"] # We don't need WASM support.
2827

2928
[dev-dependencies]
3029
lang_tester = "0.3.9"

example/mini_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
407407

408408
#[lang = "panic"]
409409
#[track_caller]
410-
pub fn panic(msg: &str) -> ! {
410+
pub fn panic(_msg: &str) -> ! {
411411
unsafe {
412412
libc::puts("Panicking\n\0" as *const str as *const u8);
413413
intrinsics::abort();

example/mini_core_hello_world.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ pub enum E2<X> {
415415

416416
fn check_niche_behavior () {
417417
if let E1::V2 { .. } = (E1::V1 { f: true }) {
418-
unsafe { intrinsics::abort(); }
418+
intrinsics::abort();
419419
}
420420

421421
if let E2::V1 { .. } = E2::V3::<Infallible> {
422-
unsafe { intrinsics::abort(); }
422+
intrinsics::abort();
423423
}
424424
}

example/std_example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ unsafe fn test_simd() {
132132
assert_eq!(mask1, 1);*/
133133
}*/
134134

135-
#[target_feature(enable = "sse2")]
135+
/*#[target_feature(enable = "sse2")]
136136
unsafe fn test_mm_slli_si128() {
137137
#[rustfmt::skip]
138138
let a = _mm_setr_epi8(
@@ -258,7 +258,7 @@ unsafe fn test_mm_extract_epi8() {
258258
let r2 = _mm_extract_epi8(a, 19);
259259
assert_eq!(r1, 0xFF);
260260
assert_eq!(r2, 3);
261-
}
261+
}*/
262262

263263
#[derive(PartialEq)]
264264
enum LoopState {

example/track-caller-attribute.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
// run-pass
44

5-
#![feature(track_caller)]
6-
75
use std::panic::Location;
86

97
#[track_caller]
@@ -22,21 +20,21 @@ fn nested_tracked() -> &'static Location<'static> {
2220
fn main() {
2321
let location = Location::caller();
2422
assert_eq!(location.file(), file!());
25-
assert_eq!(location.line(), 23);
23+
assert_eq!(location.line(), 21);
2624
assert_eq!(location.column(), 20);
2725

2826
let tracked = tracked();
2927
assert_eq!(tracked.file(), file!());
30-
assert_eq!(tracked.line(), 28);
28+
assert_eq!(tracked.line(), 26);
3129
assert_eq!(tracked.column(), 19);
3230

3331
let nested = nested_intrinsic();
3432
assert_eq!(nested.file(), file!());
35-
assert_eq!(nested.line(), 15);
33+
assert_eq!(nested.line(), 13);
3634
assert_eq!(nested.column(), 5);
3735

3836
let contained = nested_tracked();
3937
assert_eq!(contained.file(), file!());
40-
assert_eq!(contained.line(), 19);
38+
assert_eq!(contained.line(), 17);
4139
assert_eq!(contained.column(), 5);
4240
}

src/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub(crate) unsafe fn codegen(tcx: TyCtxt<'_>, mods: &mut GccContext, kind: Alloc
109109
.enumerate()
110110
.map(|(i, _)| func.get_param(i as i32).to_rvalue())
111111
.collect::<Vec<_>>();
112-
let ret = context.new_call(None, callee, &args);
112+
let _ret = context.new_call(None, callee, &args);
113113
//llvm::LLVMSetTailCall(ret, True);
114114
block.end_with_void_return(None);
115115
}

src/archive.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub struct ArArchiveBuilder<'a> {
3131
// Don't use `HashMap` here, as the order is important. `rust.metadata.bin` must always be at
3232
// the end of an archive for linkers to not get confused.
3333
entries: Vec<(String, ArchiveEntry)>,
34-
update_symbols: bool,
3534
}
3635

3736
impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
@@ -72,7 +71,6 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
7271
config,
7372
src_archives,
7473
entries,
75-
update_symbols: false,
7674
}
7775
}
7876

@@ -140,7 +138,6 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
140138
}
141139

142140
fn update_symbols(&mut self) {
143-
self.update_symbols = true;
144141
}
145142

146143
fn build(mut self) {
@@ -238,7 +235,7 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
238235
}
239236
}
240237

241-
fn inject_dll_import_lib(&mut self, lib_name: &str, dll_imports: &[DllImport], tmpdir: &MaybeTempDir) {
238+
fn inject_dll_import_lib(&mut self, _lib_name: &str, _dll_imports: &[DllImport], _tmpdir: &MaybeTempDir) {
242239
unimplemented!();
243240
}
244241
}

src/asm.rs

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
117117
true*/
118118
}
119119

120-
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, span: &[Span]) {
120+
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, _span: &[Span]) {
121121
let asm_arch = self.tcx.sess.asm_arch.unwrap();
122122

123123
let intel_dialect =
@@ -135,7 +135,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
135135
let mut current_number = 0;
136136
for (idx, op) in operands.iter().enumerate() {
137137
match *op {
138-
InlineAsmOperandRef::Out { reg, late, place } => {
138+
InlineAsmOperandRef::Out { place, .. } => {
139139
let ty =
140140
match place {
141141
Some(place) => place.layout.gcc_type(self.cx, false),
@@ -155,7 +155,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
155155
current_number += 1;
156156
output_vars.insert(idx, var);
157157
}
158-
InlineAsmOperandRef::InOut { reg, late, out_place, .. } => {
158+
InlineAsmOperandRef::InOut { out_place, .. } => {
159159
let ty =
160160
match out_place {
161161
Some(place) => place.layout.gcc_type(self.cx, false),
@@ -218,7 +218,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
218218
template_str.push_str(&format!("%{}", operand_numbers[&operand_idx]));
219219
}
220220
},
221-
InlineAsmOperandRef::Out { reg, place: None, .. } => {
221+
InlineAsmOperandRef::Out { place: None, .. } => {
222222
unimplemented!("Out None");
223223
},
224224
InlineAsmOperandRef::In { reg, .. }
@@ -321,35 +321,6 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
321321
}
322322
}
323323

324-
// Collect input operands
325-
//let mut constraints = vec![];
326-
//let mut op_idx = FxHashMap::default();
327-
//let mut inputs = vec![];
328-
for (idx, op) in operands.iter().enumerate() {
329-
match *op {
330-
InlineAsmOperandRef::In { reg, value } => {
331-
//inputs.push(value.immediate());
332-
//op_idx.insert(idx, constraints.len());
333-
//constraints.push(reg_to_gcc(reg));
334-
}
335-
InlineAsmOperandRef::InOut { reg, late: _, in_value, out_place: _ } => {
336-
//inputs.push(in_value.immediate());
337-
//constraints.push(format!("{}", op_idx[&idx]));
338-
}
339-
InlineAsmOperandRef::SymFn { instance } => {
340-
//inputs.push(self.cx.get_fn(instance));
341-
//op_idx.insert(idx, constraints.len());
342-
//constraints.push("s".to_string());
343-
}
344-
InlineAsmOperandRef::SymStatic { def_id } => {
345-
//inputs.push(self.cx.get_static(def_id));
346-
//op_idx.insert(idx, constraints.len());
347-
//constraints.push("s".to_string());
348-
}
349-
_ => {}
350-
}
351-
}
352-
353324
/*if !options.contains(InlineAsmOptions::PRESERVES_FLAGS) {
354325
match asm_arch {
355326
InlineAsmArch::AArch64 | InlineAsmArch::Arm => {
@@ -409,8 +380,8 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
409380

410381
// Write results to outputs
411382
for (idx, op) in operands.iter().enumerate() {
412-
if let InlineAsmOperandRef::Out { reg, place: Some(place), .. }
413-
| InlineAsmOperandRef::InOut { reg, out_place: Some(place), .. } = *op
383+
if let InlineAsmOperandRef::Out { place: Some(place), .. }
384+
| InlineAsmOperandRef::InOut { out_place: Some(place), .. } = *op
414385
{
415386
OperandValue::Immediate(output_vars[&idx].to_rvalue()).store(self, place);
416387
}
@@ -628,9 +599,9 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option
628599
_ => unreachable!(),
629600
},
630601
InlineAsmRegClass::X86(X86InlineAsmRegClass::reg_byte) => unimplemented!(),
631-
InlineAsmRegClass::X86(reg @ X86InlineAsmRegClass::xmm_reg)
632-
| InlineAsmRegClass::X86(reg @ X86InlineAsmRegClass::ymm_reg)
633-
| InlineAsmRegClass::X86(reg @ X86InlineAsmRegClass::zmm_reg) => unimplemented!() /*match (reg, modifier) {
602+
InlineAsmRegClass::X86(X86InlineAsmRegClass::xmm_reg)
603+
| InlineAsmRegClass::X86(X86InlineAsmRegClass::ymm_reg)
604+
| InlineAsmRegClass::X86(X86InlineAsmRegClass::zmm_reg) => unimplemented!() /*match (reg, modifier) {
634605
(X86InlineAsmRegClass::xmm_reg, None) => Some('x'),
635606
(X86InlineAsmRegClass::ymm_reg, None) => Some('t'),
636607
(X86InlineAsmRegClass::zmm_reg, None) => Some('g'),

0 commit comments

Comments
 (0)