Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #70112

Merged
merged 66 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a113609
keyword docs for else and inkeyword docs for else and in.
gilescope Dec 30, 2019
57f1bb1
clean up E0308 explanation
GuillaumeGomez Feb 13, 2020
64460a1
Update tests
GuillaumeGomez Mar 8, 2020
f5efb68
miri: categorize errors into "unsupported" and "UB"
RalfJung Mar 8, 2020
d02543a
fmt, tweak messages and bless
RalfJung Mar 8, 2020
9a95b01
generalize InvalidNullPointerUsage to InvalidIntPointerUsage
RalfJung Mar 8, 2020
3ebcd78
fmt, and fix rustfmt-induced rebase hickup
RalfJung Mar 8, 2020
2764d3d
start Miri messages lower-case
RalfJung Mar 9, 2020
3e61442
explain why we catch PointerUseAfterFree
RalfJung Mar 9, 2020
d8f8168
avoid boolean inversion
RalfJung Mar 9, 2020
9681422
we are on 2018 edition, use try block
RalfJung Mar 9, 2020
93436d8
make error message less confusing
RalfJung Mar 9, 2020
e219dd4
fmt
RalfJung Mar 11, 2020
b2779d8
Use smaller discriminants for generators
jonas-schievink Mar 9, 2020
4266807
Add a test for generator discriminants
jonas-schievink Mar 9, 2020
49aabd8
Fix rebase fallout
jonas-schievink Mar 14, 2020
73a625b
remove unnecessary hir::map imports
Centril Mar 11, 2020
4392a8b
use direct imports for `rustc::{lint, session}`.
Centril Mar 11, 2020
5a9ccc9
Remove `free_region_map` from `TypeckTables`
matthewjasper Nov 30, 2019
cefd030
Don't use `TypeckTables` in NiceRegionError
matthewjasper Feb 15, 2020
0a7f16e
Erase regions in writeback
matthewjasper Feb 15, 2020
1ee5829
Update tests for erasing regions in typeck
matthewjasper Feb 15, 2020
aa20d96
Don't prepend with space before paren
GuillaumeGomez Mar 17, 2020
429b16e
Make `newtype_index` methods const
ecstatic-morse Mar 10, 2020
7f5a284
Rename `from_u32_const` -> `from_u32`
ecstatic-morse Mar 10, 2020
cc4a577
Add requisite feature gates for const assert
ecstatic-morse Mar 10, 2020
9ac93ee
Hold index of generator `self` arg in `const`
ecstatic-morse Mar 10, 2020
81172d8
Update pretty tests
GuillaumeGomez Mar 17, 2020
9a017da
Update rustdoc test and remove TODO comment
GuillaumeGomez Mar 17, 2020
bc75cba
submod_path_from_attr: simplify & document
Centril Mar 7, 2020
2899a58
extract error_cannot_declare_mod_here
Centril Mar 7, 2020
185c1d3
extract error_decl_mod_in_block
Centril Mar 7, 2020
2db5d49
simplify submod_path
Centril Mar 7, 2020
803de31
submod_path: use id.span
Centril Mar 7, 2020
7108b7f
extract parse_mod
Centril Mar 7, 2020
dfcefa4
extract error_on_circular_module
Centril Mar 7, 2020
ca098b1
detach submod_path from Parser
Centril Mar 8, 2020
53a633f
decouple push_directory from Parser
Centril Mar 8, 2020
98e71cd
decouple eval_src_mod from Parser
Centril Mar 8, 2020
b9e1b26
expand: use push_directory
Centril Mar 8, 2020
8bab88f
de-fatalize outline module parsing
Centril Mar 8, 2020
463995f
extract parse_external_module
Centril Mar 8, 2020
59bf8a0
extract error_on_circular_module
Centril Mar 8, 2020
83a757a
outline modules: parse -> expand.
Centril Mar 8, 2020
f1ca996
parse: module parsing -> item.rs
Centril Mar 8, 2020
ddcc8ec
move Directory -> parser::module
Centril Mar 8, 2020
3796fae
{rustc_parse::parser -> rustc_expand}::module
Centril Mar 8, 2020
31ee8e0
{rustc_parse -> rustc_expand}::config
Centril Mar 8, 2020
a6cb04f
add test for stripped nested outline module
Centril Mar 8, 2020
7d0e5bb
parser/expand: minor cleanup
Centril Mar 9, 2020
fe71342
tweak outline module parsing spans
Centril Mar 9, 2020
41a0b3e
use pretty-compare-only in a test
Centril Mar 10, 2020
5ee4f6f
fix pre-expansion linting infra
Centril Mar 15, 2020
e301291
fix rebase fallout
Centril Mar 15, 2020
8caf688
--bless windows test
Centril Mar 17, 2020
287c4eb
Tidy: fix running rustfmt twice
ehuss Mar 18, 2020
5610684
Rollup merge of #67749 - gilescope:keyword-in, r=Dylan-DPC
Centril Mar 18, 2020
8188b21
Rollup merge of #69139 - GuillaumeGomez:cleanup-e0308, r=Dylan-DPC
Centril Mar 18, 2020
3f583fc
Rollup merge of #69189 - matthewjasper:erase-the-world, r=nikomatsakis
Centril Mar 18, 2020
4118ff6
Rollup merge of #69837 - jonas-schievink:gen-discr-opt, r=tmandry
Centril Mar 18, 2020
23b79d8
Rollup merge of #69838 - Centril:expand-module, r=petrochenkov
Centril Mar 18, 2020
a958314
Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obk
Centril Mar 18, 2020
2521849
Rollup merge of #69899 - ecstatic-morse:const-idx-methods, r=oli-obk
Centril Mar 18, 2020
292c538
Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc
Centril Mar 18, 2020
60a2d06
Rollup merge of #70075 - GuillaumeGomez:fix-repr-display, r=petrochenkov
Centril Mar 18, 2020
b6f61a1
Rollup merge of #70106 - ehuss:fix-tidy-fmt-twice, r=Mark-Simulacrum
Centril Mar 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3624,6 +3624,7 @@ dependencies = [
"rustc_data_structures",
"rustc_hir",
"rustc_metadata",
"rustc_session",
"rustc_span",
"rustc_target",
]
Expand Down Expand Up @@ -3677,6 +3678,7 @@ dependencies = [
"rustc_parse",
"rustc_plugin_impl",
"rustc_save_analysis",
"rustc_session",
"rustc_span",
"rustc_target",
"serialize",
Expand Down Expand Up @@ -3791,6 +3793,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_session",
"rustc_span",
"rustc_target",
"smallvec 1.0.0",
Expand Down Expand Up @@ -3903,6 +3906,7 @@ dependencies = [
"rustc_expand",
"rustc_hir",
"rustc_index",
"rustc_session",
"rustc_span",
"rustc_target",
"serialize",
Expand Down Expand Up @@ -3933,6 +3937,7 @@ dependencies = [
"rustc_infer",
"rustc_lexer",
"rustc_macros",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
Expand Down Expand Up @@ -4013,6 +4018,7 @@ dependencies = [
"rustc_hir",
"rustc_lint",
"rustc_metadata",
"rustc_session",
"rustc_span",
]

Expand All @@ -4027,6 +4033,7 @@ dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_session",
"rustc_span",
"rustc_typeck",
]
Expand Down Expand Up @@ -4068,6 +4075,7 @@ dependencies = [
"rustc_data_structures",
"rustc_hir",
"rustc_parse",
"rustc_session",
"rustc_span",
"serde_json",
]
Expand Down Expand Up @@ -4174,6 +4182,7 @@ dependencies = [
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
Expand All @@ -4193,6 +4202,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ struct RustfmtConfig {
}

pub fn format(build: &Build, check: bool) {
if build.config.dry_run {
return;
}
let mut builder = ignore::types::TypesBuilder::new();
builder.add_defaults();
builder.select("rust");
Expand Down
2 changes: 0 additions & 2 deletions src/libpanic_unwind/emcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//! Emscripten's runtime always implements those APIs and does not
//! implement libunwind.

#![allow(private_no_mangle_fns)]

use alloc::boxed::Box;
use core::any::Any;
use core::mem;
Expand Down
2 changes: 0 additions & 2 deletions src/libpanic_unwind/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
//! Once stack has been unwound down to the handler frame level, unwinding stops
//! and the last personality routine transfers control to the catch block.

#![allow(private_no_mangle_fns)]

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

Expand Down
1 change: 0 additions & 1 deletion src/libpanic_unwind/seh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
//! [llvm]: http://llvm.org/docs/ExceptionHandling.html#background-on-windows-exceptions

#![allow(nonstandard_style)]
#![allow(private_no_mangle_fns)]

use alloc::boxed::Box;
use core::any::Any;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl<'hir> Map<'hir> {
}

fn get_entry(&self, id: HirId) -> Entry<'hir> {
if id.local_id == ItemLocalId::from_u32_const(0) {
if id.local_id == ItemLocalId::from_u32(0) {
let owner = self.tcx.hir_owner(id.owner_def_id());
Entry { parent: owner.parent, node: owner.node }
} else {
Expand Down
5 changes: 2 additions & 3 deletions src/librustc/ich/hcx.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::hir::map::definitions::Definitions;
use crate::hir::map::DefPathHash;
use crate::hir::map::definitions::{DefPathHash, Definitions};
use crate::ich::{self, CachingSourceMapView};
use crate::middle::cstore::CrateStore;
use crate::session::Session;
use crate::ty::{fast_reject, TyCtxt};

use rustc_ast::ast;
Expand All @@ -11,6 +9,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::Lrc;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, DefIndex};
use rustc_session::Session;
use rustc_span::source_map::SourceMap;
use rustc_span::symbol::Symbol;
use rustc_span::{BytePos, SourceFile};
Expand Down
4 changes: 3 additions & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(const_if_match)]
#![feature(const_fn)]
#![feature(const_panic)]
#![feature(const_transmute)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
Expand Down Expand Up @@ -80,7 +83,6 @@ pub mod infer;
pub mod lint;
pub mod middle;
pub mod mir;
pub use rustc_session as session;
pub mod traits;
pub mod ty;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_errors::{pluralize, Applicability, DiagnosticBuilder, DiagnosticId};
use rustc_hir::HirId;
pub use rustc_session::lint::{builtin, Level, Lint, LintId, LintPass};
use rustc_session::lint::{builtin, Level, Lint, LintId};
use rustc_session::{DiagnosticMessageId, Session};
use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
Expand Down
18 changes: 9 additions & 9 deletions src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
//! are *mostly* used as a part of that interface, but these should
//! probably get a better home if someone can find one.

use crate::hir::map as hir_map;
use crate::hir::map::definitions::{DefKey, DefPathTable};
use crate::session::search_paths::PathKind;
use crate::session::CrateDisambiguator;
pub use self::NativeLibraryKind::*;

use crate::hir::map::definitions::{DefKey, DefPath, DefPathHash, DefPathTable};
use crate::ty::TyCtxt;

use rustc_ast::ast;
Expand All @@ -14,15 +13,16 @@ use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::{self, MetadataRef};
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc_macros::HashStable;
use rustc_session::search_paths::PathKind;
pub use rustc_session::utils::NativeLibraryKind;
use rustc_session::CrateDisambiguator;
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use rustc_target::spec::Target;

use std::any::Any;
use std::path::{Path, PathBuf};

pub use self::NativeLibraryKind::*;
pub use rustc_session::utils::NativeLibraryKind;

// lonely orphan structs and enums looking for a better home

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

// resolve
fn def_key(&self, def: DefId) -> DefKey;
fn def_path(&self, def: DefId) -> hir_map::DefPath;
fn def_path_hash(&self, def: DefId) -> hir_map::DefPathHash;
fn def_path(&self, def: DefId) -> DefPath;
fn def_path_hash(&self, def: DefId) -> DefPathHash;
fn def_path_table(&self, cnum: CrateNum) -> &DefPathTable;

// "queries" used in resolve that aren't tracked for incremental compilation
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/dependency_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! For all the gory details, see the provider of the `dependency_formats`
//! query.

use crate::session::config;
use rustc_session::config;

/// A list of dependencies for a certain crate type.
///
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//! this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
//! just peeks and looks for that attribute.

use crate::session::Session;
use core::num::IntErrorKind;
use rustc::bug;
use rustc_ast::ast;
use rustc_data_structures::sync::Once;
use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol};

use rustc_data_structures::sync::Once;
use std::num::IntErrorKind;

pub fn update_limits(sess: &Session, krate: &ast::Crate) {
update_limit(sess, krate, &sess.recursion_limit, sym::recursion_limit, 128);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

pub use self::StabilityLevel::*;

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

Expand Down
5 changes: 3 additions & 2 deletions src/librustc/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub struct Allocation<Tag = (), Extra = ()> {
/// The size of the allocation. Currently, must always equal `bytes.len()`.
pub size: Size,
/// The alignment of the allocation to detect unaligned reads.
/// (`Align` guarantees that this is a power of two.)
pub align: Align,
/// `true` if the allocation is mutable.
/// Also used by codegen to determine if a static should be put into mutable memory,
Expand Down Expand Up @@ -314,7 +315,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
&self.get_bytes(cx, ptr, size_with_null)?[..size]
}
// This includes the case where `offset` is out-of-bounds to begin with.
None => throw_unsup!(UnterminatedCString(ptr.erase_tag())),
None => throw_ub!(UnterminatedCString(ptr.erase_tag())),
})
}

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

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