Skip to content

Commit e8b55a4

Browse files
committed
Auto merge of #74662 - Manishearth:rollup-jdt7t71, r=Manishearth
Rollup of 9 pull requests Successful merges: - #73783 (Detect when `'static` obligation might come from an `impl`) - #73868 (Advertise correct stable version for const control flow) - #74460 (rustdoc: Always warn when linking from public to private items) - #74538 (Guard against non-monomorphized type_id intrinsic call) - #74541 (Add the aarch64-apple-darwin target ) - #74600 (Enable perf try builder) - #74618 (Do not ICE on assoc type with bad placeholder) - #74631 (rustc_target: Add a target spec option for disabling `--eh-frame-hdr`) - #74643 (build: Remove unnecessary `cargo:rerun-if-env-changed` annotations) Failed merges: r? @ghost
2 parents 4a86573 + b32383c commit e8b55a4

File tree

115 files changed

+1582
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1582
-562
lines changed

.github/workflows/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ name: CI
2020
branches:
2121
- auto
2222
- try
23+
- try-perf
2324
- master
2425
pull_request:
2526
branches:
@@ -146,7 +147,7 @@ jobs:
146147
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
147148
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
148149
CACHE_DOMAIN: ci-caches.rust-lang.org
149-
if: "github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
150+
if: "github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
150151
strategy:
151152
matrix:
152153
include:
@@ -717,7 +718,7 @@ jobs:
717718
try-success:
718719
needs:
719720
- try
720-
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
721+
if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
721722
steps:
722723
- name: mark the job as a success
723724
run: exit 0
@@ -727,7 +728,7 @@ jobs:
727728
try-failure:
728729
needs:
729730
- try
730-
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
731+
if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
731732
steps:
732733
- name: mark the job as a failure
733734
run: exit 1

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ version = "0.1.0"
412412

413413
[[package]]
414414
name = "cc"
415-
version = "1.0.57"
415+
version = "1.0.58"
416416
source = "registry+https://github.com/rust-lang/crates.io-index"
417-
checksum = "0fde55d2a2bfaa4c9668bbc63f531fbdeee3ffe188f4662511ce2c22b3eedebe"
417+
checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
418418
dependencies = [
419419
"jobserver",
420420
]
@@ -1576,9 +1576,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
15761576

15771577
[[package]]
15781578
name = "libc"
1579-
version = "0.2.71"
1579+
version = "0.2.73"
15801580
source = "registry+https://github.com/rust-lang/crates.io-index"
1581-
checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49"
1581+
checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9"
15821582
dependencies = [
15831583
"rustc-std-workspace-core",
15841584
]

src/build_helper/lib.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::ffi::{OsStr, OsString};
2+
use std::fmt::Display;
13
use std::path::{Path, PathBuf};
24
use std::process::{Command, Stdio};
35
use std::time::{SystemTime, UNIX_EPOCH};
@@ -28,6 +30,14 @@ macro_rules! t {
2830
};
2931
}
3032

33+
/// Reads an environment variable and adds it to dependencies.
34+
/// Supposed to be used for all variables except those set for build scripts by cargo
35+
/// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
36+
pub fn tracked_env_var_os<K: AsRef<OsStr> + Display>(key: K) -> Option<OsString> {
37+
println!("cargo:rerun-if-env-changed={}", key);
38+
env::var_os(key)
39+
}
40+
3141
// Because Cargo adds the compiler's dylib path to our library search path, llvm-config may
3242
// break: the dylib path for the compiler, as of this writing, contains a copy of the LLVM
3343
// shared library, which means that when our freshly built llvm-config goes to load it's
@@ -37,10 +47,8 @@ macro_rules! t {
3747
// perfect -- we might actually want to see something from Cargo's added library paths -- but
3848
// for now it works.
3949
pub fn restore_library_path() {
40-
println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH_VAR");
41-
println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH");
42-
let key = env::var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
43-
if let Some(env) = env::var_os("REAL_LIBRARY_PATH") {
50+
let key = tracked_env_var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
51+
if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") {
4452
env::set_var(&key, &env);
4553
} else {
4654
env::remove_var(&key);

src/ci/github-actions/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ on:
247247
branches:
248248
- auto
249249
- try
250+
- try-perf
250251
- master
251252
pull_request:
252253
branches:
@@ -285,7 +286,7 @@ jobs:
285286
name: try
286287
env:
287288
<<: [*shared-ci-variables, *prod-variables]
288-
if: github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'
289+
if: github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'
289290
strategy:
290291
matrix:
291292
include:
@@ -645,11 +646,11 @@ jobs:
645646
# successful listening to webhooks only.
646647
try-success:
647648
needs: [try]
648-
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
649+
if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
649650
<<: *base-success-job
650651
try-failure:
651652
needs: [try]
652-
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
653+
if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
653654
<<: *base-failure-job
654655
auto-success:
655656
needs: [auto]

src/libprofiler_builtins/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[package]
22
authors = ["The Rust Project Developers"]
3-
build = "build.rs"
43
name = "profiler_builtins"
54
version = "0.0.0"
65
edition = "2018"

src/libprofiler_builtins/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ fn main() {
99
let target = env::var("TARGET").expect("TARGET was not set");
1010
let cfg = &mut cc::Build::new();
1111

12+
// FIXME: `rerun-if-changed` directives are not currently emitted and the build script
13+
// will not rerun on changes in these source files or headers included into them.
1214
let mut profile_sources = vec![
1315
"GCDAProfiling.c",
1416
"InstrProfiling.c",

src/librustc_ast/build.rs

-5
This file was deleted.

src/librustc_attr/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ authors = ["The Rust Project Developers"]
33
name = "rustc_attr"
44
version = "0.0.0"
55
edition = "2018"
6-
build = "build.rs"
76

87
[lib]
98
name = "rustc_attr"

src/librustc_attr/build.rs

-5
This file was deleted.

src/librustc_codegen_llvm/build.rs

-6
This file was deleted.

src/librustc_codegen_ssa/back/link.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,9 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
15981598
}
15991599

16001600
// NO-OPT-OUT, OBJECT-FILES-NO, AUDIT-ORDER
1601-
cmd.add_eh_frame_header();
1601+
if sess.target.target.options.eh_frame_header {
1602+
cmd.add_eh_frame_header();
1603+
}
16021604

16031605
// NO-OPT-OUT, OBJECT-FILES-NO
16041606
if crt_objects_fallback {

src/librustc_codegen_ssa/back/linker.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,7 @@ impl<'a> Linker for GccLinker<'a> {
619619
// Some versions of `gcc` add it implicitly, some (e.g. `musl-gcc`) don't,
620620
// so we just always add it.
621621
fn add_eh_frame_header(&mut self) {
622-
if !self.sess.target.target.options.is_like_osx
623-
&& !self.sess.target.target.options.is_like_windows
624-
&& !self.sess.target.target.options.is_like_solaris
625-
&& self.sess.target.target.target_os != "uefi"
626-
{
627-
self.linker_arg("--eh-frame-hdr");
628-
}
622+
self.linker_arg("--eh-frame-hdr");
629623
}
630624
}
631625

src/librustc_codegen_ssa/build.rs

-4
This file was deleted.

src/librustc_driver/build.rs

-7
This file was deleted.

src/librustc_error_codes/error_codes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,5 @@ E0771: include_str!("./error_codes/E0771.md"),
633633
E0755, // `#[ffi_pure]` is only allowed on foreign functions
634634
E0756, // `#[ffi_const]` is only allowed on foreign functions
635635
E0757, // `#[ffi_const]` functions cannot be `#[ffi_pure]`
636+
E0772, // `'static' obligation coming from `impl dyn Trait {}` or `impl Foo for dyn Bar {}`.
636637
}

src/librustc_feature/accepted.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ declare_features! (
262262
/// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`.
263263
(accepted, slice_patterns, "1.42.0", Some(62254), None),
264264
/// Allows the use of `if` and `match` in constants.
265-
(accepted, const_if_match, "1.45.0", Some(49146), None),
265+
(accepted, const_if_match, "1.46.0", Some(49146), None),
266266
/// Allows the use of `loop` and `while` in constants.
267-
(accepted, const_loop, "1.45.0", Some(52000), None),
267+
(accepted, const_loop, "1.46.0", Some(52000), None),
268268
/// Allows `#[track_caller]` to be used which provides
269269
/// accurate caller location reporting during panic (RFC 2091).
270270
(accepted, track_caller, "1.46.0", Some(47809), None),

src/librustc_hir/hir.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,17 @@ pub enum IsAsync {
21982198
NotAsync,
21992199
}
22002200

2201-
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
2201+
#[derive(
2202+
Copy,
2203+
Clone,
2204+
PartialEq,
2205+
RustcEncodable,
2206+
RustcDecodable,
2207+
Debug,
2208+
HashStable_Generic,
2209+
Eq,
2210+
Hash
2211+
)]
22022212
pub enum Defaultness {
22032213
Default { has_value: bool },
22042214
Final,

src/librustc_incremental/build.rs

-4
This file was deleted.

src/librustc_infer/infer/combine.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ use crate::traits::{Obligation, PredicateObligations};
3636

3737
use rustc_ast::ast;
3838
use rustc_hir::def_id::DefId;
39+
use rustc_middle::traits::ObligationCause;
3940
use rustc_middle::ty::error::TypeError;
4041
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
4142
use rustc_middle::ty::subst::SubstsRef;
4243
use rustc_middle::ty::{self, InferConst, ToPredicate, Ty, TyCtxt, TypeFoldable};
4344
use rustc_middle::ty::{IntType, UintType};
44-
use rustc_span::{Span, DUMMY_SP};
45+
use rustc_span::DUMMY_SP;
4546

4647
#[derive(Clone)]
4748
pub struct CombineFields<'infcx, 'tcx> {
@@ -367,10 +368,11 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
367368
};
368369

369370
debug!("generalize: for_universe = {:?}", for_universe);
371+
debug!("generalize: trace = {:?}", self.trace);
370372

371373
let mut generalize = Generalizer {
372374
infcx: self.infcx,
373-
span: self.trace.cause.span,
375+
cause: &self.trace.cause,
374376
for_vid_sub_root: self.infcx.inner.borrow_mut().type_variables().sub_root_var(for_vid),
375377
for_universe,
376378
ambient_variance,
@@ -414,7 +416,7 @@ struct Generalizer<'cx, 'tcx> {
414416
infcx: &'cx InferCtxt<'cx, 'tcx>,
415417

416418
/// The span, used when creating new type variables and things.
417-
span: Span,
419+
cause: &'cx ObligationCause<'tcx>,
418420

419421
/// The vid of the type variable that is in the process of being
420422
/// instantiated; if we find this within the type we are folding,
@@ -639,7 +641,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
639641

640642
// FIXME: This is non-ideal because we don't give a
641643
// very descriptive origin for this region variable.
642-
Ok(self.infcx.next_region_var_in_universe(MiscVariable(self.span), self.for_universe))
644+
Ok(self.infcx.next_region_var_in_universe(MiscVariable(self.cause.span), self.for_universe))
643645
}
644646

645647
fn consts(

src/librustc_infer/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
20102010
infer::MiscVariable(_) => String::new(),
20112011
infer::PatternRegion(_) => " for pattern".to_string(),
20122012
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
2013-
infer::Autoref(_) => " for autoref".to_string(),
2013+
infer::Autoref(_, _) => " for autoref".to_string(),
20142014
infer::Coercion(_) => " for automatic coercion".to_string(),
20152015
infer::LateBoundRegion(_, br, infer::FnCall) => {
20162016
format!(" for lifetime parameter {}in function call", br_string(br))

0 commit comments

Comments
 (0)