Skip to content

Rollup of 7 pull requests #34643

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 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ build.

[MSYS2][msys2] can be used to easily build Rust on Windows:

msys2: https://msys2.github.io/
[msys2]: https://msys2.github.io/

1. Grab the latest [MSYS2 installer][msys2] and go through the installer.

Expand Down
4 changes: 2 additions & 2 deletions src/doc/book/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ fn call_with_ref<'a, F>(some_closure:F) -> i32
where F: Fn(&'a 32) -> i32 {
```

However this presents a problem with in our case. When you specify the explict
However this presents a problem with in our case. When you specify the explicit
lifetime on a function it binds that lifetime to the *entire* scope of the function
instead of just the invocation scope of our closure. This means that the borrow checker
will see a mutable reference in the same lifetime as our immutable reference and fail
Expand All @@ -354,7 +354,7 @@ fn call_with_ref<F>(some_closure:F) -> i32
```

This lets the Rust compiler find the minimum lifetime to invoke our closure and
satisfy the borrow checker's rules. Our function then compiles and excutes as we
satisfy the borrow checker's rules. Our function then compiles and executes as we
expect.

```rust
Expand Down
6 changes: 6 additions & 0 deletions src/doc/book/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ must abide by that constraint.

[traits]: traits.html

### Combinators

Combinators are higher-order functions that apply only functions and
earlier defined combinators to provide a result from its arguments.
They can be used to manage control flow in a modular fashion.

### DST (Dynamically Sized Type)

A type without a statically known size or alignment. ([more info][link])
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ We could also use a range of versions.
[Cargo’s documentation][cargodoc] contains more details.

[semver]: http://semver.org
[cargodoc]: http://doc.crates.io/crates-io.html
[cargodoc]: http://doc.crates.io/specifying-dependencies.html

Now, without changing any of our code, let’s build our project:

Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ When you need to keep track of how many times you already looped, you can use th
#### On ranges:

```rust
for (i,j) in (5..10).enumerate() {
for (i, j) in (5..10).enumerate() {
println!("i = {} and j = {}", i, j);
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ one.

Cargo will ignore files in subdirectories of the `tests/` directory.
Therefore shared modules in integrations tests are possible.
For example `tests/common/mod.rs` is not seperatly compiled by cargo but can
For example `tests/common/mod.rs` is not separately compiled by cargo but can
be imported in every test with `mod common;`

That's all there is to the `tests` directory. The `tests` module isn't needed
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2880,8 +2880,7 @@ impl<'a> Resolver<'a> {
if !msg.is_empty() {
msg = format!(". Did you mean {}?", msg);
} else {
// we check if this a module and if so, we display a help
// message
// we display a help message if this is a module
let name_path = path.segments.iter()
.map(|seg| seg.identifier.name)
.collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub enum Class {
///
/// The classifier will call into the `Writer` implementation as it finds spans
/// of text to highlight. Exactly how that text should be highlighted is up to
/// the implemention.
/// the implementation.
pub trait Writer {
/// Called when we start processing a span of text that should be highlighted.
/// The `Class` argument specifies how it should be highlighted.
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2715,7 +2715,7 @@ impl<'a> fmt::Display for Sidebar<'a> {
let parentlen = cx.current.len() - if it.is_mod() {1} else {0};

// the sidebar is designed to display sibling functions, modules and
// other miscellaneous informations. since there are lots of sibling
// other miscellaneous information. since there are lots of sibling
// items (and that causes quadratic growth in large modules),
// we refactor common parts into a shared JavaScript file per module.
// still, we don't move everything into JS because we want to preserve
Expand Down
24 changes: 24 additions & 0 deletions src/libstd/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,30 @@ impl Error {
}

/// Creates a new instance of an `Error` from a particular OS error code.
///
/// # Examples
///
/// On Unix:
///
/// ```
/// # if cfg!(unix) {
/// use std::io;
///
/// let error = io::Error::from_raw_os_error(98);
/// assert_eq!(error.kind(), io::ErrorKind::AddrInUse);
/// # }
/// ```
///
/// On Windows:
///
/// ```
/// # if cfg!(windows) {
/// use std::io;
///
/// let error = io::Error::from_raw_os_error(10048);
/// assert_eq!(error.kind(), io::ErrorKind::AddrInUse);
/// # }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn from_raw_os_error(code: i32) -> Error {
Error { repr: Repr::Os(code) }
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/memchr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ mod fallback {
text[..offset].iter().rposition(|elt| *elt == x)
}

// test fallback implementations on all plattforms
// test fallback implementations on all platforms
#[test]
fn matches_one() {
assert_eq!(Some(0), memchr(b'a', b"a"));
Expand Down