PageRenderTime 229ms queryTime 56ms sortTime 0ms getByIdsTime 98ms findMatchingLines 17ms

100+ results results for 'crate_type' (229 ms)

Not the results you expected?
lib.rs https://gitlab.com/alx741/rust | Rust | 448 lines
                    
23#![unstable(feature = "rustc_private", issue = "27812")]
                    
24#![crate_type = "rlib"]
                    
25#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/pranith/rust | Rust | 256 lines
                    
49#![staged_api]
                    
50#![crate_type = "rlib"]
                    
51#![crate_type = "dylib"]
                    
                
manifest.rs https://gitlab.com/alx741/cargo | Rust | 489 lines
                    
67    /// Returns the argument suitable for `--crate-type` to pass to rustc.
                    
68    pub fn crate_type(&self) -> &'static str {
                    
69        match *self {
                    
91            TargetKind::Lib(ref kinds) => {
                    
92                kinds.iter().map(|k| k.crate_type()).collect()
                    
93            }
                    
352    /// Returns the arguments suitable for `--crate-type` to pass to rustc.
                    
353    pub fn rustc_crate_types(&self) -> Vec<&'static str> {
                    
354        match self.kind {
                    
355            TargetKind::Lib(ref kinds) => {
                    
356                kinds.iter().map(|kind| kind.crate_type()).collect()
                    
357            },
                    
                
enum_defs.rs https://gitlab.com/jianglu/rust | Rust | 653 lines
                    
30#![feature(stmt_expr_attributes)]
                    
31#![crate_type="rlib"]
                    
32
                    
                
dependency_format.rs https://gitlab.com/alx741/rust | Rust | 334 lines
                    
93    let mut fmts = sess.dependency_formats.borrow_mut();
                    
94    for &ty in sess.crate_types.borrow().iter() {
                    
95        let linkage = calculate_type(sess, ty);
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 447 lines
                    
19#![crate_name = "rand"]
                    
20#![crate_type = "rlib"]
                    
21#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
                    
                
lib.rs https://gitlab.com/pranith/rust | Rust | 141 lines
                    
64#![staged_api]
                    
65#![crate_type = "rlib"]
                    
66#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
                    
                
lto.rs https://gitlab.com/pranith/rust | Rust | 216 lines
                    
36    // Make sure we actually can run LTO
                    
37    for crate_type in &*sess.crate_types.borrow() {
                    
38        match *crate_type {
                    
                
feature_gate.rs https://gitlab.com/pranith/rust | Rust | 756 lines
                    
288    ("crate_name", CrateLevel),
                    
289    ("crate_type", CrateLevel),
                    
290    ("crate_id", CrateLevel),
                    
                
lib.rs https://gitlab.com/pranith/rust | Rust | 1346 lines
                    
15#![staged_api]
                    
16#![crate_type = "dylib"]
                    
17#![crate_type = "rlib"]
                    
                
lib.rs https://gitlab.com/pranith/rust | Rust | 500 lines
                    
16#![staged_api]
                    
17#![crate_type = "rlib"]
                    
18#![feature(no_std)]
                    
                
mod.rs https://gitlab.com/pranith/rust | Rust | 420 lines
                    
54    pub lints: RefCell<NodeMap<Vec<(lint::LintId, codemap::Span, String)>>>,
                    
55    pub crate_types: RefCell<Vec<config::CrateType>>,
                    
56    pub crate_metadata: RefCell<Vec<String>>,
                    
393        lints: RefCell::new(NodeMap()),
                    
394        crate_types: RefCell::new(Vec::new()),
                    
395        crate_metadata: RefCell::new(Vec::new()),
                    
                
config.rs https://gitlab.com/pranith/rust | Rust | 1191 lines
                    
78    // with additional crate configurations during the compile process
                    
79    pub crate_types: Vec<CrateType>,
                    
80
                    
214    Options {
                    
215        crate_types: Vec::new(),
                    
216        gc: false,
                    
                
reachable.rs https://gitlab.com/pranith/rust | Rust | 386 lines
                    
157    fn new(tcx: &'a ty::ctxt<'tcx>) -> ReachableContext<'a, 'tcx> {
                    
158        let any_library = tcx.sess.crate_types.borrow().iter().any(|ty| {
                    
159            *ty != config::CrateTypeExecutable
                    
                
lib.rs https://gitlab.com/pranith/rust | Rust | 542 lines
                    
21#![crate_name = "rand"]
                    
22#![crate_type = "rlib"]
                    
23#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
                    
                
lib.rs https://gitlab.com/pranith/rust | Rust | 1303 lines
                    
13#![crate_name = "libc"]
                    
14#![crate_type = "rlib"]
                    
15#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc"))]
                    
                
compiletest.rs https://gitlab.com/pranith/rust | Rust | 435 lines
                    
10
                    
11#![crate_type = "bin"]
                    
12
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 1550 lines
                    
27#![unstable(feature = "test", issue = "27812")]
                    
28#![crate_type = "rlib"]
                    
29#![crate_type = "dylib"]
                    
                
test.rs https://gitlab.com/alx741/rust | Rust | 517 lines
                    
68        search_paths: libs.clone(),
                    
69        crate_types: vec!(config::CrateTypeDylib),
                    
70        externs: externs.clone(),
                    
194        search_paths: libs,
                    
195        crate_types: vec!(config::CrateTypeExecutable),
                    
196        output_types: outputs,
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 439 lines
                    
12#![unstable(feature = "rustdoc", issue = "27812")]
                    
13#![crate_type = "dylib"]
                    
14#![crate_type = "rlib"]
                    
                
write.rs https://gitlab.com/alx741/rust | Rust | 1053 lines
                    
176
                    
177    let any_library = sess.crate_types.borrow().iter().any(|ty| {
                    
178        *ty != config::CrateTypeExecutable
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 1165 lines
                    
12#![unstable(feature = "rustc_private", issue = "27812")]
                    
13#![crate_type = "dylib"]
                    
14#![crate_type = "rlib"]
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 499 lines
                    
14#![feature(staged_api)]
                    
15#![crate_type = "rlib"]
                    
16#![no_std]
                    
                
mod.rs https://gitlab.com/alx741/rust | Rust | 626 lines
                    
70    pub plugin_attributes: RefCell<Vec<(String, AttributeType)>>,
                    
71    pub crate_types: RefCell<Vec<config::CrateType>>,
                    
72    pub dependency_formats: RefCell<dependency_format::Dependencies>,
                    
                
reachable.rs https://gitlab.com/alx741/rust | Rust | 382 lines
                    
145    fn new(tcx: &'a TyCtxt<'tcx>) -> ReachableContext<'a, 'tcx> {
                    
146        let any_library = tcx.sess.crate_types.borrow().iter().any(|ty| {
                    
147            *ty != config::CrateTypeExecutable
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 1545 lines
                    
83            issue = "27812")]
                    
84#![crate_type = "rlib"]
                    
85#![crate_type = "dylib"]
                    
                
test_cargo_test.rs https://gitlab.com/alx741/cargo | Rust | 2085 lines
                    
505        .file("src/test_twice.rs", r#"
                    
506            #![crate_type = "rlib"]
                    
507
                    
                
test_cargo_cross_compile.rs https://gitlab.com/alx741/cargo | Rust | 968 lines
                    
421            name = "baz"
                    
422            crate_type = ["dylib"]
                    
423        "#)
                    
                
test_cargo_bench.rs https://gitlab.com/alx741/cargo | Rust | 1020 lines
                    
481        .file("src/test_twice.rs", r#"
                    
482            #![crate_type = "rlib"]
                    
483            #![feature(test)]
                    
                
driver.rs https://bitbucket.org/graydon/rust.git | Rust | 784 lines
                    
157    sess.building_library = session::building_library(
                    
158        sess.opts.crate_type, crate, sess.opts.test);
                    
159
                    
                
inherent_impls.rs https://gitlab.com/jianglu/rust | Rust | 532 lines
                    
25#![feature(rustc_attrs)]
                    
26#![crate_type="rlib"]
                    
27
                    
                
lib.rs https://gitlab.com/0072016/0072016-rusty | Rust | 137 lines
                    
59#![crate_name = "alloc"]
                    
60#![crate_type = "rlib"]
                    
61#![allow(unused_attributes)]
                    
                
issue-43106-gating-of-builtin-attrs.rs https://gitlab.com/jianglu/rust | Rust | 839 lines
                    
95#![crate_name                 = "0900"]
                    
96#![crate_type                 = "bin"] // cannot pass "0800" here
                    
97
                    
                
trait_defs.rs https://gitlab.com/jianglu/rust | Rust | 1056 lines
                    
29#![feature(rustc_attrs)]
                    
30#![crate_type="rlib"]
                    
31#![feature(associated_type_defaults)]
                    
                
proc_macro_registrar.rs https://gitlab.com/jianglu/rust | Rust | 453 lines
                    
61              is_test_crate: bool,
                    
62              num_crate_types: usize,
                    
63              handler: &errors::Handler) -> ast::Crate {
                    
84
                    
85    if num_crate_types > 1 {
                    
86        handler.err("cannot mix `proc-macro` crate type with others");
                    
                
test.rs https://gitlab.com/jianglu/rust | Rust | 1002 lines
                    
75        search_paths: libs.clone(),
                    
76        crate_types: vec![config::CrateTypeDylib],
                    
77        cg: cg.clone(),
                    
217        search_paths: libs,
                    
218        crate_types: vec![config::CrateTypeExecutable],
                    
219        output_types: outputs,
                    
                
symbol_export.rs https://gitlab.com/jianglu/rust | Rust | 396 lines
                    
34pub fn threshold(tcx: TyCtxt) -> SymbolExportLevel {
                    
35    crates_export_threshold(&tcx.sess.crate_types.borrow())
                    
36}
                    
37
                    
38fn crate_export_threshold(crate_type: config::CrateType) -> SymbolExportLevel {
                    
39    match crate_type {
                    
48
                    
49pub fn crates_export_threshold(crate_types: &[config::CrateType])
                    
50                                      -> SymbolExportLevel {
                    
50                                      -> SymbolExportLevel {
                    
51    if crate_types.iter().any(|&crate_type| {
                    
52        crate_export_threshold(crate_type) == SymbolExportLevel::Rust
                    
238
                    
239    if tcx.sess.crate_types.borrow().contains(&config::CrateTypeDylib) {
                    
240        let symbol_name = metadata_symbol_name(tcx);
                    
                
lto.rs https://gitlab.com/jianglu/rust | Rust | 773 lines
                    
32
                    
33pub fn crate_type_allows_lto(crate_type: config::CrateType) -> bool {
                    
34    match crate_type {
                    
109        Lto::Yes | Lto::Fat | Lto::Thin => {
                    
110            symbol_export::crates_export_threshold(&cgcx.crate_types)
                    
111        }
                    
150        // Make sure we actually can run LTO
                    
151        for crate_type in cgcx.crate_types.iter() {
                    
152            if !crate_type_allows_lto(*crate_type) {
                    
                
linker.rs https://gitlab.com/jianglu/rust | Rust | 1037 lines
                    
38        LinkerInfo {
                    
39            exports: tcx.sess.crate_types.borrow().iter().map(|&c| {
                    
40                (c, exported_symbols(tcx, c))
                    
126    fn args(&mut self, args: &[String]);
                    
127    fn export_symbols(&mut self, tmpdir: &Path, crate_type: CrateType);
                    
128    fn subsystem(&mut self, subsystem: &str);
                    
347
                    
348    fn export_symbols(&mut self, tmpdir: &Path, crate_type: CrateType) {
                    
349        // If we're compiling a dylib, then we let symbol visibility in object
                    
355        // hide them all here.
                    
356        if crate_type == CrateType::CrateTypeDylib ||
                    
357           crate_type == CrateType::CrateTypeProcMacro {
                    
369                let mut f = BufWriter::new(File::create(&path)?);
                    
370                for sym in self.info.exports[&crate_type].iter() {
                    
371                    debug!("  _{}", sym);
                    
                
entry.rs https://gitlab.com/jianglu/rust | Rust | 190 lines
                    
60                        crate_name: &str) {
                    
61    let any_exe = session.crate_types.borrow().iter().any(|ty| {
                    
62        *ty == config::CrateTypeExecutable
                    
                
arm-types.rs https://gitlab.com/rust-lang/rust | Rust | 530 lines
                    
6#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)]
                    
7#![crate_type = "rlib"]
                    
8#![no_core]
                    
                
test.rs https://gitlab.com/pranith/rust | Rust | 421 lines
                    
54        search_paths: libs.clone(),
                    
55        crate_types: vec!(config::CrateTypeDylib),
                    
56        externs: externs.clone(),
                    
156        search_paths: libs,
                    
157        crate_types: vec!(config::CrateTypeExecutable),
                    
158        output_types: vec!(config::OutputTypeExe),
                    
                
function_interfaces.rs https://gitlab.com/jianglu/rust | Rust | 361 lines
                    
27#![feature(rustc_attrs)]
                    
28#![crate_type = "rlib"]
                    
29
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 528 lines
                    
11#![crate_id = "workcache#0.10-pre"]
                    
12#![crate_type = "rlib"]
                    
13#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 846 lines
                    
57#![crate_id = "uuid#0.10-pre"]
                    
58#![crate_type = "rlib"]
                    
59#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 1285 lines
                    
13#![crate_id = "url#0.10-pre"]
                    
14#![crate_type = "rlib"]
                    
15#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 1510 lines
                    
11#![crate_id = "time#0.10-pre"]
                    
12#![crate_type = "rlib"]
                    
13#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 1507 lines
                    
28#![license = "MIT/ASL2"]
                    
29#![crate_type = "rlib"]
                    
30#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 942 lines
                    
66#![license = "MIT/ASL2"]
                    
67#![crate_type = "dylib"]
                    
68#![crate_type = "rlib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 427 lines
                    
13#![crate_id = "num#0.10-pre"]
                    
14#![crate_type = "rlib"]
                    
15#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 801 lines
                    
26#![crate_id = "glob#0.10-pre"]
                    
27#![crate_type = "rlib"]
                    
28#![crate_type = "dylib"]
                    
                
lib.rs https://gitlab.com/anispy211/rust | Rust | 1525 lines
                    
79#![crate_id = "getopts#0.10-pre"]
                    
80#![crate_type = "rlib"]
                    
81#![crate_type = "dylib"]
                    
                
test_bad_config.rs https://gitlab.com/alx741/cargo | Rust | 456 lines
                    
244
                    
245test!(bad_crate_type {
                    
246    let foo = project("foo")
                    
                
lint_stability.rs https://gitlab.com/alx741/rust | Rust | 179 lines
                    
10#![crate_name="lint_stability"]
                    
11#![crate_type = "lib"]
                    
12#![feature(staged_api)]
                    
                
lib.rs https://gitlab.com/0072016/0072016-SDK-js-sdk-framework- | Rust | 553 lines
                    
5#![crate_name = "webdriver_server"]
                    
6#![crate_type = "rlib"]
                    
7
                    
                
lib.rs https://gitlab.com/0072016/0072016-SDK-js-sdk-framework- | Rust | 448 lines
                    
10#![crate_name = "devtools"]
                    
11#![crate_type = "rlib"]
                    
12
                    
                
lib.rs https://gitlab.com/0072016/0072016-SDK-js-sdk-framework- | Rust | 629 lines
                    
5#![crate_name = "canvas_traits"]
                    
6#![crate_type = "rlib"]
                    
7#![feature(core)]
                    
                
header.rs https://gitlab.com/rust-lang/rust | Rust | 1008 lines
                    
98    // Set this for example if you have an auxiliary test file that contains
                    
99    // a proc-macro and needs `#![crate_type = "proc-macro"]`. This ensures
                    
100    // that the aux file is compiled as a `proc-macro` and not as a `dylib`.
                    
                
issue-74564-if-expr-stack-overflow.rs https://gitlab.com/rust-lang/rust | Rust | 2548 lines
                    
2// ignore-tidy-filelength
                    
3#![crate_type = "rlib"]
                    
4
                    
                
issue-72933-match-stack-overflow.rs https://gitlab.com/rust-lang/rust | Rust | 2178 lines
                    
2// ignore-tidy-filelength
                    
3#![crate_type="rlib"]
                    
4
                    
                
issue-43106-gating-of-builtin-attrs.rs https://gitlab.com/rust-lang/rust | Rust | 773 lines
                    
82#![crate_name = "0900"]
                    
83#![crate_type = "bin"] // cannot pass "0800" here
                    
84
                    
                
trait_impls.rs https://gitlab.com/rust-lang/rust | Rust | 616 lines
                    
20#![feature(specialization)]
                    
21#![crate_type="rlib"]
                    
22
                    
                
simd-intrinsic-generic-arithmetic-saturating.rs https://gitlab.com/rust-lang/rust | Rust | 692 lines
                    
3
                    
4#![crate_type = "lib"]
                    
5
                    
                
lib.rs https://gitlab.com/rust-lang/rust | Rust | 849 lines
                    
83use rustc_middle::ty::TyCtxt;
                    
84use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGroup};
                    
85use rustc_session::getopts;
                    
255        }),
                    
256        make_crate_type_option(),
                    
257        stable("L", |o| {
                    
                
doctest.rs https://gitlab.com/rust-lang/rust | Rust | 1282 lines
                    
71
                    
72    let crate_types =
                    
73        if options.proc_macro_crate { vec![CrateType::ProcMacro] } else { vec![CrateType::Rlib] };
                    
77        search_paths: options.libs.clone(),
                    
78        crate_types,
                    
79        lint_opts,
                    
                
config.rs https://gitlab.com/rust-lang/rust | Rust | 802 lines
                    
9use rustc_session::config::{
                    
10    self, parse_crate_types_from_list, parse_externs, parse_target_triple, CrateType,
                    
11};
                    
                
session.rs https://gitlab.com/rust-lang/rust | Rust | 1309 lines
                    
140
                    
141    crate_types: OnceCell<Vec<CrateType>>,
                    
142    /// The `stable_crate_id` is constructed out of the crate name and all the
                    
273
                    
274    pub fn crate_types(&self) -> &[CrateType] {
                    
275        self.crate_types.get().unwrap().as_slice()
                    
278    pub fn init_crate_types(&self, crate_types: Vec<CrateType>) {
                    
279        self.crate_types.set(crate_types).expect("`crate_types` was initialized twice")
                    
280    }
                    
                
options.rs https://gitlab.com/rust-lang/rust | Rust | 1266 lines
                    
154        /// with additional crate configurations during the compile process.
                    
155        crate_types: Vec<CrateType> [TRACKED],
                    
156        optimize: OptLevel [TRACKED],
                    
                
lib.rs https://gitlab.com/rust-lang/rust | Rust | 1075 lines
                    
96        // Save-analysis is emitted per whole session, not per each crate type
                    
97        let crate_type = sess.crate_types()[0];
                    
98        let outputs = &*self.tcx.output_filenames(());
                    
102        } else if outputs.outputs.should_codegen() {
                    
103            out_filename(sess, crate_type, outputs, crate_name)
                    
104        } else {
                    
                
dependency_format.rs https://gitlab.com/rust-lang/rust | Rust | 435 lines
                    
66    tcx.sess
                    
67        .crate_types()
                    
68        .iter()
                    
                
lib.rs https://gitlab.com/rust-lang/rust | Rust | 1337 lines
                    
24use rustc_feature::find_gated_cfg;
                    
25use rustc_interface::util::{self, collect_crate_types, get_codegen_backend};
                    
26use rustc_interface::{interface, Queries};
                    
                
symbol_export.rs https://gitlab.com/rust-lang/rust | Rust | 588 lines
                    
19pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
                    
20    crates_export_threshold(&tcx.sess.crate_types())
                    
21}
                    
22
                    
23fn crate_export_threshold(crate_type: CrateType) -> SymbolExportLevel {
                    
24    match crate_type {
                    
31
                    
32pub fn crates_export_threshold(crate_types: &[CrateType]) -> SymbolExportLevel {
                    
33    if crate_types
                    
34        .iter()
                    
35        .any(|&crate_type| crate_export_threshold(crate_type) == SymbolExportLevel::Rust)
                    
36    {
                    
259
                    
260    if tcx.sess.crate_types().contains(&CrateType::Dylib) {
                    
261        let symbol_name = metadata_symbol_name(tcx);
                    
                
lto.rs https://gitlab.com/rust-lang/rust | Rust | 938 lines
                    
34
                    
35pub fn crate_type_allows_lto(crate_type: CrateType) -> bool {
                    
36    match crate_type {
                    
50        // We're doing LTO for the entire crate graph
                    
51        Lto::Fat | Lto::Thin => symbol_export::crates_export_threshold(&cgcx.crate_types),
                    
52
                    
89        // Make sure we actually can run LTO
                    
90        for crate_type in cgcx.crate_types.iter() {
                    
91            if !crate_type_allows_lto(*crate_type) {
                    
                
update.rs https://gitlab.com/frewsxcv/cargo | Rust | 760 lines
                    
470        {
                    
471          "crate_types": [
                    
472            "lib"
                    
511        {
                    
512          "crate_types": [
                    
513            "lib"
                    
                
rustc.rs https://gitlab.com/frewsxcv/cargo | Rust | 817 lines
                    
137#[cargo_test]
                    
138fn fails_with_crate_type_and_without_unstable_options() {
                    
139    let p = project().file("src/lib.rs", r#" "#).build();
                    
151#[cargo_test]
                    
152fn fails_with_crate_type_to_multi_binaries() {
                    
153    let p = project()
                    
170#[cargo_test]
                    
171fn fails_with_crate_type_to_multi_examples() {
                    
172    let p = project()
                    
204#[cargo_test]
                    
205fn fails_with_crate_type_to_binary() {
                    
206    let p = project().file("src/bin/foo.rs", "fn main() {}").build();
                    
218#[cargo_test]
                    
219fn build_with_crate_type_for_foo() {
                    
220    let p = project().file("src/lib.rs", "").build();
                    
                
run.rs https://gitlab.com/frewsxcv/cargo | Rust | 1475 lines
                    
403                name = "bar"
                    
404                crate_type = ["lib"]
                    
405            "#,
                    
427                name = "bar"
                    
428                crate_type = ["bin"]
                    
429            "#,
                    
                
profiles.rs https://gitlab.com/frewsxcv/cargo | Rust | 745 lines
                    
200                name = "foo"
                    
201                crate_type = ["dylib", "rlib"]
                    
202            "#,
                    
                
metadata.rs https://gitlab.com/frewsxcv/cargo | Rust | 1533 lines
                    
49                        ],
                    
50                        "crate_types": [
                    
51                            "bin"
                    
100#[cargo_test]
                    
101fn library_with_several_crate_types() {
                    
102    let p = project()
                    
147                        ],
                    
148                        "crate_types": [
                    
149                            "lib",
                    
235                        ],
                    
236                        "crate_types": [
                    
237                            "lib"
                    
353                    {
                    
354                        "crate_types": [
                    
355                            "lib"
                    
                
install.rs https://gitlab.com/frewsxcv/cargo | Rust | 1858 lines
                    
84                    ],
                    
85                    "crate_types": [
                    
86                        "lib"
                    
109                    ],
                    
110                    "crate_types": [
                    
111                        "bin"
                    
                
cross_compile.rs https://gitlab.com/frewsxcv/cargo | Rust | 1346 lines
                    
491                name = "baz"
                    
492                crate_type = ["dylib"]
                    
493            "#,
                    
                
clean.rs https://gitlab.com/frewsxcv/cargo | Rust | 588 lines
                    
365    // Use dashes everywhere to make sure dash/underscore stuff is handled.
                    
366    for crate_type in &["rlib", "dylib", "cdylib", "staticlib", "proc-macro"] {
                    
367        // Try each crate type individually since the behavior changes when
                    
380                    "#,
                    
381                    crate_type
                    
382                ),
                    
                
build.rs https://gitlab.com/frewsxcv/cargo | Rust | 1874 lines
                    
387#[cargo_test]
                    
388fn cargo_compile_with_bin_and_crate_type() {
                    
389    let p = project()
                    
                
bad_config.rs https://gitlab.com/frewsxcv/cargo | Rust | 1492 lines
                    
394#[cargo_test]
                    
395fn bad_crate_type() {
                    
396    let p = project()
                    
                
targets.rs https://gitlab.com/frewsxcv/cargo | Rust | 963 lines
                    
177    lib.validate_proc_macro(warnings);
                    
178    lib.validate_crate_types("library", warnings);
                    
179
                    
213    // both at once.
                    
214    let crate_types = match (lib.crate_types(), lib.plugin, lib.proc_macro()) {
                    
215        (Some(kinds), _, _)
                    
249
                    
250    let mut target = Target::lib_target(&lib.name(), crate_types, path, edition);
                    
251    configure(lib, &mut target)?;
                    
291
                    
292        if let Some(crate_types) = bin.crate_types() {
                    
293            if !crate_types.is_empty() {
                    
403        toml.validate_crate_types("example", warnings);
                    
404        let crate_types = match toml.crate_types() {
                    
405            Some(kinds) => kinds.iter().map(|s| s.into()).collect(),
                    
                
cargo_compile.rs https://gitlab.com/frewsxcv/cargo | Rust | 1375 lines
                    
74    /// Crate types to be passed to rustc (single target only)
                    
75    pub target_rustc_crate_types: Option<Vec<String>>,
                    
76    /// Extra arguments passed to all selected targets for rustdoc.
                    
98            target_rustc_args: None,
                    
99            target_rustc_crate_types: None,
                    
100            local_rustdoc_args: None,
                    
339        ref target_rustc_args,
                    
340        ref target_rustc_crate_types,
                    
341        ref local_rustdoc_args,
                    
                
target_info.rs https://gitlab.com/frewsxcv/cargo | Rust | 989 lines
                    
290
                    
291        let mut crate_types = self.crate_types.borrow_mut();
                    
292        let entry = crate_types.entry(crate_type.clone());
                    
330                    flavor: FileFlavor::Auxiliary,
                    
331                    crate_type: Some(crate_type.clone()),
                    
332                    should_replace_hyphens: true,
                    
354                flavor: FileFlavor::Auxiliary,
                    
355                crate_type: Some(crate_type.clone()),
                    
356                // Name `foo-bar` will generate a `foo_bar.js` and
                    
368                flavor: FileFlavor::DebugInfo,
                    
369                crate_type: Some(crate_type.clone()),
                    
370                should_replace_hyphens: true,
                    
389                    flavor: FileFlavor::DebugInfo,
                    
390                    crate_type: Some(crate_type),
                    
391                    // macOS tools like lldb use all sorts of magic to locate
                    
                
mod.rs https://gitlab.com/frewsxcv/cargo | Rust | 1432 lines
                    
7mod context;
                    
8mod crate_type;
                    
9mod custom_build;
                    
44pub use self::context::{Context, Metadata};
                    
45pub use self::crate_type::CrateType;
                    
46pub use self::custom_build::{BuildOutput, BuildScriptOutputs, BuildScripts};
                    
209fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> CargoResult<Work> {
                    
210    let mut rustc = prepare_rustc(cx, &unit.target.rustc_crate_types(), unit)?;
                    
211    let build_plan = cx.bcx.build_config.build_plan;
                    
                
main.rs https://gitlab.com/yogeshc/redox | Rust | 519 lines
                    
1#![crate_name="kernel"]
                    
2#![crate_type="staticlib"]
                    
3#![feature(alloc)]
                    
                
core.rs https://gitlab.com/0072016/0072016-rusty | Rust | 204 lines
                    
108        search_paths: search_paths,
                    
109        crate_types: vec!(config::CrateTypeRlib),
                    
110        lint_opts: vec!((warning_lint, lint::Allow)),
                    
                
subdiagnostic-derive.rs https://gitlab.com/rust-lang/rust | Rust | 501 lines
                    
10#![feature(rustc_private)]
                    
11#![crate_type = "lib"]
                    
12
                    
                
entry.rs https://gitlab.com/rust-lang/rust | Rust | 229 lines
                    
28fn entry_fn(tcx: TyCtxt<'_>, (): ()) -> Option<(DefId, EntryFnType)> {
                    
29    let any_exe = tcx.sess.crate_types().iter().any(|ty| *ty == CrateType::Executable);
                    
30    if !any_exe {
                    
                
lib.rs https://gitlab.com/aw1231/redox | Rust | 170 lines
                    
56#![staged_api]
                    
57#![crate_type = "rlib"]
                    
58#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
                    
                
lib.rs https://gitlab.com/0072016/0072016-rusty | Rust | 218 lines
                    
11#![crate_name = "alloc_system"]
                    
12#![crate_type = "rlib"]
                    
13#![no_std]
                    
                
read_manifest.rs https://gitlab.com/frewsxcv/cargo | Rust | 206 lines
                    
31        "kind":["bin"],
                    
32        "crate_types":["bin"],
                    
33        "doc": true,
                    
                
lib.rs https://gitlab.com/0072016/0072016-rusty | Rust | 124 lines
                    
11#![crate_name = "alloc_jemalloc"]
                    
12#![crate_type = "rlib"]
                    
13#![no_std]
                    
                
entry.rs https://gitlab.com/alx741/rust | Rust | 168 lines
                    
53
                    
54    let any_exe = session.crate_types.borrow().iter().any(|ty| {
                    
55        *ty == config::CrateTypeExecutable
                    
                
lib.rs https://gitlab.com/alx741/rust | Rust | 156 lines
                    
47#![stable(feature = "core", since = "1.6.0")]
                    
48#![crate_type = "rlib"]
                    
49#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
                    
                
rsbegin.rs https://gitlab.com/jianglu/rust | Rust | 112 lines
                    
25#![feature(no_core, lang_items, optin_builtin_traits)]
                    
26#![crate_type = "rlib"]
                    
27#![no_core]
                    
                
entry.rs https://gitlab.com/0072016/0072016-rusty | Rust | 165 lines
                    
50pub fn find_entry_point(session: &Session, ast_map: &ast_map::Map) {
                    
51    let any_exe = session.crate_types.borrow().iter().any(|ty| {
                    
52        *ty == config::CrateTypeExecutable
                    
                
lib.rs https://gitlab.com/Srijancse/servo | Rust | 563 lines
                    
5#![crate_name = "canvas_traits"]
                    
6#![crate_type = "rlib"]
                    
7#![feature(custom_derive)]
                    
                
unit_graph.rs https://gitlab.com/frewsxcv/cargo | Rust | 233 lines
                    
86                  "target": {
                    
87                    "crate_types": [
                    
88                      "lib"
                    
131                  "target": {
                    
132                    "crate_types": [
                    
133                      "lib"
                    
169                  "target": {
                    
170                    "crate_types": [
                    
171                      "lib"
                    
212                  "target": {
                    
213                    "crate_types": [
                    
214                      "lib"
                    
                
riscv64-lp64-lp64f-lp64d-abi.rs https://gitlab.com/rust-lang/rust | Rust | 189 lines
                    
3
                    
4#![crate_type = "lib"]
                    
5#![no_core]
                    
                
 

Source

Language