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 15 pull requests #48520

Merged
merged 44 commits into from
Feb 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e6376a1
Added test for #45157
davidtwco Jan 24, 2018
467b5cf
stabilize (version: 1.26.0) Box::leak, cc #46179
Centril Feb 10, 2018
4861603
stabilize Box::leak: remove #![feature(box_leak)] in docs
Centril Feb 10, 2018
3118cbe
Allow two-phase borrows of &mut self in ops
sapphire-arches Feb 14, 2018
7062955
Fix arguments specified by lxl in two-phase-bin-ops test
sapphire-arches Feb 15, 2018
cf6e2f5
Add nonstandard_style alias for bad_style.
Feb 20, 2018
6fe5f42
Fix carets.
Feb 20, 2018
21e2a5e
Fix filepath in lint test.
Feb 20, 2018
5949d8b
Fix internal references to bad_style in test code.
Feb 20, 2018
20bc72e
Handle custom diagnostic for `&str + String`
estebank Feb 21, 2018
ef48e0f
Update the book to promote second edition
steveklabnik Feb 21, 2018
d98449d
manually release `cx.external_traits` while building the new trait
QuietMisdreavus Feb 21, 2018
ef30a8f
track extern traits being inlined
QuietMisdreavus Feb 22, 2018
bca3b31
proper early-bail condition
QuietMisdreavus Feb 22, 2018
8872e7b
add test for issue 48414 ICE
QuietMisdreavus Feb 22, 2018
0e26bb7
Revert "Implement Ord as necessary"
ishitatsuyuki Feb 18, 2018
93e6b0d
Remove needless dedup from projection
ishitatsuyuki Feb 18, 2018
619ad71
Fix exponential blowup on nested types
ishitatsuyuki Feb 18, 2018
5a2bec9
impl_or_trait_obligations: deduplicate obligations
ishitatsuyuki Feb 18, 2018
98eb4dd
Fix parsing of extern paths in types and poly-traits
petrochenkov Feb 22, 2018
31f66a0
reset default binding mode when we pass through a `&` pattern
nikomatsakis Feb 23, 2018
8b2037c
Introduce UnpackedKind
varkor Feb 23, 2018
bdccbcf
parse `dyn (Foo)` as a trait object
Manishearth Feb 23, 2018
4c73f82
Add test
Manishearth Feb 23, 2018
f2b9686
Bad tags are unreachable
varkor Feb 23, 2018
8640a51
Implement multiple patterns with `|` in `if let` and `while let`
petrochenkov Feb 24, 2018
e3e1c8f
Fix capitalisation in Path#file_name's docs
dwijnand Feb 24, 2018
aafebbc
Remove directory `src/rt`
petrochenkov Feb 24, 2018
edfdfc2
Rollup merge of #47689 - davidtwco:issue-45157, r=nikomatsakis
Manishearth Feb 24, 2018
dd890d8
Rollup merge of #48110 - Centril:stabilize/box_leak, r=alexcrichton
Manishearth Feb 24, 2018
0957572
Rollup merge of #48197 - bobtwinkles:two_phase_borrow_on_ops, r=nikom…
Manishearth Feb 24, 2018
58af0c7
Rollup merge of #48296 - ishitatsuyuki:exp-unblow, r=nikomatsakis
Manishearth Feb 24, 2018
d45c4a6
Rollup merge of #48386 - withoutboats:nonstandard-style, r=Manishearth
Manishearth Feb 24, 2018
7738eb4
Rollup merge of #48392 - estebank:string, r=petrochenkov
Manishearth Feb 24, 2018
9901bef
Rollup merge of #48404 - steveklabnik:second-edition-is-the-best-edit…
Manishearth Feb 24, 2018
43d1d6e
Rollup merge of #48415 - QuietMisdreavus:traits-on-traits-on-traits, …
Manishearth Feb 24, 2018
69757c5
Rollup merge of #48441 - petrochenkov:exty, r=estebank
Manishearth Feb 24, 2018
90f21d4
Rollup merge of #48448 - nikomatsakis:default-binding-mode-issue-4668…
Manishearth Feb 24, 2018
2dba874
Rollup merge of #48452 - varkor:unpacked-kind, r=eddyb
Manishearth Feb 24, 2018
7e68299
Rollup merge of #48481 - Manishearth:dyn-paren, r=petrochenkov
Manishearth Feb 24, 2018
9523c82
Rollup merge of #48490 - petrochenkov:orpat, r=eddyb
Manishearth Feb 24, 2018
0a72101
Rollup merge of #48499 - dwijnand:patch-1, r=BurntSushi
Manishearth Feb 24, 2018
7ba4afc
Rollup merge of #48503 - petrochenkov:nort, r=Mark-Simulacrum
Manishearth Feb 24, 2018
52047f0
ignore-pretty on dyn trait test
Manishearth Feb 25, 2018
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
6 changes: 3 additions & 3 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl Step for TestHelpers {
type Output = ();

fn should_run(run: ShouldRun) -> ShouldRun {
run.path("src/rt/rust_test_helpers.c")
run.path("src/test/auxiliary/rust_test_helpers.c")
}

fn make_run(run: RunConfig) {
Expand All @@ -326,7 +326,7 @@ impl Step for TestHelpers {
let build = builder.build;
let target = self.target;
let dst = build.test_helpers_out(target);
let src = build.src.join("src/rt/rust_test_helpers.c");
let src = build.src.join("src/test/auxiliary/rust_test_helpers.c");
if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
return
}
Expand All @@ -353,7 +353,7 @@ impl Step for TestHelpers {
.opt_level(0)
.warnings(false)
.debug(false)
.file(build.src.join("src/rt/rust_test_helpers.c"))
.file(build.src.join("src/test/auxiliary/rust_test_helpers.c"))
.compile("rust_test_helpers");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 31 files
+1 −1 .travis.yml
+3 −0 first-edition/book.toml
+56 −0 first-edition/src/theme/first-edition.css
+27 −0 first-edition/src/theme/header.hbs
+22 −8 index.md
+2 −2 redirects/getting-started.md
+1 −1 redirects/release-channels.md
+1 −0 second-edition/dictionary.txt
+208 −536 second-edition/nostarch/chapter01.md
+1 −1 second-edition/nostarch/chapter10.md
+875 −941 second-edition/nostarch/chapter20.md
+169 −0 second-edition/nostarch/introduction.md
+7 −7 second-edition/src/SUMMARY.md
+1 −1 second-edition/src/appendix-05-translation.md
+10 −32 second-edition/src/appendix-07-nightly-rust.md
+39 −3 second-edition/src/ch00-00-introduction.md
+12 −0 second-edition/src/ch01-00-getting-started.md
+55 −50 second-edition/src/ch01-01-installation.md
+50 −302 second-edition/src/ch01-02-hello-world.md
+265 −0 second-edition/src/ch01-03-hello-cargo.md
+1 −1 second-edition/src/ch02-00-guessing-game-tutorial.md
+2 −2 second-edition/src/ch10-02-traits.md
+22 −19 second-edition/src/ch20-00-final-project-a-web-server.md
+273 −227 second-edition/src/ch20-01-single-threaded.md
+1,230 −0 second-edition/src/ch20-02-multithreaded.md
+0 −110 second-edition/src/ch20-02-slow-requests.md
+0 −284 second-edition/src/ch20-03-designing-the-interface.md
+128 −124 second-edition/src/ch20-03-graceful-shutdown-and-cleanup.md
+0 −248 second-edition/src/ch20-04-storing-threads.md
+0 −516 second-edition/src/ch20-05-sending-requests-via-channels.md
+0 −276 second-edition/theme/index.hbs
7 changes: 1 addition & 6 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ impl<T: ?Sized> Box<T> {
/// Simple usage:
///
/// ```
/// #![feature(box_leak)]
///
/// fn main() {
/// let x = Box::new(41);
/// let static_ref: &'static mut usize = Box::leak(x);
Expand All @@ -372,17 +370,14 @@ impl<T: ?Sized> Box<T> {
/// Unsized data:
///
/// ```
/// #![feature(box_leak)]
///
/// fn main() {
/// let x = vec![1, 2, 3].into_boxed_slice();
/// let static_ref = Box::leak(x);
/// static_ref[0] = 4;
/// assert_eq!(*static_ref, [4, 2, 3]);
/// }
/// ```
#[unstable(feature = "box_leak", reason = "needs an FCP to stabilize",
issue = "46179")]
#[stable(feature = "box_leak", since = "1.26.0")]
#[inline]
pub fn leak<'a>(b: Box<T>) -> &'a mut T
where
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2956,7 +2956,7 @@ impl<'a> LoweringContext<'a> {

// Desugar ExprIfLet
// From: `if let <pat> = <sub_expr> <body> [<else_opt>]`
ExprKind::IfLet(ref pat, ref sub_expr, ref body, ref else_opt) => {
ExprKind::IfLet(ref pats, ref sub_expr, ref body, ref else_opt) => {
// to:
//
// match <sub_expr> {
Expand All @@ -2970,8 +2970,8 @@ impl<'a> LoweringContext<'a> {
{
let body = self.lower_block(body, false);
let body_expr = P(self.expr_block(body, ThinVec::new()));
let pat = self.lower_pat(pat);
arms.push(self.arm(hir_vec![pat], body_expr));
let pats = pats.iter().map(|pat| self.lower_pat(pat)).collect();
arms.push(self.arm(pats, body_expr));
}

// _ => [<else_opt>|()]
Expand Down Expand Up @@ -3000,7 +3000,7 @@ impl<'a> LoweringContext<'a> {

// Desugar ExprWhileLet
// From: `[opt_ident]: while let <pat> = <sub_expr> <body>`
ExprKind::WhileLet(ref pat, ref sub_expr, ref body, opt_label) => {
ExprKind::WhileLet(ref pats, ref sub_expr, ref body, opt_label) => {
// to:
//
// [opt_ident]: loop {
Expand All @@ -3021,8 +3021,8 @@ impl<'a> LoweringContext<'a> {
// `<pat> => <body>`
let pat_arm = {
let body_expr = P(self.expr_block(body, ThinVec::new()));
let pat = self.lower_pat(pat);
self.arm(hir_vec![pat], body_expr)
let pats = pats.iter().map(|pat| self.lower_pat(pat)).collect();
self.arm(pats, body_expr)
};

// `_ => break`
Expand Down
15 changes: 13 additions & 2 deletions src/librustc/ich/impls_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,19 @@ for ty::subst::Kind<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>) {
self.as_type().hash_stable(hcx, hasher);
self.as_region().hash_stable(hcx, hasher);
self.unpack().hash_stable(hcx, hasher);
}
}

impl<'gcx> HashStable<StableHashingContext<'gcx>>
for ty::subst::UnpackedKind<'gcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'gcx>,
hasher: &mut StableHasher<W>) {
match self {
ty::subst::UnpackedKind::Lifetime(lt) => lt.hash_stable(hcx, hasher),
ty::subst::UnpackedKind::Type(ty) => ty.hash_stable(hcx, hasher),
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/librustc/infer/anon_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use traits::{self, PredicateObligation};
use ty::{self, Ty};
use ty::fold::{BottomUpFolder, TypeFoldable};
use ty::outlives::Component;
use ty::subst::{Kind, Substs};
use ty::subst::{Kind, UnpackedKind, Substs};
use util::nodemap::DefIdMap;

pub type AnonTypeMap<'tcx> = DefIdMap<AnonTypeDecl<'tcx>>;
Expand Down Expand Up @@ -321,7 +321,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
let index = region_def.index as usize;

// Get the value supplied for this region from the substs.
let subst_arg = anon_defn.substs[index].as_region().unwrap();
let subst_arg = anon_defn.substs.region_at(index);

// Compute the least upper bound of it with the other regions.
debug!("constrain_anon_types: least_region={:?}", least_region);
Expand Down Expand Up @@ -466,7 +466,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
// All other regions, we map them appropriately to their adjusted
// indices, erroring if we find any lifetimes that were not mapped
// into the new set.
_ => if let Some(r1) = map.get(&Kind::from(r)).and_then(|k| k.as_region()) {
_ => if let Some(UnpackedKind::Lifetime(r1)) = map.get(&r.into())
.map(|k| k.unpack()) {
r1
} else {
// No mapping was found. This means that
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub enum IntercrateMode {
/// either identifying an `impl` (e.g., `impl Eq for int`) that
/// provides the required vtable, or else finding a bound that is in
/// scope. The eventual result is usually a `Selection` (defined below).
#[derive(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct Obligation<'tcx, T> {
pub cause: ObligationCause<'tcx>,
pub param_env: ty::ParamEnv<'tcx>,
Expand All @@ -85,7 +85,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;

/// Why did we incur this obligation? Used for error reporting.
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ObligationCause<'tcx> {
pub span: Span,

Expand Down Expand Up @@ -113,7 +113,7 @@ impl<'tcx> ObligationCause<'tcx> {
}
}

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum ObligationCauseCode<'tcx> {
/// Not well classified or should be obvious from span.
MiscObligation,
Expand Down Expand Up @@ -215,7 +215,7 @@ pub enum ObligationCauseCode<'tcx> {
BlockTailExpression(ast::NodeId),
}

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct DerivedObligationCause<'tcx> {
/// The trait reference of the parent obligation that led to the
/// current obligation. Note that only trait obligations lead to
Expand Down Expand Up @@ -304,7 +304,7 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
/// ### The type parameter `N`
///
/// See explanation on `VtableImplData`.
#[derive(Clone, RustcEncodable, RustcDecodable)]
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable)]
pub enum Vtable<'tcx, N> {
/// Vtable identifying a particular impl.
VtableImpl(VtableImplData<'tcx, N>),
Expand Down Expand Up @@ -374,13 +374,13 @@ pub struct VtableClosureData<'tcx, N> {
pub nested: Vec<N>
}

#[derive(Clone, RustcEncodable, RustcDecodable)]
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable)]
pub struct VtableAutoImplData<N> {
pub trait_def_id: DefId,
pub nested: Vec<N>
}

#[derive(Clone, RustcEncodable, RustcDecodable)]
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable)]
pub struct VtableBuiltinData<N> {
pub nested: Vec<N>
}
Expand Down
Loading