Skip to content

Commit ff7ff7d

Browse files
committed
Added the no_run attribute
1 parent ea0d487 commit ff7ff7d

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

crates/cargo-test-support/src/install.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ use std::path::{Path, PathBuf};
44

55
/// Used by `cargo install` tests to assert an executable binary
66
/// has been installed. Example usage:
7-
///
7+
/// ```no_run
88
/// use cargo_test_support::install::assert_has_installed_exe;
99
/// use cargo_test_support::install::cargo_home;
1010
///
1111
/// assert_has_installed_exe(cargo_home(), "foo");
12+
/// ```
1213
#[track_caller]
1314
pub fn assert_has_installed_exe<P: AsRef<Path>>(path: P, name: &'static str) {
1415
assert!(check_has_installed_exe(path, name));

crates/cargo-test-support/src/registry.rs

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -450,45 +450,43 @@ impl RegistryBuilder {
450450
/// `VendorPackage` which implements directory sources.
451451
///
452452
/// # Example
453-
/// ```
453+
/// ```no_run
454454
/// use cargo_test_support::registry::Package;
455455
/// use cargo_test_support::project;
456456
///
457-
/// fn crate_package_test() {
458-
/// // Publish package "a" depending on "b".
459-
/// Package::new("a", "1.0.0")
460-
/// .dep("b", "1.0.0")
461-
/// .file("src/lib.rs", r#"
462-
/// extern crate b;
463-
/// pub fn f() -> i32 { b::f() * 2 }
464-
/// "#)
465-
/// .publish();
457+
/// // Publish package "a" depending on "b".
458+
/// Package::new("a", "1.0.0")
459+
/// .dep("b", "1.0.0")
460+
/// .file("src/lib.rs", r#"
461+
/// extern crate b;
462+
/// pub fn f() -> i32 { b::f() * 2 }
463+
/// "#)
464+
/// .publish();
466465
///
467-
/// // Publish package "b".
468-
/// Package::new("b", "1.0.0")
469-
/// .file("src/lib.rs", r#"
470-
/// pub fn f() -> i32 { 12 }
471-
/// "#)
472-
/// .publish();
466+
/// // Publish package "b".
467+
/// Package::new("b", "1.0.0")
468+
/// .file("src/lib.rs", r#"
469+
/// pub fn f() -> i32 { 12 }
470+
/// "#)
471+
/// .publish();
473472
///
474-
/// // Create a project that uses package "a".
475-
/// let p = project()
476-
/// .file("Cargo.toml", r#"
477-
/// [package]
478-
/// name = "foo"
479-
/// version = "0.0.1"
473+
/// // Create a project that uses package "a".
474+
/// let p = project()
475+
/// .file("Cargo.toml", r#"
476+
/// [package]
477+
/// name = "foo"
478+
/// version = "0.0.1"
480479
///
481-
/// [dependencies]
482-
/// a = "1.0"
483-
/// "#)
484-
/// .file("src/main.rs", r#"
485-
/// extern crate a;
486-
/// fn main() { println!("{}", a::f()); }
487-
/// "#)
488-
/// .build();
480+
/// [dependencies]
481+
/// a = "1.0"
482+
/// "#)
483+
/// .file("src/main.rs", r#"
484+
/// extern crate a;
485+
/// fn main() { println!("{}", a::f()); }
486+
/// "#)
487+
/// .build();
489488
///
490-
/// p.cargo("run").with_stdout("24").run();
491-
/// }
489+
/// p.cargo("run").with_stdout("24").run();
492490
/// ```
493491
#[must_use]
494492
pub struct Package {

0 commit comments

Comments
 (0)