100+ results for 'crate_name'
Not the results you expected?
deprecated-impls.rs (https://gitlab.com/jianglu/rust) Rust · 128 lines
json_dumper.rs (https://gitlab.com/alx741/rust) Rust · 651 lines
96 #[derive(Debug, RustcEncodable)]
97 pub struct CratePreludeData {
98 pub crate_name: String,
99 pub crate_root: String,
100 pub external_crates: Vec<data::ExternalCrateData>,
107 fn lower(self, cm: &CodeMap) -> CratePreludeData {
108 CratePreludeData {
109 crate_name: self.crate_name,
110 crate_root: self.crate_root,
111 external_crates: self.external_crates,
macro_import.rs (https://gitlab.com/alx741/rust) Rust · 193 lines
34 impl<'a> MacroLoader<'a> {
35 fn new(sess: &'a Session, cstore: &'a CStore, crate_name: &str) -> MacroLoader<'a> {
36 MacroLoader {
37 sess: sess,
38 span_whitelist: HashSet::new(),
39 reader: CrateReader::new(sess, cstore, crate_name),
40 macros: vec![],
41 }
51 cstore: &CStore,
52 krate: &ast::Crate,
53 crate_name: &str)
54 -> Vec<ast::MacroDef>
55 {
visibility.rs (https://gitlab.com/rust-lang/rust) Rust · 105 lines
lib.rs (https://gitlab.com/pranith/rust) Rust · 117 lines
publish.rs (https://gitlab.com/frewsxcv/cargo) Rust · 157 lines
40 &new_path,
41 expected_json,
42 expected_crate_name,
43 expected_files,
44 expected_contents,
100 /// Checks the contents of a `.crate` file.
101 ///
102 /// - `expected_crate_name` should be something like `foo-0.0.1.crate`.
103 /// - `expected_files` should be a complete list of files in the crate
104 /// (relative to expected_crate_name).
115 assert_eq!(
116 rdr.header().unwrap().filename().unwrap(),
117 expected_crate_name.as_bytes()
118 );
119 let mut contents = Vec::new();
133 assert!(expected_crate_name.ends_with(".crate"));
134 let base_crate_name = Path::new(&expected_crate_name[..expected_crate_name.len() - 6]);
135 let actual_files: HashSet<PathBuf> = files.keys().cloned().collect();
136 let expected_files: HashSet<PathBuf> = expected_files
lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 124 lines
std_inject.rs (https://gitlab.com/pranith/rust) Rust · 157 lines
55 // The name to use in `extern crate name as std;`
56 let actual_crate_name = match self.alt_std_name {
57 Some(ref s) => token::intern(&s),
58 None => token::intern("std"),
65 attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(
66 InternedString::new("macro_use")))),
67 node: ast::ItemExternCrate(Some(actual_crate_name)),
68 vis: ast::Inherited,
69 span: DUMMY_SP
unit_graph.rs (https://gitlab.com/frewsxcv/cargo) Rust · 233 lines
lint_stability.rs (https://gitlab.com/pranith/rust) Rust · 170 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 111 lines
deprecated-impls.rs (https://gitlab.com/rust-lang/rust) Rust · 118 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 219 lines
mod.rs (https://gitlab.com/frewsxcv/cargo) Rust · 135 lines
exported_symbols.rs (https://gitlab.com/jianglu/rust) Rust · 133 lines
dependency.rs (https://gitlab.com/alx741/crates.io) Rust · 122 lines
62 }
64 pub fn git_encode(&self, crate_name: &str) -> git::Dependency {
65 let Dependency { id: _, version_id: _, crate_id: _, ref req,
66 optional, default_features, ref features,
67 ref target, kind } = *self;
68 git::Dependency {
69 name: crate_name.to_string(),
70 req: req.to_string(),
71 features: features.clone(),
77 }
79 pub fn encodable(self, crate_name: &str) -> EncodableDependency {
80 let Dependency { id, version_id, crate_id: _, req, optional,
81 default_features, features, target, kind } = self;
lib.rs (https://gitlab.com/alx741/rust) Rust · 45 lines
reexports-priv.rs (https://gitlab.com/rust-lang/rust) Rust · 135 lines
lib.rs (https://gitlab.com/rust-lang/rust) Rust · 279 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 62 lines
cross-crate-links.rs (https://gitlab.com/jianglu/rust) Rust · 71 lines
lib.rs (https://gitlab.com/aw1231/redox) Rust · 85 lines
lib.rs (https://gitlab.com/rust-lang/rust) Rust · 162 lines
9 let minor = env!("CARGO_PKG_VERSION_MINOR").parse::<u8>().unwrap();
10 let patch = env!("CARGO_PKG_VERSION_PATCH").parse::<u16>().unwrap();
11 let crate_name = String::from(env!("CARGO_PKG_NAME"));
13 let host_compiler = option_env!("RUSTC_RELEASE_CHANNEL").map(str::to_string);
22 commit_hash,
23 commit_date,
24 crate_name,
25 }
26 }};
35 pub commit_hash: Option<String>,
36 pub commit_date: Option<String>,
37 pub crate_name: String,
38 }
extern-impl.rs (https://gitlab.com/alx741/rust) Rust · 37 lines
lib.rs (https://gitlab.com/pranith/rust) Rust · 59 lines
diagnostic_items.rs (https://gitlab.com/rust-lang/rust) Rust · 113 lines
self.rs (https://gitlab.com/rust-lang/rust) Rust · 116 lines
exported_symbols.rs (https://gitlab.com/rust-lang/rust) Rust · 72 lines
namespace.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 135 lines
54 pub fn crate_root_namespace<'a>(cx: &'a CrateContext) -> &'a str {
55 &cx.link_meta().crate_name
56 }
60 // prepend crate name if not already present
61 let krate = if def_id.is_local() {
62 let crate_namespace_name = token::intern(crate_root_namespace(cx));
63 Some(hir_map::PathMod(crate_namespace_name))
rfc-2632-const-trait-impl.rs (https://gitlab.com/rust-lang/rust) Rust · 69 lines
main.rs (https://gitlab.com/juggle-tux/elf.rs) Rust · 91 lines
19 fn main() {
20 let args = clap_app!(
21 (crate_name!()) =>
22 (version: (crate_version!()))
23 (author: (crate_authors!()))
52 fn run(args: ArgMatches) -> Result<()> {
53 info!("Running {} {}", crate_name!(), crate_version!());
54 File::open(args.value_of("file").unwrap())
55 .map_err(Into::into)
std_inject.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 171 lines
46 let mut fold = CrateInjector {
47 item_name: token::str_to_ident(name),
48 crate_name: token::intern(&alt_std_name.unwrap_or(name.to_string())),
49 };
50 fold.fold_crate(krate)
79 struct CrateInjector {
80 item_name: ast::Ident,
81 crate_name: ast::Name,
82 }
90 attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(
91 InternedString::new("macro_use")))),
92 node: ast::ItemExternCrate(Some(self.crate_name)),
93 vis: ast::Inherited,
94 span: DUMMY_SP
deref-recursive.rs (https://gitlab.com/rust-lang/rust) Rust · 41 lines
unused-attr-duplicate.rs (https://gitlab.com/rust-lang/rust) Rust · 105 lines
nested-modules.rs (https://gitlab.com/rust-lang/rust) Rust · 42 lines
cargo_doc.rs (https://gitlab.com/alx741/cargo) Rust · 114 lines
the_backend.rs (https://gitlab.com/jianglu/rust) Rust · 82 lines
48 use rustc::hir::def_id::LOCAL_CRATE;
50 Box::new(tcx.crate_name(LOCAL_CRATE) as Symbol)
51 }
61 use rustc::session::config::CrateType;
62 use rustc_codegen_utils::link::out_filename;
63 let crate_name = ongoing_codegen.downcast::<Symbol>()
64 .expect("in join_codegen_and_link: ongoing_codegen is not a Symbol");
65 for &crate_type in sess.opts.crate_types.iter() {
68 }
69 let output_name =
70 out_filename(sess, crate_type, &outputs, &*crate_name.as_str());
71 let mut out_file = ::std::fs::File::create(output_name).unwrap();
72 write!(out_file, "This has been \"compiled\" successfully.").unwrap();
tests.rs (https://gitlab.com/rust-lang/rust) Rust · 300 lines
18 #[test]
19 fn make_test_crate_name_no_use() {
20 // If you give a crate name but *don't* use it within the test, it won't bother inserting
21 // the `extern crate` statement.
33 #[test]
34 fn make_test_crate_name() {
35 // If you give a crate name and use it within the test, it will insert an `extern crate`
36 // statement before `fn main`.
doc-cfg-traits.rs (https://gitlab.com/rust-lang/rust) Rust · 124 lines
pub-method.rs (https://gitlab.com/jianglu/rust) Rust · 31 lines
lint_output_format.rs (https://gitlab.com/pranith/rust) Rust · 31 lines
lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 74 lines
glob-extern-no-defaults.rs (https://gitlab.com/jianglu/rust) Rust · 35 lines
src-links.rs (https://gitlab.com/alx741/rust) Rust · 56 lines
reexports.rs (https://gitlab.com/rust-lang/rust) Rust · 129 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 80 lines
doc-cfg-simplification.rs (https://gitlab.com/rust-lang/rust) Rust · 182 lines
assoc-items.rs (https://gitlab.com/jianglu/rust) Rust · 57 lines
unit_graph.rs (https://gitlab.com/frewsxcv/cargo) Rust · 129 lines
21 pub unit_for: UnitFor,
22 /// The name the parent uses to refer to this dependency.
23 pub extern_crate_name: InternedString,
24 /// If `Some`, the name of the dependency if renamed in toml.
25 /// It's particularly interesting to artifact dependencies which rely on it
26 /// for naming their environment variables. Note that the `extern_crate_name`
27 /// cannot be used for this as it also may be the build target itself,
28 /// which isn't always the renamed dependency name.
98 SerializedUnitDep {
99 index: indices[&unit_dep.unit],
100 extern_crate_name: unit_dep.extern_crate_name,
101 public,
102 noprelude,
generic-params.rs (https://gitlab.com/rust-lang/rust) Rust · 62 lines
inherited_stability.rs (https://gitlab.com/pranith/rust) Rust · 55 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 127 lines
foo.rs (https://gitlab.com/pranith/rust) Rust · 36 lines
foo.rs (https://gitlab.com/pranith/rust) Rust · 35 lines
issue_2242_a.rs (https://gitlab.com/pranith/rust) Rust · 20 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 59 lines
src-links.rs (https://gitlab.com/rust-lang/rust) Rust · 46 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 53 lines
lib.rs (https://gitlab.com/pranith/rust) Rust · 89 lines
duplicate-cfg.rs (https://gitlab.com/rust-lang/rust) Rust · 53 lines
mod.rs (https://gitlab.com/pranith/rust) Rust · 57 lines
svh-a-change-lit.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 35 lines
issue-4208-cc.rs (https://gitlab.com/pranith/rust) Rust · 20 lines
src-links-external.rs (https://gitlab.com/jianglu/rust) Rust · 23 lines
lib.rs (https://gitlab.com/pranith/rust) Rust · 65 lines
redirect-rename.rs (https://gitlab.com/rust-lang/rust) Rust · 34 lines
primitive.rs (https://gitlab.com/rust-lang/rust) Rust · 21 lines
integration.rs (https://gitlab.com/rust-lang/rust) Rust · 89 lines
11 let repo_name = env::var("INTEGRATION").expect("`INTEGRATION` var not set");
12 let repo_url = format!("https://github.com/{}", repo_name);
13 let crate_name = repo_name
14 .split('/')
15 .nth(1)
18 let mut repo_dir = tempfile::tempdir().expect("couldn't create temp dir").into_path();
19 repo_dir.push(crate_name);
21 let st = Command::new("git")
renamed-via-module.rs (https://gitlab.com/jianglu/rust) Rust · 34 lines
glob-private.rs (https://gitlab.com/jianglu/rust) Rust · 52 lines
line-breaks.rs (https://gitlab.com/jianglu/rust) Rust · 40 lines
svh-b.rs (https://gitlab.com/pranith/rust) Rust · 23 lines
crateresolve5-2.rs (https://gitlab.com/pranith/rust) Rust · 33 lines
lib.rs (https://gitlab.com/jianglu/rust) Rust · 83 lines
namespace.rs (https://gitlab.com/jianglu/rust) Rust · 66 lines
lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 57 lines
namespace.rs (https://gitlab.com/alx741/rust) Rust · 91 lines
37 let name = match def_key.disambiguated_data.data {
38 DefPathData::CrateRoot => ccx.tcx().crate_name(def_id.krate),
39 data => data.as_interned_str()
40 };
66 let namespace_name = match def_key.disambiguated_data.data {
67 DefPathData::CrateRoot => ccx.tcx().crate_name(def_id.krate),
68 data => data.as_interned_str()
69 };
anon-extern-mod-cross-crate-1.rs (https://gitlab.com/alx741/rust) Rust · 19 lines
svh-uta-change-use-trait.rs (https://gitlab.com/alx741/rust) Rust · 32 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 54 lines
foreign_lib.rs (https://gitlab.com/jianglu/rust) Rust · 48 lines
redirect-rename.rs (https://gitlab.com/jianglu/rust) Rust · 32 lines
static-methods-crate.rs (https://gitlab.com/jianglu/rust) Rust · 39 lines
crate.rs (https://gitlab.com/pranith/rust) Rust · 17 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 52 lines
proc-macro.rs (https://gitlab.com/rust-lang/rust) Rust · 72 lines
playground.rs (https://gitlab.com/jianglu/rust) Rust · 39 lines
lint-stability.rs (https://gitlab.com/rust-lang/rust) Rust · 188 lines
nul-error.rs (https://gitlab.com/jianglu/rust) Rust · 18 lines
link-title-escape.rs (https://gitlab.com/jianglu/rust) Rust · 17 lines
check-styled-link.rs (https://gitlab.com/jianglu/rust) Rust · 18 lines
struct-field.rs (https://gitlab.com/jianglu/rust) Rust · 33 lines
check-source-code-urls-to-def.rs (https://gitlab.com/rust-lang/rust) Rust · 69 lines
cci_iter_lib.rs (https://gitlab.com/pranith/rust) Rust · 21 lines
lib.rs (https://gitlab.com/aw1231/redox) Rust · 59 lines
viewpath-rename.rs (https://gitlab.com/alx741/rust) Rust · 28 lines
mathx.rs (https://gitlab.com/cjcole/rust-lua53) Rust · 87 lines
playground-empty.rs (https://gitlab.com/jianglu/rust) Rust · 21 lines
lib.rs (https://gitlab.com/Srijancse/servo) Rust · 154 lines
crateresolve5-1.rs (https://gitlab.com/pranith/rust) Rust · 34 lines
extern-crosscrate-source.rs (https://gitlab.com/pranith/rust) Rust · 41 lines
lib.rs (https://gitlab.com/pranith/rust) Rust · 54 lines
cargo_doc.rs (https://gitlab.com/frewsxcv/cargo) Rust · 74 lines
with-self-in-projection-output-repeated-supertrait.rs (https://gitlab.com/rust-lang/rust) Rust · 51 lines
tuple-struct-fields-doc.rs (https://gitlab.com/rust-lang/rust) Rust · 50 lines
sidebar-items.rs (https://gitlab.com/jianglu/rust) Rust · 59 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 44 lines
issue-2526.rs (https://gitlab.com/pranith/rust) Rust · 57 lines
lib.rs (https://gitlab.com/pranith/rust) Rust · 45 lines
issue-2631-a.rs (https://gitlab.com/pranith/rust) Rust · 24 lines
crateresolve4b-2.rs (https://gitlab.com/pranith/rust) Rust · 18 lines
crateresolve4b-1.rs (https://gitlab.com/pranith/rust) Rust · 18 lines
lib.rs (https://gitlab.com/admin-github-cloud/habitat) Rust · 94 lines
where.rs (https://gitlab.com/rust-lang/rust) Rust · 51 lines
the_backend.rs (https://gitlab.com/rust-lang/rust) Rust · 82 lines
63 use rustc_session::{config::CrateType, output::out_filename};
64 use std::io::Write;
65 let crate_name = codegen_results.crate_info.local_crate_name;
66 for &crate_type in sess.opts.crate_types.iter() {
67 if crate_type != CrateType::Rlib {
68 sess.fatal(&format!("Crate type is {:?}", crate_type));
69 }
70 let output_name = out_filename(sess, crate_type, &outputs, &*crate_name.as_str());
71 let mut out_file = ::std::fs::File::create(output_name).unwrap();
72 write!(out_file, "This has been \"compiled\" successfully.").unwrap();
search-index-summaries.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines
issue-42875.rs (https://gitlab.com/jianglu/rust) Rust · 23 lines
issue-47038.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines
lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 86 lines
multiple_crate_versions.rs (https://gitlab.com/rust-lang/rust) Rust · 63 lines
macro_pub_in_module.rs (https://gitlab.com/rust-lang/rust) Rust · 82 lines
const-generics-docs.rs (https://gitlab.com/rust-lang/rust) Rust · 128 lines
non-path-primitives.rs (https://gitlab.com/rust-lang/rust) Rust · 46 lines
line-breaks.rs (https://gitlab.com/rust-lang/rust) Rust · 30 lines
const-display.rs (https://gitlab.com/rust-lang/rust) Rust · 86 lines
where.rs (https://gitlab.com/alx741/rust) Rust · 48 lines
lib.rs (https://gitlab.com/alx741/rust) Rust · 54 lines
issue_3979_traits.rs (https://gitlab.com/pranith/rust) Rust · 25 lines
issue-2380.rs (https://gitlab.com/pranith/rust) Rust · 26 lines
cci_no_inline_lib.rs (https://gitlab.com/pranith/rust) Rust · 22 lines
issue-78701.rs (https://gitlab.com/rust-lang/rust) Rust · 20 lines
mod.rs (https://gitlab.com/rust-lang/rust) Rust · 53 lines
42 fn time<R>(tcx: TyCtxt<'_>, display: bool, name: &'static str, f: impl FnOnce() -> R) -> R {
43 if display {
44 println!("[{:<30}: {}] start", tcx.crate_name(LOCAL_CRATE), name);
45 let before = std::time::Instant::now();
46 let res = tcx.sess.time(name, f);
47 let after = std::time::Instant::now();
48 println!("[{:<30}: {}] end time: {:?}", tcx.crate_name(LOCAL_CRATE), name, after - before);
49 res
50 } else {
unit-return.rs (https://gitlab.com/jianglu/rust) Rust · 27 lines
glob-private.rs (https://gitlab.com/rust-lang/rust) Rust · 42 lines
playground.rs (https://gitlab.com/rust-lang/rust) Rust · 27 lines
unindent.rs (https://gitlab.com/rust-lang/rust) Rust · 62 lines
test-lists.rs (https://gitlab.com/jianglu/rust) Rust · 36 lines
hidden-trait-struct-impls.rs (https://gitlab.com/jianglu/rust) Rust · 32 lines
primitive-slice-auto-trait.rs (https://gitlab.com/rust-lang/rust) Rust · 14 lines
pub-restricted.rs (https://gitlab.com/jianglu/rust) Rust · 44 lines
universal-impl-trait.rs (https://gitlab.com/jianglu/rust) Rust · 65 lines
pub-use-extern-macros.rs (https://gitlab.com/jianglu/rust) Rust · 30 lines
external-cross.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines
empty-section.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines
issue-34025.rs (https://gitlab.com/jianglu/rust) Rust · 22 lines
index.rs (https://gitlab.com/pranith/rust) Rust · 26 lines
svh-utb.rs (https://gitlab.com/pranith/rust) Rust · 22 lines
impl-disambiguation.rs (https://gitlab.com/jianglu/rust) Rust · 40 lines
link-assoc-const.rs (https://gitlab.com/jianglu/rust) Rust · 26 lines
default-trait-method-link.rs (https://gitlab.com/jianglu/rust) Rust · 25 lines
extern-impl-trait.rs (https://gitlab.com/jianglu/rust) Rust · 21 lines
issue-34473.rs (https://gitlab.com/jianglu/rust) Rust · 22 lines
auto-traits.rs (https://gitlab.com/jianglu/rust) Rust · 23 lines
tuples.rs (https://gitlab.com/alx741/rust) Rust · 18 lines
titles.rs (https://gitlab.com/jianglu/rust) Rust · 59 lines
cross-crate-hidden-assoc-trait-items.rs (https://gitlab.com/rust-lang/rust) Rust · 23 lines
same-crate-hidden-impl-parameter.rs (https://gitlab.com/rust-lang/rust) Rust · 36 lines
deref-recursive-pathbuf.rs (https://gitlab.com/rust-lang/rust) Rust · 25 lines
rustc_info.rs (https://gitlab.com/rust-lang/rust) Rust · 65 lines
44 }
46 pub(crate) fn get_file_name(crate_name: &str, crate_type: &str) -> String {
47 let file_name = Command::new("rustc")
48 .stderr(Stdio::inherit())
49 .args(&[
50 "--crate-name",
51 crate_name,
52 "--crate-type",
53 crate_type,
61 let file_name = String::from_utf8(file_name).unwrap().trim().to_owned();
62 assert!(!file_name.contains('\n'));
63 assert!(file_name.contains(crate_name));
64 file_name
65 }