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 #70110

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 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
425e7e5
Don't insert panic when generator can not return
jonas-schievink Mar 7, 2020
5ac41a1
Don't insert panic when generator can not unwind
jonas-schievink Mar 7, 2020
46aeef6
Poison generators when any terminator unwinds
jonas-schievink Mar 7, 2020
8d9f633
Change index for SwitchInt case
jonas-schievink Mar 8, 2020
2cbccce
Add test for unnecessary panic branches
jonas-schievink Mar 8, 2020
57f1bb1
clean up E0308 explanation
GuillaumeGomez Feb 13, 2020
64460a1
Update tests
GuillaumeGomez Mar 8, 2020
cb58de8
Apply suggestions from code review
jonas-schievink 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
38fa378
Swap inserts to keep the original ordering
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
3314a34
Don't unwind when hitting the macro expansion recursion limit
Zoxc Feb 26, 2020
bdaf9e4
Update test
Zoxc Feb 29, 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
bb9f14c
rustc_expand::base: nix panictry! uses
Centril Mar 17, 2020
a57ccf7
nix panictry! in ParserAnyMacro::make
Centril Mar 17, 2020
1b8331b
nix remaining rustc_expand::panictry! uses.
Centril Mar 17, 2020
3c71f70
generic_extension: defatalize Error case
Centril Mar 17, 2020
76c5a4f
defatalize BangProcMacro::expand
Centril Mar 17, 2020
4bea03d
defatalize AttrProcMacro::expand
Centril Mar 17, 2020
a98ea5a
defatalize ProcMacroDerive::expand
Centril Mar 17, 2020
576c7c9
remove ExtCxt::struct_span_warn
Centril Mar 17, 2020
8dddaed
mbe::transcribe: defatalize errors.
Centril Mar 17, 2020
ad5304a
defatalize `compile_declarative_macro`
Centril Mar 17, 2020
de6e144
expand: nix unused method
Centril Mar 17, 2020
c440890
defatalize get_test_runner
Centril Mar 17, 2020
5a42b65
defatalize expand_test_or_bench
Centril Mar 17, 2020
83313e4
expand: add recovery for parse_nt
Centril Mar 17, 2020
7d38b0f
expand: address review comments
Centril Mar 18, 2020
287c4eb
Tidy: fix running rustfmt twice
ehuss Mar 18, 2020
ffa36b8
Rollup merge of #67749 - gilescope:keyword-in, r=Dylan-DPC
Centril Mar 18, 2020
0789d63
Rollup merge of #69139 - GuillaumeGomez:cleanup-e0308, r=Dylan-DPC
Centril Mar 18, 2020
ecf19c3
Rollup merge of #69189 - matthewjasper:erase-the-world, r=nikomatsakis
Centril Mar 18, 2020
e42a844
Rollup merge of #69497 - Zoxc:ast-fragment-error, r=petrochenkov
Centril Mar 18, 2020
1fc4515
Rollup merge of #69814 - jonas-schievink:gen-ret-unw, r=Zoxc
Centril Mar 18, 2020
8ab967e
Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obk
Centril Mar 18, 2020
e10ecf1
Rollup merge of #69899 - ecstatic-morse:const-idx-methods, r=oli-obk
Centril Mar 18, 2020
304816b
Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc
Centril Mar 18, 2020
2dc0837
Rollup merge of #70074 - Centril:unpanictry, r=petrochenkov
Centril Mar 18, 2020
f063933
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: 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