From a62dc84e725b98e712b4331d98416c4a9effe881 Mon Sep 17 00:00:00 2001 From: bors Date: Thu, 5 Mar 2020 17:09:08 +0000 Subject: [PATCH 1/3] Auto merge of #7970 - ehuss:revert-debug-assert-filter, r=alexcrichton Partially revert change to filter debug_assertions. This partially reverts the changes from #7943. It caused a regression with the rocket_contrib crate. I knew that was the only crate that had a `cfg(debug_assertions)` dependency, and I saw that it had been fixed, but I did not realize the fix hadn't been published (and will be in a semver incompatible release). This retains the old behavior for `cfg(debug_assertions)` of issuing a warning. I kept the filter for `CARGO_CFG_DEBUG_ASSERTIONS` for build scripts because that was the original intent for the change, and I don't see anyone using that. Closes #7966. --- src/cargo/core/compiler/build_context/target_info.rs | 5 ++++- src/cargo/core/compiler/custom_build.rs | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index 2f7cafedaea..80f1d51c3ed 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -192,7 +192,10 @@ impl TargetInfo { fn not_user_specific_cfg(cfg: &CargoResult) -> bool { if let Ok(Cfg::Name(cfg_name)) = cfg { - if cfg_name == "debug_assertions" || cfg_name == "proc_macro" { + // This should also include "debug_assertions", but it causes + // regressions. Maybe some day in the distant future it can be + // added (and possibly change the warning to an error). + if cfg_name == "proc_macro" { return false; } } diff --git a/src/cargo/core/compiler/custom_build.rs b/src/cargo/core/compiler/custom_build.rs index 9d6bd6cd058..2bc320e56d8 100644 --- a/src/cargo/core/compiler/custom_build.rs +++ b/src/cargo/core/compiler/custom_build.rs @@ -228,6 +228,11 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoRes } } for (k, v) in cfg_map { + if k == "debug_assertions" { + // This cfg is always true and misleading, so avoid setting it. + // That is because Cargo queries rustc without any profile settings. + continue; + } let k = format!("CARGO_CFG_{}", super::envify(&k)); match v { Some(list) => { From f900cd45f9dc0d1541fd0c73f9e2f556ea649806 Mon Sep 17 00:00:00 2001 From: bors Date: Tue, 10 Mar 2020 21:20:10 +0000 Subject: [PATCH 2/3] Auto merge of #7983 - ehuss:fix-old-manifest-anchors, r=alexcrichton Support old html anchors in manifest chapter. #7733 unintentionally broke some old HTML anchors in the manifest chapter. This would cause any links out in the wild to not scroll to the correct position. Unfortunately it is too late for the 1.42 release. However, I'd like to backport this for 1.43. --- src/doc/src/reference/manifest.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md index 5dfb54e37c7..2d0c81eb575 100644 --- a/src/doc/src/reference/manifest.md +++ b/src/doc/src/reference/manifest.md @@ -95,6 +95,7 @@ Versioning](https://semver.org/), so make sure you follow some basic rules: traits, fields, types, functions, methods or anything else. * Use version numbers with three numeric parts such as 1.0.0 rather than 1.0. + #### The `authors` field The `authors` field lists people or organizations that are considered the @@ -106,6 +107,7 @@ brackets at the end of each author. > **Note**: [crates.io] requires at least one author to be listed. + #### The `edition` field You can opt in to a specific [Rust Edition] for your package with the @@ -137,6 +139,7 @@ description = "A short description of my package" > **Note**: [crates.io] requires the `description` to be set. + #### The `documentation` field The `documentation` field specifies a URL to a website hosting the crate's @@ -259,6 +262,7 @@ categories = ["command-line-utilities", "development-tools::cargo-plugins"] > match one of the strings available at , and > must match exactly. + #### The `workspace` field The `workspace` field can be used to configure the workspace that this package @@ -280,6 +284,7 @@ table defined. That is, a crate cannot both be a root crate in a workspace For more information, see the [workspaces chapter](workspaces.md). + #### The `build` field The `build` field specifies a file in the package root which is a [build @@ -299,6 +304,7 @@ The default is `"build.rs"`, which loads the script from a file named specify a path to a different file or `build = false` to disable automatic detection of the build script. + #### The `links` field The `links` field specifies the name of a native library that is being linked @@ -313,6 +319,7 @@ script guide. links = "foo" ``` + #### The `exclude` and `include` fields You can explicitly specify that a set of file patterns should be ignored or @@ -375,6 +382,7 @@ if any of those files change. [gitignore]: https://git-scm.com/docs/gitignore + #### The `publish` field The `publish` field can be used to prevent a package from being published to a @@ -396,6 +404,7 @@ allowed to be published to. publish = ["some-registry-name"] ``` + #### The `metadata` table Cargo by default will warn about unused keys in `Cargo.toml` to assist in @@ -539,7 +548,7 @@ more detail. "#integration-tests": "cargo-targets.html#integration-tests", "#configuring-a-target": "cargo-targets.html#configuring-a-target", "#target-auto-discovery": "cargo-targets.html#target-auto-discovery", - "#the-required-features-field": "cargo-targets.html#the-required-features-field", + "#the-required-features-field-optional": "cargo-targets.html#the-required-features-field", "#building-dynamic-or-static-libraries": "cargo-targets.html#the-crate-type-field", "#the-workspace-section": "workspaces.html#the-workspace-section", "#virtual-manifest": "workspaces.html", From fb5abcd38f30951766622da895f1e908dd27aa73 Mon Sep 17 00:00:00 2001 From: bors Date: Fri, 13 Mar 2020 19:47:44 +0000 Subject: [PATCH 3/3] Auto merge of #7996 - alexcrichton:update-git2, r=Eh2406 Bump libgit2 dependencies Brings in rust-lang/git2-rs#527 Closes #7466 Closes #7988 --- Cargo.toml | 6 +++--- crates/cargo-test-support/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3eb42a2c461..07f88b3c23c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,8 +34,8 @@ anyhow = "1.0" filetime = "0.2" flate2 = { version = "1.0.3", features = ["zlib"] } fs2 = "0.4" -git2 = "0.12.0" -git2-curl = "0.13.0" +git2 = "0.13.0" +git2-curl = "0.14.0" glob = "0.3.0" hex = "0.4" home = "0.5" @@ -46,7 +46,7 @@ jobserver = "0.1.21" lazycell = "1.2.0" libc = "0.2" log = "0.4.6" -libgit2-sys = "0.11.0" +libgit2-sys = "0.12.0" memchr = "2.1.3" num_cpus = "1.0" opener = "0.4" diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index 0e321010e63..5363097b493 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -12,7 +12,7 @@ cargo = { path = "../.." } cargo-test-macro = { path = "../cargo-test-macro" } filetime = "0.2" flate2 = "1.0" -git2 = "0.12" +git2 = "0.13" glob = "0.3" lazy_static = "1.0" remove_dir_all = "0.5"