Skip to content

Commit 7b1e9f5

Browse files
committed
Auto merge of #8007 - ehuss:1.43-backports, r=alexcrichton
1.43 beta backports * #7970 — Revert filter `debug_assertions` in `cfg` expressions. * #7983 — Fix old anchors in manifest documentation. * #7996 — Update libgit2 (fixes critical macos issue).
2 parents bda5051 + fb5abcd commit 7b1e9f5

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ anyhow = "1.0"
3434
filetime = "0.2"
3535
flate2 = { version = "1.0.3", features = ["zlib"] }
3636
fs2 = "0.4"
37-
git2 = "0.12.0"
38-
git2-curl = "0.13.0"
37+
git2 = "0.13.0"
38+
git2-curl = "0.14.0"
3939
glob = "0.3.0"
4040
hex = "0.4"
4141
home = "0.5"
@@ -46,7 +46,7 @@ jobserver = "0.1.21"
4646
lazycell = "1.2.0"
4747
libc = "0.2"
4848
log = "0.4.6"
49-
libgit2-sys = "0.11.0"
49+
libgit2-sys = "0.12.0"
5050
memchr = "2.1.3"
5151
num_cpus = "1.0"
5252
opener = "0.4"

crates/cargo-test-support/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cargo = { path = "../.." }
1212
cargo-test-macro = { path = "../cargo-test-macro" }
1313
filetime = "0.2"
1414
flate2 = "1.0"
15-
git2 = "0.12"
15+
git2 = "0.13"
1616
glob = "0.3"
1717
lazy_static = "1.0"
1818
remove_dir_all = "0.5"

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ impl TargetInfo {
192192

193193
fn not_user_specific_cfg(cfg: &CargoResult<Cfg>) -> bool {
194194
if let Ok(Cfg::Name(cfg_name)) = cfg {
195-
if cfg_name == "debug_assertions" || cfg_name == "proc_macro" {
195+
// This should also include "debug_assertions", but it causes
196+
// regressions. Maybe some day in the distant future it can be
197+
// added (and possibly change the warning to an error).
198+
if cfg_name == "proc_macro" {
196199
return false;
197200
}
198201
}

src/cargo/core/compiler/custom_build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoRes
228228
}
229229
}
230230
for (k, v) in cfg_map {
231+
if k == "debug_assertions" {
232+
// This cfg is always true and misleading, so avoid setting it.
233+
// That is because Cargo queries rustc without any profile settings.
234+
continue;
235+
}
231236
let k = format!("CARGO_CFG_{}", super::envify(&k));
232237
match v {
233238
Some(list) => {

src/doc/src/reference/manifest.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Versioning](https://semver.org/), so make sure you follow some basic rules:
9595
traits, fields, types, functions, methods or anything else.
9696
* Use version numbers with three numeric parts such as 1.0.0 rather than 1.0.
9797

98+
<a id="the-authors-field-optional"></a>
9899
#### The `authors` field
99100

100101
The `authors` field lists people or organizations that are considered the
@@ -106,6 +107,7 @@ brackets at the end of each author.
106107

107108
> **Note**: [crates.io] requires at least one author to be listed.
108109
110+
<a id="the-edition-field-optional"></a>
109111
#### The `edition` field
110112

111113
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"
137139

138140
> **Note**: [crates.io] requires the `description` to be set.
139141
142+
<a id="the-documentation-field-optional"></a>
140143
#### The `documentation` field
141144

142145
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"]
259262
> match one of the strings available at <https://crates.io/category_slugs>, and
260263
> must match exactly.
261264
265+
<a id="the-workspace--field-optional"></a>
262266
#### The `workspace` field
263267

264268
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
280284
For more information, see the [workspaces chapter](workspaces.md).
281285

282286
<a id="package-build"></a>
287+
<a id="the-build-field-optional"></a>
283288
#### The `build` field
284289

285290
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
299304
specify a path to a different file or `build = false` to disable automatic
300305
detection of the build script.
301306

307+
<a id="the-links-field-optional"></a>
302308
#### The `links` field
303309

304310
The `links` field specifies the name of a native library that is being linked
@@ -313,6 +319,7 @@ script guide.
313319
links = "foo"
314320
```
315321

322+
<a id="the-exclude-and-include-fields-optional"></a>
316323
#### The `exclude` and `include` fields
317324

318325
You can explicitly specify that a set of file patterns should be ignored or
@@ -375,6 +382,7 @@ if any of those files change.
375382

376383
[gitignore]: https://git-scm.com/docs/gitignore
377384

385+
<a id="the-publish--field-optional"></a>
378386
#### The `publish` field
379387

380388
The `publish` field can be used to prevent a package from being published to a
@@ -396,6 +404,7 @@ allowed to be published to.
396404
publish = ["some-registry-name"]
397405
```
398406

407+
<a id="the-metadata-table-optional"></a>
399408
#### The `metadata` table
400409

401410
Cargo by default will warn about unused keys in `Cargo.toml` to assist in
@@ -539,7 +548,7 @@ more detail.
539548
"#integration-tests": "cargo-targets.html#integration-tests",
540549
"#configuring-a-target": "cargo-targets.html#configuring-a-target",
541550
"#target-auto-discovery": "cargo-targets.html#target-auto-discovery",
542-
"#the-required-features-field": "cargo-targets.html#the-required-features-field",
551+
"#the-required-features-field-optional": "cargo-targets.html#the-required-features-field",
543552
"#building-dynamic-or-static-libraries": "cargo-targets.html#the-crate-type-field",
544553
"#the-workspace-section": "workspaces.html#the-workspace-section",
545554
"#virtual-manifest": "workspaces.html",

0 commit comments

Comments
 (0)