rust/compiler/rustc_interface/src
Matthias Krüger e3ded4fc4f
Rollup merge of #92933 - bjorn3:no_bin_lib_mixing, r=estebank
Deny mixing bin crate type with lib crate types

The produced library would get a main shim too which conflicts with the
main shim of the executable linking the library.

```
$ cat > main1.rs <<EOF
fn main() {}
pub fn bar() {}
EOF
$ cat > main2.rs <<EOF
extern crate main1;
fn main() {
    main1::bar();
}
EOF
$ rustc --crate-type bin --crate-type lib main1.rs
$ rustc -L. main2.rs
error: linking with `cc` failed: exit status: 1
[...]
  = note: /usr/bin/ld: /tmp/crate_bin_lib/libmain1.rlib(main1.main1.707747aa-cgu.0.rcgu.o): in function `main':
          main1.707747aa-cgu.0:(.text.main+0x0): multiple definition of `main'; main2.main2.02a148fe-cgu.0.rcgu.o:main2.02a148fe-cgu.0:(.text.main+0x0): first defined here
          collect2: error: ld returned 1 exit status
```
2022-02-18 16:23:28 +01:00
..
callbacks.rs Remove SPAN_DEBUG global 2022-02-12 11:50:02 +01:00
interface.rs Remove Config::stderr 2022-02-13 11:49:52 +01:00
lib.rs Move setup_callbacks call to create_compiler_and_run 2022-02-12 11:47:53 +01:00
passes.rs Rollup merge of #92933 - bjorn3:no_bin_lib_mixing, r=estebank 2022-02-18 16:23:28 +01:00
proc_macro_decls.rs Avoid more invocations of hir_crate query. 2021-09-29 23:16:47 +02:00
queries.rs Auto merge of #93724 - Mark-Simulacrum:drop-query-stats, r=michaelwoerister 2022-02-09 15:53:10 +00:00
tests.rs Auto merge of #93724 - Mark-Simulacrum:drop-query-stats, r=michaelwoerister 2022-02-09 15:53:10 +00:00
util.rs Remove Config::stderr 2022-02-13 11:49:52 +01:00