100+ results for 'crate_name'

Not the results you expected?

deprecated-impls.rs (https://gitlab.com/jianglu/rust) Rust · 128 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/struct.Foo0.html

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

33

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

1 // compile-flags: --document-private-items

2

3 #![crate_name = "foo"]

4

5 // @!has 'foo/index.html' '//a[@href="struct.FooPublic.html"]/..' 'FooPublic 🔒'

lib.rs (https://gitlab.com/pranith/rust) Rust · 117 lines

17 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

18 #![cfg_attr(stage0, feature(custom_attribute))]

19 #![crate_name = "syntax"]

20 #![unstable(feature = "rustc_private")]

21 #![staged_api]

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

9 // except according to those terms.

10

11 #![crate_name = "alloc_jemalloc"]

12 #![crate_type = "rlib"]

13 #![no_std]

std_inject.rs (https://gitlab.com/pranith/rust) Rust · 157 lines

54

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

57 "dependencies": [

58 {

59 "extern_crate_name": "b",

60 "index": 1,

61 "noprelude": false,

102 "dependencies": [

103 {

104 "extern_crate_name": "c",

105 "index": 2,

106 "noprelude": false,

185 "dependencies": [

186 {

187 "extern_crate_name": "a",

188 "index": 0,

189 "noprelude": false,

lint_stability.rs (https://gitlab.com/pranith/rust) Rust · 170 lines

8 // option. This file may not be copied, modified, or distributed

9 // except according to those terms.

10 #![crate_name="lint_stability"]

11 #![crate_type = "lib"]

12 #![feature(staged_api)]

lib.rs (https://gitlab.com/alx741/rust) Rust · 111 lines

9 // except according to those terms.

10

11 #![crate_name = "rustc_platform_intrinsics"]

12 #![unstable(feature = "rustc_private", issue = "27812")]

13 #![crate_type = "dylib"]

deprecated-impls.rs (https://gitlab.com/rust-lang/rust) Rust · 118 lines

1 #![crate_name = "foo"]

2

3 // @has foo/struct.Foo0.html

lib.rs (https://gitlab.com/alx741/rust) Rust · 219 lines

9 // except according to those terms.

10

11 #![crate_name = "alloc_system"]

12 #![crate_type = "rlib"]

13 #![no_std]

mod.rs (https://gitlab.com/frewsxcv/cargo) Rust · 135 lines

109 .find(|target| target.is_lib())

110 {

111 write!(fmt, "{}", target.crate_name())?;

112 }

113 }

exported_symbols.rs (https://gitlab.com/jianglu/rust) Rust · 133 lines

109 pub fn metadata_symbol_name(tcx: ty::TyCtxt) -> String {

110 format!("rust_metadata_{}_{}",

111 tcx.original_crate_name(LOCAL_CRATE),

112 tcx.crate_disambiguator(LOCAL_CRATE).to_fingerprint().to_hex())

113 }

dependency.rs (https://gitlab.com/alx741/crates.io) Rust · 122 lines

62 }

63

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 }

78

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

15 //! This API is completely unstable and subject to change.

16

17 #![crate_name = "rustc_passes"]

18 #![unstable(feature = "rustc_private", issue = "27812")]

19 #![crate_type = "dylib"]

reexports-priv.rs (https://gitlab.com/rust-lang/rust) Rust · 135 lines

2 // compile-flags: --document-private-items

3

4 #![crate_name = "foo"]

5

6 extern crate reexports;

lib.rs (https://gitlab.com/rust-lang/rust) Rust · 279 lines

3 #![doc(html_playground_url="https://play.rust-lang.org/")]

4

5 #![crate_name = "test_docs"]

6 #![feature(rustdoc_internals)]

7 #![feature(doc_cfg)]

lib.rs (https://gitlab.com/alx741/rust) Rust · 62 lines

9 // except according to those terms.

10

11 #![crate_name = "rustc_metadata"]

12 #![unstable(feature = "rustc_private", issue = "27812")]

13 #![crate_type = "dylib"]

cross-crate-links.rs (https://gitlab.com/jianglu/rust) Rust · 71 lines

14 #![feature(use_extern_macros)]

15

16 #![crate_name = "foo"]

17

18 #[macro_use]

lib.rs (https://gitlab.com/aw1231/redox) Rust · 85 lines

10

11 #![cfg_attr(stage0, feature(custom_attribute))]

12 #![crate_name = "alloc_system"]

13 #![crate_type = "rlib"]

14 #![staged_api]

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"));

12

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 }

39

extern-impl.rs (https://gitlab.com/alx741/rust) Rust · 37 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/struct.Foo.html

lib.rs (https://gitlab.com/pranith/rust) Rust · 59 lines

17 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

18 #![cfg_attr(stage0, feature(custom_attribute))]

19 #![crate_name = "serialize"]

20 #![unstable(feature = "rustc_private",

21 reason = "deprecated in favor of rustc-serialize on crates.io")]

diagnostic_items.rs (https://gitlab.com/rust-lang/rust) Rust · 113 lines

40 None => tcx.sess.struct_err(&format!(

41 "duplicate diagnostic item in crate `{}`: `{}`.",

42 tcx.crate_name(item_def_id.krate),

43 name

44 )),

49 err.note(&format!(

50 "the diagnostic item is first defined in crate `{}`.",

51 tcx.crate_name(original_def_id.krate)

52 ));

53 }

self.rs (https://gitlab.com/rust-lang/rust) Rust · 116 lines

1 #![crate_name = "foo"]

2

3

exported_symbols.rs (https://gitlab.com/rust-lang/rust) Rust · 72 lines

67 format!(

68 "rust_metadata_{}_{:08x}",

69 tcx.crate_name(LOCAL_CRATE),

70 tcx.sess.local_stable_crate_id().to_u64(),

71 )

namespace.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 135 lines

53

54 pub fn crate_root_namespace<'a>(cx: &'a CrateContext) -> &'a str {

55 &cx.link_meta().crate_name

56 }

57

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

7 // not remove this test.

8 #![feature(const_trait_impl)]

9 #![crate_name = "foo"]

10

11 use std::marker::Destruct;

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!()))

51

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 }

83

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

13 // @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz'

14

15 #![crate_name = "foo"]

16

17 use std::ops::Deref;

unused-attr-duplicate.rs (https://gitlab.com/rust-lang/rust) Rust · 105 lines

11 // - no_main: extra setup

12 #![deny(unused_attributes)]

13 #![crate_name = "unused_attr_duplicate"]

14 #![crate_name = "unused_attr_duplicate2"] //~ ERROR unused attribute

nested-modules.rs (https://gitlab.com/rust-lang/rust) Rust · 42 lines

1 #![crate_name = "aCrate"]

2

3 mod a_module {

cargo_doc.rs (https://gitlab.com/alx741/cargo) Rust · 114 lines

22 for target in package.targets().iter().filter(|t| t.documented()) {

23 if target.is_lib() {

24 assert!(lib_names.insert(target.crate_name()));

25 } else {

26 assert!(bin_names.insert(target.crate_name()));

the_backend.rs (https://gitlab.com/jianglu/rust) Rust · 82 lines

48 use rustc::hir::def_id::LOCAL_CRATE;

49

50 Box::new(tcx.crate_name(LOCAL_CRATE) as Symbol)

51 }

52

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

17

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.

32

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

1 #![crate_name = "myrmecophagous"]

2 #![feature(doc_cfg, associated_type_defaults)]

3

pub-method.rs (https://gitlab.com/jianglu/rust) Rust · 31 lines

12 // compile-flags: --document-private-items

13

14 #![crate_name = "foo"]

15

16 // @has foo/fn.bar.html

lint_output_format.rs (https://gitlab.com/pranith/rust) Rust · 31 lines

9 // except according to those terms.

10

11 #![crate_name="lint_output_format"]

12 #![crate_type = "lib"]

13 #![feature(staged_api)]

lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 74 lines

11 //! Syntax extensions in the Rust compiler.

12

13 #![crate_name = "syntax_ext"]

14 #![unstable(feature = "rustc_private", issue = "27812")]

15 #![crate_type = "dylib"]

glob-extern-no-defaults.rs (https://gitlab.com/jianglu/rust) Rust · 35 lines

11 // compile-flags: --no-defaults

12

13 #![crate_name = "foo"]

14

15 mod mod1 {

src-links.rs (https://gitlab.com/alx741/rust) Rust · 56 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 //! Dox

reexports.rs (https://gitlab.com/rust-lang/rust) Rust · 129 lines

1 // aux-build: reexports.rs

2

3 #![crate_name = "foo"]

4

5 extern crate reexports;

lib.rs (https://gitlab.com/alx741/rust) Rust · 80 lines

22 //!

23 //! ```rust,ignore

24 //! #![crate_name = "myplugin"]

25 //! #![crate_type = "dylib"]

26 //! #![feature(plugin_registrar)]

51 //! for more examples.

52

53 #![crate_name = "rustc_plugin"]

54 #![unstable(feature = "rustc_private", issue = "27812")]

55 #![crate_type = "dylib"]

doc-cfg-simplification.rs (https://gitlab.com/rust-lang/rust) Rust · 182 lines

1 #![crate_name = "globuliferous"]

2 #![feature(doc_cfg)]

3

assoc-items.rs (https://gitlab.com/jianglu/rust) Rust · 57 lines

13 // ignore-cross-compile

14

15 #![crate_name = "foo"]

16

17 extern crate assoc_items;

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

1 // ignore-tidy-linelength

2

3 #![crate_name = "foo"]

4

5 //! Here's a link to [`Vec<T>`] and one to [`Box<Vec<Option<T>>>`].

inherited_stability.rs (https://gitlab.com/pranith/rust) Rust · 55 lines

8 // option. This file may not be copied, modified, or distributed

9 // except according to those terms.

10 #![crate_name="inherited_stability"]

11 #![crate_type = "lib"]

12 #![unstable(feature = "test_feature")]

lib.rs (https://gitlab.com/alx741/rust) Rust · 127 lines

15 //! This API is completely unstable and subject to change.

16

17 #![crate_name = "syntax"]

18 #![unstable(feature = "rustc_private", issue = "27812")]

19 #![crate_type = "dylib"]

foo.rs (https://gitlab.com/pranith/rust) Rust · 36 lines

10

11 // @has foo/index.html

12 #![crate_name = "foo"]

13

14 //! Very docs

foo.rs (https://gitlab.com/pranith/rust) Rust · 35 lines

9 // except according to those terms.

10

11 #![crate_name="foo"]

12

13 /// The '# ' lines should be removed from the output, but the #[derive] should be

issue_2242_a.rs (https://gitlab.com/pranith/rust) Rust · 20 lines

9 // except according to those terms.

10

11 #![crate_name="a#0.1"]

12 #![crate_type = "lib"]

13

lib.rs (https://gitlab.com/alx741/rust) Rust · 59 lines

21 //! (yet) aim to provide a full set of Unicode tables.

22

23 #![crate_name = "rustc_unicode"]

24 #![unstable(feature = "unicode", issue = "27783")]

25 #![crate_type = "rlib"]

src-links.rs (https://gitlab.com/rust-lang/rust) Rust · 46 lines

1 #![crate_name = "foo"]

2

3 //! Dox

lib.rs (https://gitlab.com/alx741/rust) Rust · 53 lines

9 // except according to those terms.

10

11 #![crate_name = "rustc_borrowck"]

12 #![unstable(feature = "rustc_private", issue = "27812")]

13 #![crate_type = "dylib"]

lib.rs (https://gitlab.com/pranith/rust) Rust · 89 lines

17 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

18 #![cfg_attr(stage0, feature(custom_attribute))]

19 #![crate_name = "rustc_trans"]

20 #![unstable(feature = "rustc_private")]

21 #![staged_api]

duplicate-cfg.rs (https://gitlab.com/rust-lang/rust) Rust · 53 lines

1 #![crate_name = "foo"]

2 #![feature(doc_cfg)]

3

mod.rs (https://gitlab.com/pranith/rust) Rust · 57 lines

22 //!

23 //! ```rust,ignore

24 //! #![crate_name = "myplugin"]

25 //! #![crate_type = "dylib"]

26 //! #![feature(plugin_registrar)]

svh-a-change-lit.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 35 lines

14 //! (#14132).

15

16 #![crate_name = "a"]

17

18 macro_rules! three {

issue-4208-cc.rs (https://gitlab.com/pranith/rust) Rust · 20 lines

9 // except according to those terms.

10

11 #![crate_name="numeric"]

12 #![crate_type = "lib"]

13

src-links-external.rs (https://gitlab.com/jianglu/rust) Rust · 23 lines

14 // ignore-tidy-linelength

15

16 #![crate_name = "foo"]

17

18 extern crate src_links_external;

lib.rs (https://gitlab.com/pranith/rust) Rust · 65 lines

24 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

25 #![cfg_attr(stage0, feature(custom_attribute))]

26 #![crate_name = "rustc_back"]

27 #![unstable(feature = "rustc_private")]

28 #![staged_api]

redirect-rename.rs (https://gitlab.com/rust-lang/rust) Rust · 34 lines

1 #![crate_name = "foo"]

2

3 mod hidden {

primitive.rs (https://gitlab.com/rust-lang/rust) Rust · 21 lines

1 #![crate_name = "foo"]

2

3 #![feature(rustdoc_internals)]

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)

17

18 let mut repo_dir = tempfile::tempdir().expect("couldn't create temp dir").into_path();

19 repo_dir.push(crate_name);

20

21 let st = Command::new("git")

renamed-via-module.rs (https://gitlab.com/jianglu/rust) Rust · 34 lines

13 // ignore-cross-compile

14

15 #![crate_name = "bar"]

16

17 extern crate foo;

glob-private.rs (https://gitlab.com/jianglu/rust) Rust · 52 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 mod mod1 {

line-breaks.rs (https://gitlab.com/jianglu/rust) Rust · 40 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 use std::ops::Add;

svh-b.rs (https://gitlab.com/pranith/rust) Rust · 23 lines

17 //! (#14132).

18

19 #![crate_name = "b"]

20

21 extern crate a;

crateresolve5-2.rs (https://gitlab.com/pranith/rust) Rust · 33 lines

9 // except according to those terms.

10

11 #![crate_name="crateresolve5#0.2"]

12

13 #![crate_type = "lib"]

lib.rs (https://gitlab.com/jianglu/rust) Rust · 83 lines

22 //!

23 //! ```no_run

24 //! #![crate_name = "myplugin"]

25 //! #![crate_type = "dylib"]

26 //! #![feature(plugin_registrar)]

namespace.rs (https://gitlab.com/jianglu/rust) Rust · 66 lines

47

48 let namespace_name = match def_key.disambiguated_data.data {

49 DefPathData::CrateRoot => cx.tcx.crate_name(def_id.krate).as_str(),

50 data => data.as_interned_str().as_str()

51 };

lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 57 lines

15 */

16

17 #![crate_name = "serialize"]

18 #![unstable(feature = "rustc_private",

19 reason = "deprecated in favor of rustc-serialize on crates.io",

namespace.rs (https://gitlab.com/alx741/rust) Rust · 91 lines

36

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 };

65

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

9 // except according to those terms.

10

11 #![crate_name="anonexternmod"]

12 #![feature(libc)]

13

svh-uta-change-use-trait.rs (https://gitlab.com/alx741/rust) Rust · 32 lines

16 //! This is the upstream crate.

17

18 #![crate_name = "uta"]

19

20 mod traits {

lib.rs (https://gitlab.com/alx741/rust) Rust · 54 lines

15 //! This API is completely unstable and subject to change.

16

17 #![crate_name = "rustc_const_eval"]

18 #![unstable(feature = "rustc_private", issue = "27812")]

19 #![crate_type = "dylib"]

foreign_lib.rs (https://gitlab.com/jianglu/rust) Rust · 48 lines

9 // except according to those terms.

10

11 #![crate_name="foreign_lib"]

12

13 #![feature(libc)]

redirect-rename.rs (https://gitlab.com/jianglu/rust) Rust · 32 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 mod hidden {

static-methods-crate.rs (https://gitlab.com/jianglu/rust) Rust · 39 lines

9 // except according to those terms.

10

11 #![crate_name="static_methods_crate"]

12 #![crate_type = "lib"]

13

crate.rs (https://gitlab.com/pranith/rust) Rust · 17 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // Querying about the crate metadata should *not* parse the entire crate, it

lib.rs (https://gitlab.com/alx741/rust) Rust · 52 lines

17 //! This API is completely unstable and subject to change.

18

19 #![crate_name = "rustc_data_structures"]

20 #![unstable(feature = "rustc_private", issue = "27812")]

21 #![crate_type = "dylib"]

proc-macro.rs (https://gitlab.com/rust-lang/rust) Rust · 72 lines

4

5 #![crate_type="proc-macro"]

6 #![crate_name="some_macros"]

7

8 // @has some_macros/index.html

playground.rs (https://gitlab.com/jianglu/rust) Rust · 39 lines

11 // ignore-tidy-linelength

12

13 #![crate_name = "foo"]

14

15 #![doc(html_playground_url = "https://www.example.com/")]

lint-stability.rs (https://gitlab.com/rust-lang/rust) Rust · 188 lines

1 #![crate_name="lint_stability"]

2 #![crate_type = "lib"]

3 #![feature(staged_api)]

nul-error.rs (https://gitlab.com/jianglu/rust) Rust · 18 lines

12 // ignore-cross-compile

13

14 #![crate_name = "foo"]

15

16 // @has foo/fn.foo.html '//code' ''

link-title-escape.rs (https://gitlab.com/jianglu/rust) Rust · 17 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 //! hello [foo]

check-styled-link.rs (https://gitlab.com/jianglu/rust) Rust · 18 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 pub struct Foo;

struct-field.rs (https://gitlab.com/jianglu/rust) Rust · 33 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // ignore-tidy-linelength

check-source-code-urls-to-def.rs (https://gitlab.com/rust-lang/rust) Rust · 69 lines

5 #![feature(rustdoc_internals)]

6

7 #![crate_name = "foo"]

8

9 extern crate source_code;

cci_iter_lib.rs (https://gitlab.com/pranith/rust) Rust · 21 lines

9 // except according to those terms.

10

11 #![crate_name="cci_iter_lib"]

12

13 #[inline]

lib.rs (https://gitlab.com/aw1231/redox) Rust · 59 lines

23 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

24 #![cfg_attr(stage0, feature(custom_attribute))]

25 #![crate_name = "rustc_unicode"]

26 #![unstable(feature = "unicode", issue = "27783")]

27 #![staged_api]

viewpath-rename.rs (https://gitlab.com/alx741/rust) Rust · 28 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 pub mod io {

mathx.rs (https://gitlab.com/cjcole/rust-lua53) Rust · 87 lines

21 // THE SOFTWARE.

22

23 #![crate_name="mathx"]

24 #![crate_type="dylib"]

25

playground-empty.rs (https://gitlab.com/jianglu/rust) Rust · 21 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 #![doc(html_playground_url = "")]

lib.rs (https://gitlab.com/Srijancse/servo) Rust · 154 lines

6 #![plugin(heapsize_plugin, plugins, serde_macros)]

7

8 #![crate_name = "gfx_traits"]

9 #![crate_type = "rlib"]

10

crateresolve5-1.rs (https://gitlab.com/pranith/rust) Rust · 34 lines

9 // except according to those terms.

10

11 #![crate_name="crateresolve5#0.1"]

12

13 #![crate_type = "lib"]

extern-crosscrate-source.rs (https://gitlab.com/pranith/rust) Rust · 41 lines

9 // except according to those terms.

10

11 #![crate_name="externcallback"]

12 #![crate_type = "lib"]

13 #![feature(libc)]

lib.rs (https://gitlab.com/pranith/rust) Rust · 54 lines

23 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

24 #![cfg_attr(stage0, feature(custom_attribute))]

25 #![crate_name = "unicode"]

26 #![unstable(feature = "unicode")]

27 #![feature(lang_items)]

cargo_doc.rs (https://gitlab.com/frewsxcv/cargo) Rust · 74 lines

22 if options.open_result {

23 let name = &compilation

24 .root_crate_names

25 .get(0)

26 .ok_or_else(|| anyhow::anyhow!("no crates with documentation"))?;

with-self-in-projection-output-repeated-supertrait.rs (https://gitlab.com/rust-lang/rust) Rust · 51 lines

2

3 // FIXME(eddyb) shorten the name so windows doesn't choke on it.

4 #![crate_name = "trait_test"]

5

6 // Regression test related to #56288. Check that a supertrait projection (of

tuple-struct-fields-doc.rs (https://gitlab.com/rust-lang/rust) Rust · 50 lines

1 #![crate_name = "foo"]

2

3 // @has foo/struct.Foo.html

sidebar-items.rs (https://gitlab.com/jianglu/rust) Rust · 59 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/trait.Foo.html

lib.rs (https://gitlab.com/alx741/rust) Rust · 44 lines

15 */

16

17 #![crate_name = "rustc_mir"]

18 #![crate_type = "rlib"]

19 #![crate_type = "dylib"]

issue-2526.rs (https://gitlab.com/pranith/rust) Rust · 57 lines

9 // except according to those terms.

10

11 #![crate_name="issue_2526"]

12 #![crate_type = "lib"]

13

lib.rs (https://gitlab.com/pranith/rust) Rust · 45 lines

11 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)

12 #![cfg_attr(stage0, feature(custom_attribute))]

13 #![crate_name = "rustc_borrowck"]

14 #![unstable(feature = "rustc_private")]

15 #![staged_api]

issue-2631-a.rs (https://gitlab.com/pranith/rust) Rust · 24 lines

9 // except according to those terms.

10

11 #![crate_name="req"]

12 #![crate_type = "lib"]

13

crateresolve4b-2.rs (https://gitlab.com/pranith/rust) Rust · 18 lines

11 // aux-build:crateresolve4a-1.rs

12 // aux-build:crateresolve4a-2.rs

13 #![crate_name="crateresolve4b#0.2"]

14 #![crate_type = "lib"]

15

crateresolve4b-1.rs (https://gitlab.com/pranith/rust) Rust · 18 lines

11 // aux-build:crateresolve4a-1.rs

12 // aux-build:crateresolve4a-2.rs

13 #![crate_name="crateresolve4b#0.1"]

14 #![crate_type = "lib"]

15

lib.rs (https://gitlab.com/admin-github-cloud/habitat) Rust · 94 lines

47 //!

48 //! `crypto::shorthash`

49 #![crate_name = "sodiumoxide"]

50 #![crate_type = "lib"]

51 #![warn(missing_docs)]

where.rs (https://gitlab.com/rust-lang/rust) Rust · 51 lines

1 #![feature(generic_associated_types)]

2 #![crate_name = "foo"]

3

4 pub trait MyTrait { fn dummy(&self) { } }

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

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has 'search-index.js' 'Foo short link.'

issue-42875.rs (https://gitlab.com/jianglu/rust) Rust · 23 lines

11 // compile-flags: --no-defaults

12

13 #![crate_name = "foo"]

14

15 // @has foo/a/index.html '//code' 'use *;'

issue-47038.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines

11 #![feature(decl_macro)]

12

13 #![crate_name = "foo"]

14

15 use std::vec;

lib.rs (https://gitlab.com/0072016/0072016-rusty) Rust · 86 lines

15 //! This API is completely unstable and subject to change.

16

17 #![crate_name = "rustc_trans"]

18 #![unstable(feature = "rustc_private", issue = "27812")]

19 #![crate_type = "dylib"]

multiple_crate_versions.rs (https://gitlab.com/rust-lang/rust) Rust · 63 lines

12

13 pub(super) fn check(cx: &LateContext<'_>, metadata: &Metadata) {

14 let local_name = cx.tcx.crate_name(LOCAL_CRATE);

15 let mut packages = metadata.packages.clone();

16 packages.sort_by(|a, b| a.name.cmp(&b.name));

macro_pub_in_module.rs (https://gitlab.com/rust-lang/rust) Rust · 82 lines

5 //! See issue #74355

6 #![feature(decl_macro, no_core, rustc_attrs)]

7 #![crate_name = "krate"]

8 #![no_core]

9

const-generics-docs.rs (https://gitlab.com/rust-lang/rust) Rust · 128 lines

1 // edition:2018

2 // aux-build: extern_crate.rs

3 #![crate_name = "foo"]

4

5 extern crate extern_crate;

non-path-primitives.rs (https://gitlab.com/rust-lang/rust) Rust · 46 lines

1 #![crate_name = "foo"]

2 #![feature(intra_doc_pointers)]

3 #![deny(rustdoc::broken_intra_doc_links)]

line-breaks.rs (https://gitlab.com/rust-lang/rust) Rust · 30 lines

1 #![crate_name = "foo"]

2

3 use std::ops::Add;

const-display.rs (https://gitlab.com/rust-lang/rust) Rust · 86 lines

1 #![crate_name = "foo"]

2

3 #![unstable(feature = "humans",

where.rs (https://gitlab.com/alx741/rust) Rust · 48 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 pub trait MyTrait { fn dummy(&self) { } }

lib.rs (https://gitlab.com/alx741/rust) Rust · 54 lines

22 //! build speedups.

23

24 #![crate_name = "rustc_back"]

25 #![unstable(feature = "rustc_private", issue = "27812")]

26 #![crate_type = "dylib"]

issue_3979_traits.rs (https://gitlab.com/pranith/rust) Rust · 25 lines

9 // except according to those terms.

10

11 #![crate_name="issue_3979_traits"]

12

13 #![crate_type = "lib"]

issue-2380.rs (https://gitlab.com/pranith/rust) Rust · 26 lines

9 // except according to those terms.

10

11 #![crate_name="a"]

12 #![crate_type = "lib"]

13

cci_no_inline_lib.rs (https://gitlab.com/pranith/rust) Rust · 22 lines

9 // except according to those terms.

10

11 #![crate_name="cci_no_inline_lib"]

12

13

issue-78701.rs (https://gitlab.com/rust-lang/rust) Rust · 20 lines

1 #![crate_name = "foo"]

2

3 // This test ensures that if a blanket impl has the same ID as another impl, it'll

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

11 // aux-build:unit-return.rs

12

13 #![crate_name = "foo"]

14

15 extern crate unit_return;

glob-private.rs (https://gitlab.com/rust-lang/rust) Rust · 42 lines

1 #![crate_name = "foo"]

2

3 mod mod1 {

playground.rs (https://gitlab.com/rust-lang/rust) Rust · 27 lines

1 #![crate_name = "foo"]

2

3 #![doc(html_playground_url = "https://www.example.com/")]

unindent.rs (https://gitlab.com/rust-lang/rust) Rust · 62 lines

1 #![crate_name = "foo"]

2

3 // @has foo/struct.Example.html

test-lists.rs (https://gitlab.com/jianglu/rust) Rust · 36 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/fn.f.html

hidden-trait-struct-impls.rs (https://gitlab.com/jianglu/rust) Rust · 32 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 #[doc(hidden)]

primitive-slice-auto-trait.rs (https://gitlab.com/rust-lang/rust) Rust · 14 lines

1 // compile-flags: --crate-type lib --edition 2018

2

3 #![crate_name = "foo"]

4 #![feature(rustdoc_internals)]

5

pub-restricted.rs (https://gitlab.com/jianglu/rust) Rust · 44 lines

15 #![feature(crate_visibility_modifier)]

16

17 #![crate_name = "foo"]

18

19 // @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'

universal-impl-trait.rs (https://gitlab.com/jianglu/rust) Rust · 65 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 use std::io::Read;

pub-use-extern-macros.rs (https://gitlab.com/jianglu/rust) Rust · 30 lines

8 // option. This file may not be copied, modified, or distributed

9 // except according to those terms.

10 #![crate_name="macros"]

11

12 #[macro_export]

external-cross.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines

12 // ignore-cross-compile

13

14 #![crate_name="host"]

15

16 extern crate external_cross;

empty-section.rs (https://gitlab.com/jianglu/rust) Rust · 20 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 #![feature(optin_builtin_traits)]

issue-34025.rs (https://gitlab.com/jianglu/rust) Rust · 22 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @!has 'foo/sys/index.html'

index.rs (https://gitlab.com/pranith/rust) Rust · 26 lines

9 // except according to those terms.

10

11 #![crate_name = "rustdoc_test"]

12

13 // @has search-index.js Foo

svh-utb.rs (https://gitlab.com/pranith/rust) Rust · 22 lines

16 //! This is the downstream crate.

17

18 #![crate_name = "utb"]

19

20 extern crate uta;

impl-disambiguation.rs (https://gitlab.com/jianglu/rust) Rust · 40 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 pub trait Foo {}

link-assoc-const.rs (https://gitlab.com/jianglu/rust) Rust · 26 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/index.html '//a[@href="../foo/foo/constant.FIRSTCONST.html"]' 'foo::FIRSTCONST'

default-trait-method-link.rs (https://gitlab.com/jianglu/rust) Rust · 25 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/trait.Foo.html '//a[@href="../foo/trait.Foo.html#tymethod.req"]' 'req'

extern-impl-trait.rs (https://gitlab.com/jianglu/rust) Rust · 21 lines

11 // aux-build:extern-impl-trait.rs

12

13 #![crate_name = "foo"]

14

15 extern crate extern_impl_trait;

issue-34473.rs (https://gitlab.com/jianglu/rust) Rust · 22 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 mod second {

auto-traits.rs (https://gitlab.com/jianglu/rust) Rust · 23 lines

13 #![feature(optin_builtin_traits)]

14

15 #![crate_name = "foo"]

16

17 extern crate auto_traits;

tuples.rs (https://gitlab.com/alx741/rust) Rust · 18 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @has foo/fn.tuple0.html //pre 'pub fn tuple0(x: ())'

titles.rs (https://gitlab.com/jianglu/rust) Rust · 59 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 // @matches 'foo/index.html' '//h1' 'Crate foo'

cross-crate-hidden-assoc-trait-items.rs (https://gitlab.com/rust-lang/rust) Rust · 23 lines

2 // Hide cross-crate `#[doc(hidden)]` associated items in trait impls.

3

4 #![crate_name = "dependent"]

5 // edition:2021

6 // aux-crate:dependency=cross-crate-hidden-assoc-trait-items.rs

same-crate-hidden-impl-parameter.rs (https://gitlab.com/rust-lang/rust) Rust · 36 lines

1 // test for `doc(hidden)` with impl parameters in the same crate.

2 #![crate_name = "foo"]

3

4 #[doc(hidden)]

deref-recursive-pathbuf.rs (https://gitlab.com/rust-lang/rust) Rust · 25 lines

13 // @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.exists"]' 'exists'

14

15 #![crate_name = "foo"]

16

17 use std::ops::Deref;

rustc_info.rs (https://gitlab.com/rust-lang/rust) Rust · 65 lines

44 }

45

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 }

lib.rs (https://gitlab.com/cjcole/rust-lua53) Rust · 68 lines

21 // THE SOFTWARE.

22

23 #![crate_name = "lua"]

24 #![crate_type = "lib"]

25

macros.rs (https://gitlab.com/rust-lang/rust) Rust · 19 lines

3

4 #![feature(macro_test)]

5 #![crate_name = "foo"]

6

7 extern crate macros;

masked.rs (https://gitlab.com/rust-lang/rust) Rust · 30 lines

3 #![feature(doc_masked)]

4

5 #![crate_name = "foo"]

6

7 #[doc(masked)]

negative-impl-sidebar.rs (https://gitlab.com/jianglu/rust) Rust · 19 lines

10

11 #![feature(optin_builtin_traits)]

12 #![crate_name = "foo"]

13

14 pub struct Foo;

optimization-fuel-1.rs (https://gitlab.com/jianglu/rust) Rust · 24 lines

9 // except according to those terms.

10

11 #![crate_name="foo"]

12

13 use std::mem::size_of;

svh-a-base.rs (https://gitlab.com/pranith/rust) Rust · 38 lines

14 //! (#14132).

15

16 #![crate_name = "a"]

17 #![feature(core)]

18

lib.rs (https://gitlab.com/yogeshc/redox) Rust · 46 lines

1 #![crate_name="system"]

2 #![crate_type="lib"]

3 #![feature(asm)]

where-clause-order.rs (https://gitlab.com/rust-lang/rust) Rust · 19 lines

1 #![crate_name = "foo"]

2

3 pub trait SomeTrait<Rhs = Self>

short-docblock.rs (https://gitlab.com/rust-lang/rust) Rust · 25 lines

1 #![crate_name = "foo"]

2

3 // @has foo/index.html '//*[@class="item-right docblock-short"]/p' 'fooo'

search-index.rs (https://gitlab.com/alx741/rust) Rust · 36 lines

9 // except according to those terms.

10

11 #![crate_name = "rustdoc_test"]

12

13 use std::ops::Deref;

lib.rs (https://gitlab.com/alx741/markdown.rs) Rust · 43 lines

1 //! A crate for parsing Markdown in Rust

2 #![crate_name = "markdown"]

3 #![deny(missing_docs)]

4 // #![deny(warnings)]

lib.rs (https://gitlab.com/alx741/rust) Rust · 43 lines

15 //! This API is completely unstable and subject to change.

16

17 #![crate_name = "rustc_const_math"]

18 #![unstable(feature = "rustc_private", issue = "27812")]

19 #![crate_type = "dylib"]

issue-3012-1.rs (https://gitlab.com/pranith/rust) Rust · 33 lines

9 // except according to those terms.

10

11 #![crate_name="socketlib"]

12 #![crate_type = "lib"]

13 #![feature(libc)]

inherited_stability.rs (https://gitlab.com/alx741/rust) Rust · 56 lines

8 // option. This file may not be copied, modified, or distributed

9 // except according to those terms.

10 #![crate_name="inherited_stability"]

11 #![crate_type = "lib"]

12 #![unstable(feature = "test_feature", issue = "0")]

gats.rs (https://gitlab.com/rust-lang/rust) Rust · 34 lines

1 #![crate_name = "foo"]

2 #![feature(generic_associated_types)]

3

doc-cfg-hide.rs (https://gitlab.com/rust-lang/rust) Rust · 32 lines

1 #![crate_name = "oud"]

2 #![feature(doc_auto_cfg, doc_cfg, doc_cfg_hide)]

3

foo.rs (https://gitlab.com/pranith/rust) Rust · 25 lines

9 // except according to those terms.

10

11 #![crate_name = "foo"]

12

13 //! Very docs