Skip to content

Commit 57e1da5

Browse files
committed
Auto merge of #70118 - pietroalbini:rollup-pgjc90i, r=pietroalbini
Rollup of 2 pull requests Successful merges: - #70112 (Rollup of 10 pull requests) - #70116 (ci: use python from the correct path) Failed merges: r? @ghost
2 parents f509b26 + 94ed071 commit 57e1da5

File tree

285 files changed

+2027
-1839
lines changed

Some content is hidden

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

285 files changed

+2027
-1839
lines changed

Cargo.lock

+10
Original file line numberDiff line numberDiff line change
@@ -3624,6 +3624,7 @@ dependencies = [
36243624
"rustc_data_structures",
36253625
"rustc_hir",
36263626
"rustc_metadata",
3627+
"rustc_session",
36273628
"rustc_span",
36283629
"rustc_target",
36293630
]
@@ -3677,6 +3678,7 @@ dependencies = [
36773678
"rustc_parse",
36783679
"rustc_plugin_impl",
36793680
"rustc_save_analysis",
3681+
"rustc_session",
36803682
"rustc_span",
36813683
"rustc_target",
36823684
"serialize",
@@ -3791,6 +3793,7 @@ dependencies = [
37913793
"rustc_hir",
37923794
"rustc_index",
37933795
"rustc_macros",
3796+
"rustc_session",
37943797
"rustc_span",
37953798
"rustc_target",
37963799
"smallvec 1.0.0",
@@ -3903,6 +3906,7 @@ dependencies = [
39033906
"rustc_expand",
39043907
"rustc_hir",
39053908
"rustc_index",
3909+
"rustc_session",
39063910
"rustc_span",
39073911
"rustc_target",
39083912
"serialize",
@@ -3933,6 +3937,7 @@ dependencies = [
39333937
"rustc_infer",
39343938
"rustc_lexer",
39353939
"rustc_macros",
3940+
"rustc_session",
39363941
"rustc_span",
39373942
"rustc_target",
39383943
"rustc_trait_selection",
@@ -4013,6 +4018,7 @@ dependencies = [
40134018
"rustc_hir",
40144019
"rustc_lint",
40154020
"rustc_metadata",
4021+
"rustc_session",
40164022
"rustc_span",
40174023
]
40184024

@@ -4027,6 +4033,7 @@ dependencies = [
40274033
"rustc_data_structures",
40284034
"rustc_errors",
40294035
"rustc_hir",
4036+
"rustc_session",
40304037
"rustc_span",
40314038
"rustc_typeck",
40324039
]
@@ -4068,6 +4075,7 @@ dependencies = [
40684075
"rustc_data_structures",
40694076
"rustc_hir",
40704077
"rustc_parse",
4078+
"rustc_session",
40714079
"rustc_span",
40724080
"serde_json",
40734081
]
@@ -4174,6 +4182,7 @@ dependencies = [
41744182
"rustc_data_structures",
41754183
"rustc_hir",
41764184
"rustc_infer",
4185+
"rustc_session",
41774186
"rustc_span",
41784187
"rustc_target",
41794188
"rustc_trait_selection",
@@ -4193,6 +4202,7 @@ dependencies = [
41934202
"rustc_hir",
41944203
"rustc_index",
41954204
"rustc_infer",
4205+
"rustc_session",
41964206
"rustc_span",
41974207
"rustc_target",
41984208
"rustc_trait_selection",

src/bootstrap/format.rs

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ struct RustfmtConfig {
3737
}
3838

3939
pub fn format(build: &Build, check: bool) {
40+
if build.config.dry_run {
41+
return;
42+
}
4043
let mut builder = ignore::types::TypesBuilder::new();
4144
builder.add_defaults();
4245
builder.select("rust");

src/ci/scripts/install-msys2-packages.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if isWindows; then
1313
# one way or another. The msys interpreters seem to have weird path conversions
1414
# baked in which break LLVM's build system one way or another, so let's use the
1515
# native version which keeps everything as native as possible.
16-
cp C:/Python27amd64/python.exe C:/Python27amd64/python2.7.exe
17-
ciCommandAddPath "C:\\Python27amd64"
16+
python_home="C:/hostedtoolcache/windows/Python/2.7.17/x64"
17+
cp "${python_home}/python.exe" "${python_home}/python2.7.exe"
18+
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\2.7.17\\x64"
1819
fi

src/libpanic_unwind/emcc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//! Emscripten's runtime always implements those APIs and does not
77
//! implement libunwind.
88
9-
#![allow(private_no_mangle_fns)]
10-
119
use alloc::boxed::Box;
1210
use core::any::Any;
1311
use core::mem;

src/libpanic_unwind/gcc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
//! Once stack has been unwound down to the handler frame level, unwinding stops
3737
//! and the last personality routine transfers control to the catch block.
3838
39-
#![allow(private_no_mangle_fns)]
40-
4139
use alloc::boxed::Box;
4240
use core::any::Any;
4341

src/libpanic_unwind/seh.rs

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
//! [llvm]: http://llvm.org/docs/ExceptionHandling.html#background-on-windows-exceptions
4646
4747
#![allow(nonstandard_style)]
48-
#![allow(private_no_mangle_fns)]
4948

5049
use alloc::boxed::Box;
5150
use core::any::Any;

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<'hir> Map<'hir> {
346346
}
347347

348348
fn get_entry(&self, id: HirId) -> Entry<'hir> {
349-
if id.local_id == ItemLocalId::from_u32_const(0) {
349+
if id.local_id == ItemLocalId::from_u32(0) {
350350
let owner = self.tcx.hir_owner(id.owner_def_id());
351351
Entry { parent: owner.parent, node: owner.node }
352352
} else {

src/librustc/ich/hcx.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
use crate::hir::map::definitions::Definitions;
2-
use crate::hir::map::DefPathHash;
1+
use crate::hir::map::definitions::{DefPathHash, Definitions};
32
use crate::ich::{self, CachingSourceMapView};
43
use crate::middle::cstore::CrateStore;
5-
use crate::session::Session;
64
use crate::ty::{fast_reject, TyCtxt};
75

86
use rustc_ast::ast;
@@ -11,6 +9,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
119
use rustc_data_structures::sync::Lrc;
1210
use rustc_hir as hir;
1311
use rustc_hir::def_id::{DefId, DefIndex};
12+
use rustc_session::Session;
1413
use rustc_span::source_map::SourceMap;
1514
use rustc_span::symbol::Symbol;
1615
use rustc_span::{BytePos, SourceFile};

src/librustc/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#![feature(bool_to_option)]
2727
#![feature(box_patterns)]
2828
#![feature(box_syntax)]
29+
#![feature(const_if_match)]
30+
#![feature(const_fn)]
31+
#![feature(const_panic)]
2932
#![feature(const_transmute)]
3033
#![feature(core_intrinsics)]
3134
#![feature(drain_filter)]
@@ -80,7 +83,6 @@ pub mod infer;
8083
pub mod lint;
8184
pub mod middle;
8285
pub mod mir;
83-
pub use rustc_session as session;
8486
pub mod traits;
8587
pub mod ty;
8688

src/librustc/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
55
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
66
use rustc_errors::{pluralize, Applicability, DiagnosticBuilder, DiagnosticId};
77
use rustc_hir::HirId;
8-
pub use rustc_session::lint::{builtin, Level, Lint, LintId, LintPass};
8+
use rustc_session::lint::{builtin, Level, Lint, LintId};
99
use rustc_session::{DiagnosticMessageId, Session};
1010
use rustc_span::hygiene::MacroKind;
1111
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};

src/librustc/middle/cstore.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
//! are *mostly* used as a part of that interface, but these should
33
//! probably get a better home if someone can find one.
44
5-
use crate::hir::map as hir_map;
6-
use crate::hir::map::definitions::{DefKey, DefPathTable};
7-
use crate::session::search_paths::PathKind;
8-
use crate::session::CrateDisambiguator;
5+
pub use self::NativeLibraryKind::*;
6+
7+
use crate::hir::map::definitions::{DefKey, DefPath, DefPathHash, DefPathTable};
98
use crate::ty::TyCtxt;
109

1110
use rustc_ast::ast;
@@ -14,15 +13,16 @@ use rustc_data_structures::svh::Svh;
1413
use rustc_data_structures::sync::{self, MetadataRef};
1514
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
1615
use rustc_macros::HashStable;
16+
use rustc_session::search_paths::PathKind;
17+
pub use rustc_session::utils::NativeLibraryKind;
18+
use rustc_session::CrateDisambiguator;
1719
use rustc_span::symbol::Symbol;
1820
use rustc_span::Span;
1921
use rustc_target::spec::Target;
22+
2023
use std::any::Any;
2124
use std::path::{Path, PathBuf};
2225

23-
pub use self::NativeLibraryKind::*;
24-
pub use rustc_session::utils::NativeLibraryKind;
25-
2626
// lonely orphan structs and enums looking for a better home
2727

2828
/// Where a crate came from on the local filesystem. One of these three options
@@ -197,8 +197,8 @@ pub trait CrateStore {
197197

198198
// resolve
199199
fn def_key(&self, def: DefId) -> DefKey;
200-
fn def_path(&self, def: DefId) -> hir_map::DefPath;
201-
fn def_path_hash(&self, def: DefId) -> hir_map::DefPathHash;
200+
fn def_path(&self, def: DefId) -> DefPath;
201+
fn def_path_hash(&self, def: DefId) -> DefPathHash;
202202
fn def_path_table(&self, cnum: CrateNum) -> &DefPathTable;
203203

204204
// "queries" used in resolve that aren't tracked for incremental compilation

src/librustc/middle/dependency_format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! For all the gory details, see the provider of the `dependency_formats`
55
//! query.
66
7-
use crate::session::config;
7+
use rustc_session::config;
88

99
/// A list of dependencies for a certain crate type.
1010
///

src/librustc/middle/limits.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
//! this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
66
//! just peeks and looks for that attribute.
77
8-
use crate::session::Session;
9-
use core::num::IntErrorKind;
108
use rustc::bug;
119
use rustc_ast::ast;
10+
use rustc_data_structures::sync::Once;
11+
use rustc_session::Session;
1212
use rustc_span::symbol::{sym, Symbol};
1313

14-
use rustc_data_structures::sync::Once;
14+
use std::num::IntErrorKind;
1515

1616
pub fn update_limits(sess: &Session, krate: &ast::Crate) {
1717
update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);

src/librustc/middle/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
pub use self::StabilityLevel::*;
55

6-
use crate::session::{DiagnosticMessageId, Session};
76
use crate::ty::{self, TyCtxt};
87
use rustc_ast::ast::CRATE_NODE_ID;
98
use rustc_attr::{self as attr, ConstStability, Deprecation, RustcDeprecation, Stability};
@@ -17,6 +16,7 @@ use rustc_hir::{self, HirId};
1716
use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE};
1817
use rustc_session::lint::{BuiltinLintDiagnostics, Lint, LintBuffer};
1918
use rustc_session::parse::feature_err_issue;
19+
use rustc_session::{DiagnosticMessageId, Session};
2020
use rustc_span::symbol::{sym, Symbol};
2121
use rustc_span::{MultiSpan, Span};
2222

src/librustc/mir/interpret/allocation.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub struct Allocation<Tag = (), Extra = ()> {
4141
/// The size of the allocation. Currently, must always equal `bytes.len()`.
4242
pub size: Size,
4343
/// The alignment of the allocation to detect unaligned reads.
44+
/// (`Align` guarantees that this is a power of two.)
4445
pub align: Align,
4546
/// `true` if the allocation is mutable.
4647
/// Also used by codegen to determine if a static should be put into mutable memory,
@@ -314,7 +315,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
314315
&self.get_bytes(cx, ptr, size_with_null)?[..size]
315316
}
316317
// This includes the case where `offset` is out-of-bounds to begin with.
317-
None => throw_unsup!(UnterminatedCString(ptr.erase_tag())),
318+
None => throw_ub!(UnterminatedCString(ptr.erase_tag())),
318319
})
319320
}
320321

@@ -573,7 +574,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
573574
fn check_defined(&self, ptr: Pointer<Tag>, size: Size) -> InterpResult<'tcx> {
574575
self.undef_mask
575576
.is_range_defined(ptr.offset, ptr.offset + size)
576-
.or_else(|idx| throw_unsup!(ReadUndefBytes(idx)))
577+
.or_else(|idx| throw_ub!(InvalidUndefBytes(Some(Pointer::new(ptr.alloc_id, idx)))))
577578
}
578579

579580
pub fn mark_definedness(&mut self, ptr: Pointer<Tag>, size: Size, new_state: bool) {

0 commit comments

Comments
 (0)