Skip to content

Rollup of 6 pull requests #28634

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

Merged
merged 21 commits into from
Sep 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8474af0
run-make: search libstdc++ in /usr/local/lib too
semarie Sep 21, 2015
54792fe
Do not traverse RHS of assignment twice for unused variables lint
sanxiyn Sep 23, 2015
3b42b60
unbreak openbsd after netbsd integration
semarie Sep 23, 2015
f781154
Make lexer tooling message more generic
steveklabnik Sep 23, 2015
edeb4f1
Auto merge of #28603 - steveklabnik:small_config_fix, r=alexcrichton
bors Sep 23, 2015
30fbf44
Fix bad copypasta for patterns doc in std::str
remram44 Sep 23, 2015
afae2ff
Auto merge of #28569 - semarie:stdcpp-tests, r=alexcrichton
bors Sep 23, 2015
4f15e46
Auto merge of #28596 - sanxiyn:dedup-unused, r=alexcrichton
bors Sep 23, 2015
f0666b4
Auto merge of #28598 - semarie:openbsd-unbreak, r=alexcrichton
bors Sep 24, 2015
8fe79bd
Auto merge of #28607 - remram44:doc-fix-str-pattern, r=alexcrichton
bors Sep 24, 2015
5f73037
reference: not sure this is the right place to discuss design
tshepang Sep 24, 2015
e0f35da
reference: fix anchor link
tshepang Sep 24, 2015
7077075
doc: "familiarity" does not need to be repeated here
tshepang Sep 24, 2015
996bd9d
reference: 3 of the 4 things mentioned here are optional
tshepang Sep 24, 2015
f34eafd
reference: follow idiom in code snippet
tshepang Sep 24, 2015
6f0a095
Rollup merge of #28616 - tshepang:idiom, r=steveklabnik
steveklabnik Sep 24, 2015
c16b0f7
Rollup merge of #28617 - tshepang:optional, r=steveklabnik
steveklabnik Sep 24, 2015
668ffb1
Rollup merge of #28618 - tshepang:repetition, r=steveklabnik
steveklabnik Sep 24, 2015
c104ba3
Rollup merge of #28619 - tshepang:fix-link, r=steveklabnik
steveklabnik Sep 24, 2015
e314ac6
Rollup merge of #28620 - tshepang:not-filled, r=steveklabnik
steveklabnik Sep 24, 2015
c3ca182
Rollup merge of #28622 - tshepang:known-as-structs, r=steveklabnik
steveklabnik Sep 24, 2015
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 mk/grammar.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ check-lexer: $(BG) $(BG)RustLexer.class check-build-lexer-verifier
$(Q)$(SG)check.sh $(S) "$(BG)" \
"$(CFG_GRUN)" "$(BG)verify" "$(BG)RustLexer.tokens"
else
$(info cfg: grun not available, skipping lexer test...)
$(info cfg: lexer tooling not available, skipping lexer test...)
check-lexer:

endif
else
$(info cfg: antlr4 not available, skipping lexer test...)
$(info cfg: lexer tooling not available, skipping lexer test...)
check-lexer:

endif
else
$(info cfg: javac not available, skipping lexer test...)
$(info cfg: lexer tooling not available, skipping lexer test...)
check-lexer:

endif
Expand Down
2 changes: 1 addition & 1 deletion src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ provides only one kind of material:

This document does not serve as an introduction to the language. Background
familiarity with the language is assumed. A separate [guide] is available to
help acquire such background familiarity.
help acquire such background.

This document also does not serve as a reference to the [standard] library
included in the language distribution. Those libraries are documented
Expand Down
15 changes: 6 additions & 9 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -900,9 +900,10 @@ fn main() {}

### Functions

A _function item_ defines a sequence of [statements](#statements) and an
optional final [expression](#expressions), along with a name and a set of
parameters. Functions are declared with the keyword `fn`. Functions declare a
A _function item_ defines a sequence of [statements](#statements) and a
final [expression](#expressions), along with a name and a set of
parameters. Other than a name, all these are optional.
Functions are declared with the keyword `fn`. Functions may declare a
set of *input* [*variables*](#variables) as parameters, through which the caller
passes arguments into the function, and the *output* [*type*](#types)
of the value the function will return to its caller on completion.
Expand All @@ -921,7 +922,7 @@ An example of a function:

```
fn add(x: i32, y: i32) -> i32 {
return x + y;
x + y
}
```

Expand Down Expand Up @@ -3897,7 +3898,7 @@ references to boxes are dropped.
### Variables

A _variable_ is a component of a stack frame, either a named function parameter,
an anonymous [temporary](#lvalues,-rvalues-and-temporaries), or a named local
an anonymous [temporary](#lvalues-rvalues-and-temporaries), or a named local
variable.

A _local variable_ (or *stack-local* allocation) holds a value directly,
Expand Down Expand Up @@ -4036,10 +4037,6 @@ In general, `--crate-type=bin` or `--crate-type=lib` should be sufficient for
all compilation needs, and the other options are just available if more
fine-grained control is desired over the output format of a Rust crate.

# Appendix: Rationales and design trade-offs

*TODO*.

# Appendix: Influences

Rust is not a particularly original language, with design elements coming from
Expand Down
21 changes: 9 additions & 12 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,7 @@ impl str {
/// Returns `None` if it doesn't exist.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the
/// split.
/// determines if a character matches.
///
/// # Examples
///
Expand Down Expand Up @@ -760,7 +759,7 @@ impl str {
/// Returns `None` if it doesn't exist.
///
/// The pattern can be a simple `&str`, `char`,
/// or a closure that determines the split.
/// or a closure that determines if a character matches.
///
/// # Examples
///
Expand Down Expand Up @@ -1096,7 +1095,7 @@ impl str {
/// An iterator over the matches of a pattern within `self`.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
Expand Down Expand Up @@ -1129,7 +1128,7 @@ impl str {
/// reverse order.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
Expand Down Expand Up @@ -1166,8 +1165,7 @@ impl str {
/// match are returned.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines
/// the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
Expand Down Expand Up @@ -1214,8 +1212,7 @@ impl str {
/// match are returned.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines
/// the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
Expand Down Expand Up @@ -1296,7 +1293,7 @@ impl str {
/// repeatedly removed.
///
/// The pattern can be a simple `char`, or a closure that determines
/// the split.
/// if a character matches.
///
/// # Examples
///
Expand Down Expand Up @@ -1326,7 +1323,7 @@ impl str {
/// repeatedly removed.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
///
/// # Examples
///
Expand All @@ -1346,7 +1343,7 @@ impl str {
/// repeatedly removed.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
///
/// # Examples
///
Expand Down
4 changes: 3 additions & 1 deletion src/liblibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1683,10 +1683,12 @@ pub mod types {
pub mod posix01 {
use types::common::c95::{c_void};
use types::common::c99::{uint32_t, uint64_t};
use types::os::arch::c95::{c_int, c_uint, c_long, time_t};
use types::os::arch::c95::{c_long, time_t};
use types::os::arch::posix88::{dev_t, gid_t};
use types::os::arch::posix88::{mode_t, off_t};
use types::os::arch::posix88::{uid_t};
#[cfg(target_os = "netbsd")]
use types::os::arch::c95::{c_int, c_uint};

pub type nlink_t = uint32_t;
pub type blksize_t = uint32_t;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,9 +1399,8 @@ fn check_arm(this: &mut Liveness, arm: &hir::Arm) {

fn check_expr(this: &mut Liveness, expr: &Expr) {
match expr.node {
hir::ExprAssign(ref l, ref r) => {
hir::ExprAssign(ref l, _) => {
this.check_lvalue(&**l);
this.visit_expr(&**r);

visit::walk_expr(this, expr);
}
Expand Down
20 changes: 20 additions & 0 deletions src/test/compile-fail/issue-22599.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2015 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.

#![deny(unused_variables)]

fn f(_: i32) {}

fn main() {
let mut v = 0;
f(v);
v = match 0 { a => 0 }; //~ ERROR: unused variable: `a`
f(v);
}
5 changes: 5 additions & 0 deletions src/test/run-make/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ ifeq ($(UNAME),Bitrig)
else
ifeq ($(UNAME),OpenBSD)
EXTRACFLAGS := -lm -lpthread
# extend search lib for found estdc++ if build using gcc from
# ports under OpenBSD. This is needed for:
# - run-make/execution-engine
# - run-make/issue-19371
RUSTC := $(RUSTC) -L/usr/local/lib
else
EXTRACFLAGS := -lm -lrt -ldl -lpthread
EXTRACXXFLAGS := -lstdc++
Expand Down