gccrs
gccrs copied to clipboard
GCC Front-End for Rust
Something like: - https://github.com/rust-lang/rustc-dev-guide/blob/d39f68ba831f87144b7d2f49d35886a90e562b69/src/diagnostics.md?plain=1#L955 for rustc - https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/ada/einfo.ads;h=2fb45703a4fb77218637c4f885ede85510326586;hb=HEAD#l663 for GCC Ada. _Originally posted by @dkm in https://github.com/Rust-GCC/gccrs/issues/3064#issuecomment-2346242763_
[godbolt link](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:rust,selection:(endColumn:1,endLineNumber:18,positionColumn:1,positionLineNumber:18,selectionStartColumn:1,selectionStartLineNumber:18,startColumn:1,startLineNumber:18),source:'%23%5Blang+%3D+%22sized%22%5D%0Atrait+Sized+%7B%7D%0A%0Aenum+Result%3CT,+E%3E+%7B%0A++++Ok(T),%0A++++Err(E)%0A%7D%0A%0Afn+foo()+-%3E+Result%3Ci32,+i32%3E+%7B%0A++++Result::Ok(15)%0A%7D%0A%0Afn+bar()+-%3E+Result%3Ci32,+i32%3E+%7B%0A++++let+result+%3D+foo()%3F%3B%0A%0A++++Result::Ok(15)%0A%7D%0A'),l:'5',n:'1',o:'Rust+source+%231',t:'0')),k:53.45647278269375,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((g:!((h:output,i:(compilerName:'x86-64+gcc+14.1',editorid:1,fontScale:14,fontUsePx:'0',j:1,wrap:'1'),l:'5',n:'0',o:'Output+of+x86-64+GCCRS+(GCCRS+master)+(Compiler+%231)',t:'0')),header:(),k:37.5,l:'4',m:50,n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:gccrs-snapshot,filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'0',intel:'0',libraryCode:'0',trim:'1',verboseDemangling:'0'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:rust,libs:!(),options:'',overrides:!(),selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+x86-64+GCCRS+(GCCRS+master)+(Editor+%231)',t:'0')),header:(),l:'4',m:50,n:'0',o:'',s:0,t:'0')),k:46.54352721730625,l:'3',n:'0',o:'',t:'0')),l:'2',n:'0',o:'',t:'0')),version:4) ```rust #[lang = "sized"] trait Sized {} enum Result { Ok(T), Err(E) } fn foo() -> Result { Result::Ok(15) } fn bar() -> Result { let result =...
gcc/rust/ChangeLog: ``` * rust-session-manager.cc (Session::handle_crate_name): Remove crate name inference (Session::compile_crate): Add crate name inference and error if inferred name is empty. Remove CompileOptions::get_instance () that returned a local copy of...
### Summary This issue is created because of a comment under https://github.com/Rust-GCC/gccrs/pull/3124. Background: https://rust-lang.github.io/rfcs/3324-dyn-upcasting.html As far as I understand, internally, a dynamic reference is a vtable containing all the required...