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

Merged
merged 69 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6896ed3
use wasi crate
newpavlov Aug 19, 2019
23cc850
return 0 from errno function
newpavlov Aug 19, 2019
cb52065
replace libc::nanosleep with wasi::poll_oneoff
newpavlov Aug 19, 2019
75a553f
remove to_string
newpavlov Aug 19, 2019
7a4f0ae
use wasi::get_args
newpavlov Aug 19, 2019
52d2871
use wasi::get_environ
newpavlov Aug 19, 2019
8394dbb
remove libc import
newpavlov Aug 19, 2019
338fc7d
use non-zero clock id
newpavlov Aug 19, 2019
7658a13
typo fix
newpavlov Aug 19, 2019
e5ba80a
use const
newpavlov Aug 19, 2019
c052376
fix
newpavlov Aug 19, 2019
744442d
fix C incompatibilities
newpavlov Aug 20, 2019
7daf890
Merge branch 'master' into wasi
newpavlov Aug 20, 2019
4dee102
use new get_args
newpavlov Aug 20, 2019
88fd945
update args
newpavlov Aug 21, 2019
a47e3c0
fixes
newpavlov Aug 21, 2019
926f364
move cvt
newpavlov Aug 21, 2019
3772146
Merge branch 'master' into wasi
newpavlov Aug 24, 2019
6374b84
update to wasi v0.7
newpavlov Aug 29, 2019
06acfb2
add wasi license to the licenses whitelist
newpavlov Aug 29, 2019
127311b
whitelist wasi crate
newpavlov Aug 29, 2019
9fd203a
simplify code
newpavlov Aug 30, 2019
0662fcf
make wasi a target-specific dependency
newpavlov Sep 3, 2019
cb84aa4
Improve searching in rustdoc and add tests
ayuusweetfish Sep 2, 2019
53fe764
Assume non-git LLVM is fresh if the stamp file exists
cuviper Sep 4, 2019
21e7e3f
Point at variant on pattern field count mismatch
estebank Sep 5, 2019
af06bfb
resolve: extract `resolve_params`.
Centril Aug 28, 2019
f8835ee
resolve: cleanup using `with_rib`, etc.
Centril Aug 28, 2019
6d537d4
resolve: simplify `resolve_arm`.
Centril Aug 28, 2019
219ddde
resolve: extract `try_resolve_as_non_binding`.
Centril Aug 28, 2019
f343e84
resolve: add `type IdentMap<T>` alias.
Centril Aug 28, 2019
fd3b441
resolve: move `fresh_binding`.
Centril Aug 28, 2019
dc91e22
resolve: move `resolve_block` to a better place.
Centril Aug 28, 2019
70cae78
resolve: already-bound-check: account for or-patterns.
Centril Aug 28, 2019
166a558
resolve: revamp already-bound check -- fix some bugs.
Centril Sep 1, 2019
498ec59
resolve: add tests for already-bound check.
Centril Sep 1, 2019
896a1c7
resolve: account for general or-patterns in consistency checking.
Centril Sep 1, 2019
33317c7
resolve: add test for missing bindings in or-patterns.
Centril Sep 1, 2019
aa7a02b
resolve: test binding mode consistency for or-patterns.
Centril Sep 1, 2019
dbe6873
resolve: test consistent or-patterns being allowed.
Centril Sep 3, 2019
ca968a1
or-patterns: syntax: simplify `Arm.pats` and `ExprKind::Let.0`.
Centril Aug 27, 2019
998060b
or-patterns: syntax: adjust `visit` and `mut_visit`.
Centril Aug 27, 2019
ad3db72
or-patterns: syntax: adjust parser removing a hack.
Centril Aug 27, 2019
424492a
or-patterns: syntax: adjust pretty printing.
Centril Aug 27, 2019
76625eb
or-patterns: syntax: adjust derive, format, and building.
Centril Aug 27, 2019
3fccbac
or-patterns: adjust librustc_lint.
Centril Aug 27, 2019
d8ef907
or-patterns: adjust lowering of `ast::Arm` & `ast::ExprKind::Let`.
Centril Aug 28, 2019
a867c5f
resolve: merge `resolve_pats` and `resolve_pattern_top`.
Centril Sep 1, 2019
be95dee
or-patterns: adjust save_analysis wrt. `process_var_decl{_multi}`.
Centril Sep 2, 2019
d70b0c5
or-patterns: fix pprust-expr-roundtrip due to AST change.
Centril Sep 3, 2019
a7db1a4
or-patterns: address review comments.
Centril Sep 4, 2019
0341b78
resolve: bool -> enum PatBoundCtx
Centril Sep 4, 2019
24d0a01
review comment
estebank Sep 5, 2019
16ba502
or-patterns: fix fallout from #664128.
Centril Sep 5, 2019
c9bd2f7
Add missing code examples on Iterator trait
GuillaumeGomez Sep 5, 2019
d4d5aa4
Fix invalid span generation when it should be div
GuillaumeGomez Sep 5, 2019
0b7ba6e
std: Improve downstream codegen in `Command::env`
alexcrichton Sep 4, 2019
060fe88
fill metadata in rustc_lexer's Cargo.toml
matklad Sep 5, 2019
bb1e425
Add Fuchsia to actually_monotonic
cramertj Sep 5, 2019
5b99539
Rollup merge of #63676 - newpavlov:wasi, r=alexcrichton
Centril Sep 6, 2019
ab75a17
Rollup merge of #64094 - kawa-yoiko:rustdoc-search, r=GuillaumeGomez
Centril Sep 6, 2019
3c1630a
Rollup merge of #64111 - Centril:ast-only-patkind-or, r=petrochenkov
Centril Sep 6, 2019
37a022e
Rollup merge of #64156 - cuviper:gitless-llvm, r=alexcrichton
Centril Sep 6, 2019
6968e53
Rollup merge of #64161 - estebank:point-variant, r=Centril
Centril Sep 6, 2019
a852ebb
Rollup merge of #64174 - GuillaumeGomez:missing-iterator-examples, r=…
Centril Sep 6, 2019
2cb02ad
Rollup merge of #64175 - GuillaumeGomez:replace-span-when-it-should-b…
Centril Sep 6, 2019
77e736a
Rollup merge of #64186 - alexcrichton:improve-env-codegen, r=sfackler
Centril Sep 6, 2019
9d859b3
Rollup merge of #64190 - matklad:meta, r=cramertj
Centril Sep 6, 2019
61fcd05
Rollup merge of #64198 - cramertj:fuchsia-monotonic, r=alexcrichton
Centril Sep 6, 2019
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
12 changes: 12 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3870,6 +3870,7 @@ dependencies = [
"rustc_msan",
"rustc_tsan",
"unwind",
"wasi",
]

[[package]]
Expand Down Expand Up @@ -4686,6 +4687,17 @@ dependencies = [
"try-lock",
]

[[package]]
name = "wasi"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
]

[[package]]
name = "winapi"
version = "0.2.8"
Expand Down
27 changes: 14 additions & 13 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,29 @@ impl Step for Llvm {
(info, "src/llvm-project/llvm", builder.llvm_out(target), dir.join("bin"))
};

if !llvm_info.is_git() {
println!(
"git could not determine the LLVM submodule commit hash. \
Assuming that an LLVM build is necessary.",
);
}

let build_llvm_config = llvm_config_ret_dir
.join(exe("llvm-config", &*builder.config.build));
let done_stamp = out_dir.join("llvm-finished-building");

if let Some(llvm_commit) = llvm_info.sha() {
if done_stamp.exists() {
if done_stamp.exists() {
if let Some(llvm_commit) = llvm_info.sha() {
let done_contents = t!(fs::read(&done_stamp));

// If LLVM was already built previously and the submodule's commit didn't change
// from the previous build, then no action is required.
if done_contents == llvm_commit.as_bytes() {
return build_llvm_config
return build_llvm_config;
}
} else {
builder.info(
"Could not determine the LLVM submodule commit hash. \
Assuming that an LLVM rebuild is not necessary.",
);
builder.info(&format!(
"To force LLVM to rebuild, remove the file `{}`",
done_stamp.display()
));
return build_llvm_config;
}
}

Expand Down Expand Up @@ -303,9 +306,7 @@ impl Step for Llvm {

cfg.build();

if let Some(llvm_commit) = llvm_info.sha() {
t!(fs::write(&done_stamp, llvm_commit));
}
t!(fs::write(&done_stamp, llvm_info.sha().unwrap_or("")));

build_llvm_config
}
Expand Down
80 changes: 80 additions & 0 deletions src/libcore/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2546,6 +2546,16 @@ pub trait Iterator {

/// Lexicographically compares the elements of this `Iterator` with those
/// of another.
///
/// # Examples
///
/// ```
/// use std::cmp::Ordering;
///
/// assert_eq!([1].iter().cmp([1].iter()), Ordering::Equal);
/// assert_eq!([1].iter().cmp([1, 2].iter()), Ordering::Less);
/// assert_eq!([1, 2].iter().cmp([1].iter()), Ordering::Greater);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn cmp<I>(mut self, other: I) -> Ordering where
I: IntoIterator<Item = Self::Item>,
Expand Down Expand Up @@ -2578,6 +2588,18 @@ pub trait Iterator {

/// Lexicographically compares the elements of this `Iterator` with those
/// of another.
///
/// # Examples
///
/// ```
/// use std::cmp::Ordering;
///
/// assert_eq!([1.].iter().partial_cmp([1.].iter()), Some(Ordering::Equal));
/// assert_eq!([1.].iter().partial_cmp([1., 2.].iter()), Some(Ordering::Less));
/// assert_eq!([1., 2.].iter().partial_cmp([1.].iter()), Some(Ordering::Greater));
///
/// assert_eq!([std::f64::NAN].iter().partial_cmp([1.].iter()), None);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn partial_cmp<I>(mut self, other: I) -> Option<Ordering> where
I: IntoIterator,
Expand Down Expand Up @@ -2610,6 +2632,13 @@ pub trait Iterator {

/// Determines if the elements of this `Iterator` are equal to those of
/// another.
///
/// # Examples
///
/// ```
/// assert_eq!([1].iter().eq([1].iter()), true);
/// assert_eq!([1].iter().eq([1, 2].iter()), false);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn eq<I>(mut self, other: I) -> bool where
I: IntoIterator,
Expand All @@ -2635,6 +2664,13 @@ pub trait Iterator {

/// Determines if the elements of this `Iterator` are unequal to those of
/// another.
///
/// # Examples
///
/// ```
/// assert_eq!([1].iter().ne([1].iter()), false);
/// assert_eq!([1].iter().ne([1, 2].iter()), true);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn ne<I>(self, other: I) -> bool where
I: IntoIterator,
Expand All @@ -2646,6 +2682,14 @@ pub trait Iterator {

/// Determines if the elements of this `Iterator` are lexicographically
/// less than those of another.
///
/// # Examples
///
/// ```
/// assert_eq!([1].iter().lt([1].iter()), false);
/// assert_eq!([1].iter().lt([1, 2].iter()), true);
/// assert_eq!([1, 2].iter().lt([1].iter()), false);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn lt<I>(self, other: I) -> bool where
I: IntoIterator,
Expand All @@ -2657,6 +2701,14 @@ pub trait Iterator {

/// Determines if the elements of this `Iterator` are lexicographically
/// less or equal to those of another.
///
/// # Examples
///
/// ```
/// assert_eq!([1].iter().le([1].iter()), true);
/// assert_eq!([1].iter().le([1, 2].iter()), true);
/// assert_eq!([1, 2].iter().le([1].iter()), false);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn le<I>(self, other: I) -> bool where
I: IntoIterator,
Expand All @@ -2671,6 +2723,14 @@ pub trait Iterator {

/// Determines if the elements of this `Iterator` are lexicographically
/// greater than those of another.
///
/// # Examples
///
/// ```
/// assert_eq!([1].iter().gt([1].iter()), false);
/// assert_eq!([1].iter().gt([1, 2].iter()), false);
/// assert_eq!([1, 2].iter().gt([1].iter()), true);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn gt<I>(self, other: I) -> bool where
I: IntoIterator,
Expand All @@ -2682,6 +2742,14 @@ pub trait Iterator {

/// Determines if the elements of this `Iterator` are lexicographically
/// greater than or equal to those of another.
///
/// # Examples
///
/// ```
/// assert_eq!([1].iter().ge([1].iter()), true);
/// assert_eq!([1].iter().ge([1, 2].iter()), false);
/// assert_eq!([1, 2].iter().ge([1].iter()), true);
/// ```
#[stable(feature = "iter_order", since = "1.5.0")]
fn ge<I>(self, other: I) -> bool where
I: IntoIterator,
Expand Down Expand Up @@ -2730,6 +2798,18 @@ pub trait Iterator {
/// function to determine the ordering of two elements. Apart from that, it's equivalent to
/// [`is_sorted`]; see its documentation for more information.
///
/// # Examples
///
/// ```
/// #![feature(is_sorted)]
///
/// assert!([1, 2, 2, 9].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
/// assert!(![1, 3, 2, 4].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
/// assert!([0].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
/// assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| a.partial_cmp(b)));
/// assert!(![0.0, 1.0, std::f32::NAN].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
/// ```
///
/// [`is_sorted`]: trait.Iterator.html#method.is_sorted
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
fn is_sorted_by<F>(mut self, mut compare: F) -> bool
Expand Down
41 changes: 33 additions & 8 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,19 +425,44 @@ impl<'a> LoweringContext<'a> {

impl<'tcx, 'interner> Visitor<'tcx> for MiscCollector<'tcx, 'interner> {
fn visit_pat(&mut self, p: &'tcx Pat) {
match p.node {
if let PatKind::Paren(..) | PatKind::Rest = p.node {
// Doesn't generate a HIR node
PatKind::Paren(..) | PatKind::Rest => {},
_ => {
if let Some(owner) = self.hir_id_owner {
self.lctx.lower_node_id_with_owner(p.id, owner);
}
}
};
} else if let Some(owner) = self.hir_id_owner {
self.lctx.lower_node_id_with_owner(p.id, owner);
}

visit::walk_pat(self, p)
}

// HACK(or_patterns; Centril | dlrobertson): Avoid creating
// HIR nodes for `PatKind::Or` for the top level of a `ast::Arm`.
// This is a temporary hack that should go away once we push down
// `arm.pats: HirVec<P<Pat>>` -> `arm.pat: P<Pat>` to HIR. // Centril
fn visit_arm(&mut self, arm: &'tcx Arm) {
match &arm.pat.node {
PatKind::Or(pats) => pats.iter().for_each(|p| self.visit_pat(p)),
_ => self.visit_pat(&arm.pat),
}
walk_list!(self, visit_expr, &arm.guard);
self.visit_expr(&arm.body);
walk_list!(self, visit_attribute, &arm.attrs);
}

// HACK(or_patterns; Centril | dlrobertson): Same as above. // Centril
fn visit_expr(&mut self, e: &'tcx Expr) {
if let ExprKind::Let(pat, scrutinee) = &e.node {
walk_list!(self, visit_attribute, e.attrs.iter());
match &pat.node {
PatKind::Or(pats) => pats.iter().for_each(|p| self.visit_pat(p)),
_ => self.visit_pat(&pat),
}
self.visit_expr(scrutinee);
self.visit_expr_post(e);
return;
}
visit::walk_expr(self, e)
}

fn visit_item(&mut self, item: &'tcx Item) {
let hir_id = self.lctx.allocate_hir_id_counter(item.id);

Expand Down
Loading