mrustc icon indicating copy to clipboard operation
mrustc copied to clipboard

Error with leading digit in '1' in src/trans/mangling_v2.cpp:85

Open iamanonymouscs opened this issue 3 years ago • 3 comments

When attempting to compile the code with mrustc:

Code

$ cat 1.rs

#![crate_type = "lib"]
pub fn get_u16_from_unaligned_manual(data: [u8; 1]) -> u8 {
    data[0] << 16
}

Command

mrustc -L output-1.54.0 1.rs It seems there is an Internal Compiler Error (ICE) occurs, with the error message:

Output

Setup: V V V
(0.00 s) Setup: DONE
Target Load: V V V
(0.00 s) Target Load: DONE
Parse: V V V
(0.00 s) Parse: DONE
LoadCrates: V V V
(0.39 s) LoadCrates: DONE
Expand: V V V
(0.00 s) Expand: DONE
- main: params.outfile = lib1.rlib
Implicit Crates: V V V
(0.00 s) Implicit Crates: DONE
Resolve Use: V V V
(0.00 s) Resolve Use: DONE
Resolve Index: V V V
(0.00 s) Resolve Index: DONE
Resolve Absolute: V V V
(0.00 s) Resolve Absolute: DONE
HIR Lower: V V V
(0.00 s) HIR Lower: DONE
Lifetime Elision: V V V
(0.00 s) Lifetime Elision: DONE
Resolve Type Aliases: V V V
(0.00 s) Resolve Type Aliases: DONE
Resolve Bind: V V V
(0.10 s) Resolve Bind: DONE
Resolve UFCS Outer: V V V
(0.00 s) Resolve UFCS Outer: DONE
Resolve HIR Self Type: V V V
(0.00 s) Resolve HIR Self Type: DONE
Resolve HIR Markings: V V V
(0.00 s) Resolve HIR Markings: DONE
Sort Impls: V V V
(0.01 s) Sort Impls: DONE
Resolve UFCS paths: V V V
(0.00 s) Resolve UFCS paths: DONE
Constant Evaluate: V V V
(0.00 s) Constant Evaluate: DONE
Typecheck Outer: V V V
(0.00 s) Typecheck Outer: DONE
Typecheck Expressions: V V V
(0.00 s) Typecheck Expressions: DONE
Expand HIR Annotate: V V V
(0.00 s) Expand HIR Annotate: DONE
Expand HIR Static Borrow Mark: V V V
(0.00 s) Expand HIR Static Borrow Mark: DONE
Expand HIR Lifetimes: V V V
(0.00 s) Expand HIR Lifetimes: DONE
Expand HIR Closures: V V V
(0.00 s) Expand HIR Closures: DONE
Expand HIR Static Borrow: V V V
(0.00 s) Expand HIR Static Borrow: DONE
Expand HIR VTables: V V V
(0.00 s) Expand HIR VTables: DONE
Expand HIR Calls: V V V
(0.00 s) Expand HIR Calls: DONE
Expand HIR Reborrows: V V V
(0.00 s) Expand HIR Reborrows: DONE
Expand HIR ErasedType: V V V
(0.00 s) Expand HIR ErasedType: DONE
Typecheck Expressions (validate): V V V
(0.00 s) Typecheck Expressions (validate): DONE
Lower MIR: V V V
(0.00 s) Lower MIR: DONE
MIR Validate: V V V
(0.00 s) MIR Validate: DONE
MIR Cleanup: V V V
(0.00 s) MIR Cleanup: DONE
MIR Optimise: V V V
(0.00 s) MIR Optimise: DONE
MIR Validate PO: V V V
(0.00 s) MIR Validate PO: DONE
MIR Validate Full: V V V
(0.00 s) MIR Validate Full: DONE
Trans Enumerate: V V V
:0:0 BUG:ASSERT FAIL: src/trans/mangling_v2.cpp:85:!isdigit(*p): Leading digit not valid in '1'
Aborted (core dumped)

Version

I build the mrustc by using build-1.54.0.sh mrustc --version

rustc 1.29.100 (mrustc v0.10.0 master:4c7e8171)
release: 1.29.100
- Build time: Tue, 26 Sep 2023 07:36:21 +0000
- Commit: 4c7e81716493678df9fe9cac86ea9beedc57db44

iamanonymouscs avatar Oct 10 '23 02:10 iamanonymouscs

The root cause is the crate name being "1" (as the input file is 1.rs - I can only tell that from the stray - main: params.outfile = lib1.rlib line.

thepowersgang avatar Oct 10 '23 11:10 thepowersgang

Please include the revision you're running AND the command you're running when submitting issues.

thepowersgang avatar Oct 10 '23 11:10 thepowersgang

Please include the revision you're running AND the command you're running when submitting issues.

We sincerely apologize for the oversight in not including the version number and command information initially. We have now rectified this by editing the report to include the required details. Thank you very much for reminding us.

iamanonymouscs avatar Oct 10 '23 16:10 iamanonymouscs