Skip to content

Rollup of 20 pull requests #52916

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

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
acdafa0
Document From conversions for OsString and OsStr
cypher Jul 11, 2018
b81ee0b
Document From conversions for CString and CStr
cypher Jul 11, 2018
6c50ee5
dead-code lint: say "constructed" for structs
zackmdavis Jul 22, 2018
ed5edcb
Seperate summaries from rest of the comment
cypher Jul 23, 2018
7fb0a52
Update clippy to latest master
cmdln Jul 26, 2018
922bf1d
Clarify thread::park semantics
matklad Jul 27, 2018
5f87f78
Fix ws
matklad Jul 27, 2018
173c330
Don't make "fake" match variables mutable
matthewjasper Jul 28, 2018
b6d3143
pretty print for std::collections::vecdeque
fukatani Jul 29, 2018
ea25cf1
Fix From<LocalWaker>
MajorBreakfast Jul 29, 2018
9ccd7ee
Fix -Wpessimizing-move warnings in rustllvm/PassWrapper
varkor Jul 29, 2018
9845ee0
fix coding style
fukatani Jul 29, 2018
2b25ee0
update comment
toidiu Jul 30, 2018
2994b27
Add timeout to use of `curl` in bootstrap.py.
kennytm Jul 30, 2018
c57deb9
Remove references to AUTHORS.txt file
dsciarra Jul 29, 2018
f8d1dc8
improve --stage documentation
RalfJung Jul 30, 2018
aa7d7d0
improve test stage documentation
RalfJung Jul 30, 2018
e50f4ee
Add targets for HermitCore (https://hermitcore.org) to the Rust compi…
ColinFinck Jul 30, 2018
d933174
releases.md: fix 2 typos
matthiaskrgr Jul 30, 2018
b6b025b
Fix wrong issue number in the test name
Jul 30, 2018
cbbcecb
Implement Unpin for FutureObj and LocalFutureObj
cramertj Jul 30, 2018
d5f1f70
Fix Alias intra doc ICE
GuillaumeGomez Jul 29, 2018
1ea2765
run-pass/const-endianness: negate before to_le()
cuviper Jul 30, 2018
4ad4ad0
Fix coding style.
ColinFinck Jul 31, 2018
830ac8c
Fix a typo in unsize.rs
pravic Jul 31, 2018
d94bdf8
Put back original field discovery
GuillaumeGomez Jul 31, 2018
40a6046
Only run the sparc-abi test on sparc
nagisa Jul 31, 2018
033c604
Rollup merge of #52332 - zackmdavis:dead_code_lint_should_say_2_elect…
GuillaumeGomez Jul 31, 2018
1cc61fb
Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=stevekl…
GuillaumeGomez Jul 31, 2018
cd56caa
Rollup merge of #52745 - commandline:master, r=oli-obk
GuillaumeGomez Jul 31, 2018
f1316f4
Rollup merge of #52771 - matklad:patch-1, r=kennytm
GuillaumeGomez Jul 31, 2018
647d246
Rollup merge of #52810 - matthewjasper:more-immutablity, r=pnkfelix
GuillaumeGomez Jul 31, 2018
1f97e93
Rollup merge of #52821 - fukatani:gdb-vecdeque-print, r=michaelwoerister
GuillaumeGomez Jul 31, 2018
7a1b5e8
Rollup merge of #52822 - MajorBreakfast:fix-from-local-waker, r=cramertj
GuillaumeGomez Jul 31, 2018
7375841
Rollup merge of #52824 - varkor:fix-llvm-ret-move-warnings, r=rkruppe
GuillaumeGomez Jul 31, 2018
cba4701
Rollup merge of #52831 - dsciarra:rm-ref-to-author-file, r=alexcrichton
GuillaumeGomez Jul 31, 2018
0771d56
Rollup merge of #52835 - GuillaumeGomez:ice-rustdoc-links, r=eddyb
GuillaumeGomez Jul 31, 2018
043b1a1
Rollup merge of #52842 - toidiu:ak-commentUpdate, r=estebank
GuillaumeGomez Jul 31, 2018
4b302eb
Rollup merge of #52846 - kennytm:bootstrap-curl-timeout, r=Mark-Simul…
GuillaumeGomez Jul 31, 2018
f21216e
Rollup merge of #52853 - RalfJung:bootstrap-help, r=alexcrichton
GuillaumeGomez Jul 31, 2018
169823c
Rollup merge of #52861 - ColinFinck:master, r=alexcrichton
GuillaumeGomez Jul 31, 2018
5368eed
Rollup merge of #52867 - matthiaskrgr:release_typos, r=Mark-Simulacrum
GuillaumeGomez Jul 31, 2018
50e7fdd
Rollup merge of #52870 - cramertj:unpin-futureobj, r=aturon
GuillaumeGomez Jul 31, 2018
378c638
Rollup merge of #52876 - cuviper:const-endianness-be, r=kennytm
GuillaumeGomez Jul 31, 2018
c56b44c
Rollup merge of #52878 - mikhail-m1:master, r=kennytm
GuillaumeGomez Jul 31, 2018
e75abe2
Rollup merge of #52905 - pravic:unsize-typo, r=alexcrichton
GuillaumeGomez Jul 31, 2018
b9637b5
Rollup merge of #52914 - nagisa:sparc-is-sparc’s-own-business, r=alex…
GuillaumeGomez Jul 31, 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
4 changes: 2 additions & 2 deletions COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Copyrights in the Rust project are retained by their contributors. No
copyright assignment is required to contribute to the Rust project.

Some files include explicit copyright notices and/or license notices.
For full authorship information, see AUTHORS.txt and the version control
history.
For full authorship information, see the version control history or
https://thanks.rust-lang.org

Except as otherwise noted (below and/or in individual files), Rust is
licensed under the Apache License, Version 2.0 <LICENSE-APACHE> or
Expand Down
4 changes: 2 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Version 1.27.0 (2018-06-21)
Language
--------
- [Removed 'proc' from the reserved keywords list.][49699] This allows `proc` to
be used as an identifer.
be used as an identifier.
- [The dyn syntax is now available.][49968] This syntax is equivalent to the
bare `Trait` syntax, and should make it clearer when being used in tandem with
`impl Trait`. Since it is equivalent to the following syntax:
Expand Down Expand Up @@ -4795,7 +4795,7 @@ Language
--------

* Patterns with `ref mut` now correctly invoke [`DerefMut`] when
matching against dereferencable values.
matching against dereferenceable values.

Libraries
---------
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def _download(path, url, probably_big, verbose, exception):
option = "-#"
else:
option = "-s"
run(["curl", option, "--retry", "3", "-Sf", "-o", path, url],
run(["curl", option,
"-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
"--retry", "3", "-Sf", "-o", path, url],
verbose=verbose,
exception=exception)

Expand Down
13 changes: 10 additions & 3 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"
opts.optmulti("", "exclude", "build paths to exclude", "PATH");
opts.optopt("", "on-fail", "command to run on failure", "CMD");
opts.optflag("", "dry-run", "dry run; don't build anything");
opts.optopt("", "stage", "stage to build", "N");
opts.optopt("", "stage",
"stage to build (indicates compiler to use/test, e.g. stage 0 uses the \
bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)",
"N");
opts.optmulti("", "keep-stage", "stage(s) to keep without recompiling", "N");
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
Expand Down Expand Up @@ -258,7 +261,7 @@ Arguments:

./x.py build --stage 1 src/libtest

This will first build everything once (like --stage 0 without further
This will first build everything once (like `--stage 0` without further
arguments would), and then use the compiler built in stage 0 to build
src/libtest and its dependencies.
Once this is done, build/$ARCH/stage1 contains a usable compiler.",
Expand Down Expand Up @@ -290,10 +293,14 @@ Arguments:

./x.py test src/test/run-pass
./x.py test src/libstd --test-args hash_map
./x.py test src/libstd --stage 0
./x.py test src/libstd --stage 0 --no-doc
./x.py test src/test/ui --bless
./x.py test src/test/ui --compare-mode nll

Note that `test src/test/* --stage N` does NOT depend on `build src/rustc --stage N`;
just like `build src/libstd --stage N` it tests the compiler produced by the previous
stage.

If no arguments are passed then the complete artifacts for that stage are
compiled and tested.

Expand Down
2 changes: 1 addition & 1 deletion src/doc/man/rustdoc.1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ See <\fBhttps://github.com/rust\-lang/rust/issues\fR>
for issues.

.SH "AUTHOR"
See \fIAUTHORS.txt\fR in the Rust source distribution.
See the version control history or <\fBhttps://thanks.rust\-lang.org\fR>

.SH "COPYRIGHT"
This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms.
Expand Down
33 changes: 33 additions & 0 deletions src/etc/debugger_pretty_printers_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
TYPE_KIND_FIXED_SIZE_VEC = 16
TYPE_KIND_REGULAR_UNION = 17
TYPE_KIND_OS_STRING = 18
TYPE_KIND_STD_VECDEQUE = 19

ENCODED_ENUM_PREFIX = "RUST$ENCODED$ENUM$"
ENUM_DISR_FIELD_NAME = "RUST$ENUM$DISR"
Expand All @@ -62,6 +63,14 @@
STD_VEC_FIELD_NAMES = [STD_VEC_FIELD_NAME_BUF,
STD_VEC_FIELD_NAME_LENGTH]

# std::collections::VecDeque<> related constants
STD_VECDEQUE_FIELD_NAME_TAIL = "tail"
STD_VECDEQUE_FIELD_NAME_HEAD = "head"
STD_VECDEQUE_FIELD_NAME_BUF = "buf"
STD_VECDEQUE_FIELD_NAMES = [STD_VECDEQUE_FIELD_NAME_TAIL,
STD_VECDEQUE_FIELD_NAME_HEAD,
STD_VECDEQUE_FIELD_NAME_BUF]

# std::String related constants
STD_STRING_FIELD_NAMES = ["vec"]

Expand Down Expand Up @@ -161,6 +170,11 @@ def __classify_struct(self):
self.__conforms_to_field_layout(STD_VEC_FIELD_NAMES)):
return TYPE_KIND_STD_VEC

# STD COLLECTION VECDEQUE
if (unqualified_type_name.startswith("VecDeque<") and
self.__conforms_to_field_layout(STD_VECDEQUE_FIELD_NAMES)):
return TYPE_KIND_STD_VECDEQUE

# STD STRING
if (unqualified_type_name.startswith("String") and
self.__conforms_to_field_layout(STD_STRING_FIELD_NAMES)):
Expand Down Expand Up @@ -325,6 +339,25 @@ def extract_length_ptr_and_cap_from_std_vec(vec_val):
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (length, data_ptr, capacity)


def extract_tail_head_ptr_and_cap_from_std_vecdeque(vec_val):
assert vec_val.type.get_type_kind() == TYPE_KIND_STD_VECDEQUE
tail_field_index = STD_VECDEQUE_FIELD_NAMES.index(STD_VECDEQUE_FIELD_NAME_TAIL)
head_field_index = STD_VECDEQUE_FIELD_NAMES.index(STD_VECDEQUE_FIELD_NAME_HEAD)
buf_field_index = STD_VECDEQUE_FIELD_NAMES.index(STD_VECDEQUE_FIELD_NAME_BUF)

tail = vec_val.get_child_at_index(tail_field_index).as_integer()
head = vec_val.get_child_at_index(head_field_index).as_integer()
buf = vec_val.get_child_at_index(buf_field_index)

vec_ptr_val = buf.get_child_at_index(0)
capacity = buf.get_child_at_index(1).as_integer()
unique_ptr_val = vec_ptr_val.get_child_at_index(0)
data_ptr = unique_ptr_val.get_child_at_index(0)
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (tail, head, data_ptr, capacity)


def extract_length_and_ptr_from_slice(slice_val):
assert (slice_val.type.get_type_kind() == TYPE_KIND_SLICE or
slice_val.type.get_type_kind() == TYPE_KIND_STR_SLICE)
Expand Down
25 changes: 25 additions & 0 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ def rust_pretty_printer_lookup_function(gdb_val):
if type_kind == rustpp.TYPE_KIND_STD_VEC:
return RustStdVecPrinter(val)

if type_kind == rustpp.TYPE_KIND_STD_VECDEQUE:
return RustStdVecDequePrinter(val)

if type_kind == rustpp.TYPE_KIND_STD_STRING:
return RustStdStringPrinter(val)

Expand Down Expand Up @@ -274,6 +277,28 @@ def children(self):
yield (str(index), (gdb_ptr + index).dereference())


class RustStdVecDequePrinter(object):
def __init__(self, val):
self.__val = val

@staticmethod
def display_hint():
return "array"

def to_string(self):
(tail, head, data_ptr, cap) = \
rustpp.extract_tail_head_ptr_and_cap_from_std_vecdeque(self.__val)
return (self.__val.type.get_unqualified_type_name() +
("(len: %i, cap: %i)" % (head - tail, cap)))

def children(self):
(tail, head, data_ptr, cap) = \
rustpp.extract_tail_head_ptr_and_cap_from_std_vecdeque(self.__val)
gdb_ptr = data_ptr.get_wrapped_value()
for index in xrange(tail, head):
yield (str(index), (gdb_ptr + index).dereference())


class RustStdStringPrinter(object):
def __init__(self, val):
self.__val = val
Expand Down
10 changes: 8 additions & 2 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ mod platform {
}
}

#[cfg(any(target_os = "android", target_os = "redox", target_os = "solaris"))]
#[cfg(any(target_os = "android",
target_os = "hermit",
target_os = "redox",
target_os = "solaris"))]
#[inline]
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
// On android we currently target API level 9 which unfortunately
Expand All @@ -197,7 +200,10 @@ mod platform {
libc::memalign(layout.align(), layout.size()) as *mut u8
}

#[cfg(not(any(target_os = "android", target_os = "redox", target_os = "solaris")))]
#[cfg(not(any(target_os = "android",
target_os = "hermit",
target_os = "redox",
target_os = "solaris")))]
#[inline]
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
let mut out = ptr::null_mut();
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/future/future_obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub struct LocalFutureObj<'a, T> {
_marker: PhantomData<&'a ()>,
}

impl<'a, T> Unpin for LocalFutureObj<'a, T> {}

impl<'a, T> LocalFutureObj<'a, T> {
/// Create a `LocalFutureObj` from a custom trait object representation.
#[inline]
Expand Down Expand Up @@ -104,6 +106,7 @@ impl<'a, T> Drop for LocalFutureObj<'a, T> {
/// information #44874)
pub struct FutureObj<'a, T>(LocalFutureObj<'a, T>);

impl<'a, T> Unpin for FutureObj<'a, T> {}
unsafe impl<'a, T> Send for FutureObj<'a, T> {}

impl<'a, T> FutureObj<'a, T> {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/unsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use marker::Unsize;
/// Trait that indicates that this is a pointer or a wrapper for one,
/// where unsizing can be performed on the pointee.
///
/// See the [DST coercion RfC][dst-coerce] and [the nomicon entry on coercion][nomicon-coerce]
/// See the [DST coercion RFC][dst-coerce] and [the nomicon entry on coercion][nomicon-coerce]
/// for more details.
///
/// For builtin pointer types, pointers to `T` will coerce to pointers to `U` if `T: Unsize<U>`
Expand Down
8 changes: 5 additions & 3 deletions src/libcore/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Waker {
/// `Arc` type and the safe `Wake` trait.
#[inline]
pub unsafe fn new(inner: NonNull<dyn UnsafeWake>) -> Self {
Waker { inner: inner }
Waker { inner }
}

/// Wake up the task associated with this `Waker`.
Expand Down Expand Up @@ -120,7 +120,7 @@ impl LocalWaker {
/// on the current thread.
#[inline]
pub unsafe fn new(inner: NonNull<dyn UnsafeWake>) -> Self {
LocalWaker { inner: inner }
LocalWaker { inner }
}

/// Wake up the task associated with this `LocalWaker`.
Expand Down Expand Up @@ -159,7 +159,9 @@ impl LocalWaker {
impl From<LocalWaker> for Waker {
#[inline]
fn from(local_waker: LocalWaker) -> Self {
Waker { inner: local_waker.inner }
let inner = local_waker.inner;
mem::forget(local_waker);
Waker { inner }
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,16 @@ impl<'a, 'tcx> Visitor<'tcx> for DeadVisitor<'a, 'tcx> {
hir::ItemKind::Impl(..) => self.tcx.sess.codemap().def_span(item.span),
_ => item.span,
};
let participle = match item.node {
hir::ItemKind::Struct(..) => "constructed", // Issue #52325
_ => "used"
};
self.warn_dead_code(
item.id,
span,
item.name,
item.node.descriptive_variant(),
"used",
participle,
);
} else {
// Only continue if we didn't warn
Expand Down
10 changes: 8 additions & 2 deletions src/librustc_mir/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,11 +1213,17 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
let locals = if has_guard.0 && tcx.all_pat_vars_are_implicit_refs_within_guards() {
let mut vals_for_guard = Vec::with_capacity(num_patterns);
for _ in 0..num_patterns {
let val_for_guard_idx = self.local_decls.push(local.clone());
let val_for_guard_idx = self.local_decls.push(LocalDecl {
// This variable isn't mutated but has a name, so has to be
// immutable to avoid the unused mut lint.
mutability: Mutability::Not,
..local.clone()
});
vals_for_guard.push(val_for_guard_idx);
}
let ref_for_guard = self.local_decls.push(LocalDecl::<'tcx> {
mutability,
// See previous comment.
mutability: Mutability::Not,
ty: tcx.mk_imm_ref(tcx.types.re_empty, var_ty),
name: Some(name),
source_info,
Expand Down
32 changes: 32 additions & 0 deletions src/librustc_target/spec/aarch64_unknown_hermit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use spec::{LinkerFlavor, Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::hermit_base::opts();
base.max_atomic_width = Some(128);
base.abi_blacklist = super::arm_base::abi_blacklist();
base.linker = Some("aarch64-hermit-gcc".to_string());

Ok(Target {
llvm_target: "aarch64-unknown-hermit".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
arch: "aarch64".to_string(),
target_os: "hermit".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}
37 changes: 37 additions & 0 deletions src/librustc_target/spec/hermit_base.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
use std::default::Default;

pub fn opts() -> TargetOptions {
let mut args = LinkArgs::new();
args.insert(LinkerFlavor::Gcc, vec![
"-Wl,-Bstatic".to_string(),
"-Wl,--no-dynamic-linker".to_string(),
"-Wl,--gc-sections".to_string(),
"-Wl,--as-needed".to_string(),
]);

TargetOptions {
exe_allocation_crate: None,
executables: true,
has_elf_tls: true,
linker_is_gnu: true,
no_default_libraries: false,
panic_strategy: PanicStrategy::Abort,
position_independent_executables: false,
pre_link_args: args,
relocation_model: "static".to_string(),
target_family: Some("unix".to_string()),
tls_model: "local-exec".to_string(),
.. Default::default()
}
}
4 changes: 4 additions & 0 deletions src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ mod cloudabi_base;
mod dragonfly_base;
mod freebsd_base;
mod haiku_base;
mod hermit_base;
mod linux_base;
mod linux_musl_base;
mod openbsd_base;
Expand Down Expand Up @@ -373,6 +374,9 @@ supported_targets! {
("armv7-unknown-cloudabi-eabihf", armv7_unknown_cloudabi_eabihf),
("i686-unknown-cloudabi", i686_unknown_cloudabi),
("x86_64-unknown-cloudabi", x86_64_unknown_cloudabi),

("aarch64-unknown-hermit", aarch64_unknown_hermit),
("x86_64-unknown-hermit", x86_64_unknown_hermit),
}

/// Everything `rustc` knows about how to compile for a specific target.
Expand Down
Loading