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 8 pull requests #69927

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
35c4aae
Added tvOS as a backend
simlay Jan 11, 2020
a266169
Merge branch 'master' of github.com:rust-lang/rust into add-tvSO-target
Feb 14, 2020
6b17330
Merged apple_tvos_base and apple_ios_base into apple_sdk_base.
Feb 15, 2020
2599771
fmt
Feb 20, 2020
0e1cd59
Toolstate: remove redundant beta-week check.
ehuss Mar 4, 2020
a6d8c9c
more toolstate comments
RalfJung Mar 4, 2020
a41f1f1
Further clarifications and comments on toolstate operation.
ehuss Mar 4, 2020
3d146a3
Document unsafe blocks in core::fmt
foeb Feb 10, 2020
4897594
miri: ICE on invalid terminators
RalfJung Mar 8, 2020
f2cbe30
submod_path_from_attr: simplify & document
Centril Mar 7, 2020
9b3364f
extract error_cannot_declare_mod_here
Centril Mar 7, 2020
6cb04d9
extract error_decl_mod_in_block
Centril Mar 7, 2020
024af0b
simplify submod_path
Centril Mar 7, 2020
9855b34
submod_path: use id.span
Centril Mar 7, 2020
3eb86cf
extract parse_mod
Centril Mar 7, 2020
cbcb550
extract error_on_circular_module
Centril Mar 7, 2020
996449b
detach submod_path from Parser
Centril Mar 8, 2020
81b3500
decouple push_directory from Parser
Centril Mar 8, 2020
f284eb3
decouple eval_src_mod from Parser
Centril Mar 8, 2020
aff35c4
expand: use push_directory
Centril Mar 8, 2020
75ad1b8
de-fatalize outline module parsing
Centril Mar 8, 2020
e0d001e
extract parse_external_module
Centril Mar 8, 2020
df3792c
extract error_on_circular_module
Centril Mar 8, 2020
a9fd977
outline modules: parse -> expand.
Centril Mar 8, 2020
e994922
parse: module parsing -> item.rs
Centril Mar 8, 2020
65d072d
move Directory -> parser::module
Centril Mar 8, 2020
1b527ae
{rustc_parse::parser -> rustc_expand}::module
Centril Mar 8, 2020
adc3451
{rustc_parse -> rustc_expand}::config
Centril Mar 8, 2020
d171e59
add test for stripped nested outline module
Centril Mar 8, 2020
ad0b078
parser/expand: minor cleanup
Centril Mar 9, 2020
8a8870f
miri: add machine hook for Abort terminator
RalfJung Mar 9, 2020
911c75f
also handle abort intrinsic with new machine hook
RalfJung Mar 9, 2020
7df5868
tweak outline module parsing spans
Centril Mar 9, 2020
42ab820
use pretty-compare-only in a test
Centril Mar 10, 2020
0037f4e
Rename rustc-guide to rustc-dev-guide
spastorino Mar 6, 2020
9d4fdba
Rename rustc guide to rustc dev guide
spastorino Mar 5, 2020
1ddcea3
Rename rustc_guide to rustc_dev_guide
spastorino Mar 6, 2020
d00b269
Rename Rustc Guide to Rustc Dev Guide
spastorino Mar 6, 2020
b3b32b7
rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org
spastorino Mar 9, 2020
cdc7304
Compute the correct layout for variants of uninhabited enums and read…
oli-obk Mar 6, 2020
ec88ffa
Comment nits
oli-obk Mar 11, 2020
3244c84
rustdoc: remove unused import
matthiaskrgr Mar 11, 2020
74608c7
Rustfmt and adjust capitalization
oli-obk Mar 11, 2020
8296e2c
Rollup merge of #68191 - simlay:add-tvSO-target, r=nagisa
Centril Mar 11, 2020
baef20b
Rollup merge of #69011 - foeb:document-unsafe-core-fmt, r=Mark-Simula…
Centril Mar 11, 2020
7f51b9f
Rollup merge of #69705 - ehuss:toolstate-remove-redundant-beta, r=Mar…
Centril Mar 11, 2020
64f4b79
Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbini
Centril Mar 11, 2020
3dc5218
Rollup merge of #69768 - oli-obk:union_field_ice, r=eddyb,RalfJung
Centril Mar 11, 2020
4d75a9a
Rollup merge of #69830 - RalfJung:miri-invalid-terminator, r=oli-obk
Centril Mar 11, 2020
9e299ee
Rollup merge of #69838 - Centril:expand-module, r=petrochenkov,eddyb
Centril Mar 11, 2020
0f2f612
Rollup merge of #69921 - matthiaskrgr:rustdoc_import, r=Centril
Centril Mar 11, 2020
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
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/tracking_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ for larger features an implementation could be broken up into multiple PRs.

- [ ] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
instructions?)
- [ ] Adjust documentation ([see instructions on rustc-guide][doc-guide])
- [ ] Stabilization PR ([see instructions on rustc-guide][stabilization-guide])
- [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rust-lang.github.io/rustc-guide/stabilization_guide.html#documentation-prs
[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs

### Unresolved Questions
<!--
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hop on the [Rust Discord server][rust-discord] or [Rust Zulip server][rust-zulip

As a reminder, all contributors are expected to follow our [Code of Conduct][coc].

The [rustc-guide] is your friend! It describes how the compiler works and how
The [rustc-dev-guide] is your friend! It describes how the compiler works and how
to contribute to it in more detail than this document.

If this is your first time contributing, the [walkthrough] chapter of the guide
Expand All @@ -29,8 +29,8 @@ can give you a good example of how a typical contribution would go.
[rust-discord]: http://discord.gg/rust-lang
[rust-zulip]: https://rust-lang.zulipchat.com
[coc]: https://www.rust-lang.org/conduct.html
[rustc-guide]: https://rust-lang.github.io/rustc-guide/
[walkthrough]: https://rust-lang.github.io/rustc-guide/walkthrough.html
[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/
[walkthrough]: https://rustc-dev-guide.rust-lang.org/walkthrough.html

## Feature Requests
[feature-requests]: #feature-requests
Expand Down Expand Up @@ -103,12 +103,12 @@ $ RUST_BACKTRACE=1 rustc ...
## The Build System

For info on how to configure and build the compiler, please see [this
chapter][rustcguidebuild] of the rustc-guide. This chapter contains info for
chapter][rustcguidebuild] of the rustc-dev-guide. This chapter contains info for
contributions to the compiler and the standard library. It also lists some
really useful commands to the build system (`./x.py`), which could save you a
lot of time.

[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html

## Pull Requests
[pull-requests]: #pull-requests
Expand Down Expand Up @@ -336,9 +336,9 @@ to check small fixes. For example, `rustdoc src/doc/reference.md` will render
reference to `doc/reference.html`. The CSS might be messed up, but you can
verify that the HTML is right.

Additionally, contributions to the [rustc-guide] are always welcome. Contributions
Additionally, contributions to the [rustc-dev-guide] are always welcome. Contributions
can be made directly at [the
rust-lang/rustc-guide](https://github.com/rust-lang/rustc-guide) repo. The issue
rust-lang/rustc-dev-guide](https://github.com/rust-lang/rustc-dev-guide) repo. The issue
tracker in that repo is also a great way to find things that need doing. There
are issues for beginners and advanced compiler devs alike!

Expand Down Expand Up @@ -434,7 +434,7 @@ For people new to Rust, and just starting to contribute, or even for
more seasoned developers, some useful places to look for information
are:

* The [rustc guide] contains information about how various parts of the compiler work and how to contribute to the compiler
* The [rustc dev guide] contains information about how various parts of the compiler work and how to contribute to the compiler
* [Rust Forge][rustforge] contains additional documentation, including write-ups of how to achieve common tasks
* The [Rust Internals forum][rif], a place to ask questions and
discuss Rust's internals
Expand All @@ -448,13 +448,13 @@ are:
* **Google!** ([search only in Rust Documentation][gsearchdocs] to find types, traits, etc. quickly)
* Don't be afraid to ask! The Rust community is friendly and helpful.

[rustc guide]: https://rust-lang.github.io/rustc-guide/about-this-guide.html
[rustc dev guide]: https://rustc-dev-guide.rust-lang.org/about-this-guide.html
[gdfrustc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/
[gsearchdocs]: https://www.google.com/search?q=site:doc.rust-lang.org+your+query+here
[rif]: http://internals.rust-lang.org
[rr]: https://doc.rust-lang.org/book/README.html
[rustforge]: https://forge.rust-lang.org/
[tlgba]: http://tomlee.co/2014/04/a-more-detailed-tour-of-the-rust-compiler/
[ro]: http://www.rustaceans.org/
[rctd]: https://rust-lang.github.io/rustc-guide/tests/intro.html
[rctd]: https://rustc-dev-guide.rust-lang.org/tests/intro.html
[cheatsheet]: https://buildbot2.rust-lang.org/homu/
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Read ["Installation"] from [The Book].
## Installing from Source

_Note: If you wish to contribute to the compiler, you should read [this
chapter][rustcguidebuild] of the rustc-guide instead of this section._
chapter][rustcguidebuild] of the rustc-dev-guide instead of this section._

The Rust build system has a Python script called `x.py` to bootstrap building
the compiler. More information about it may be found by running `./x.py --help`
or reading the [rustc guide][rustcguidebuild].
or reading the [rustc dev guide][rustcguidebuild].

[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html

### Building on *nix
1. Make sure you have installed the dependencies:
Expand Down Expand Up @@ -249,13 +249,13 @@ Most real-time collaboration happens in a variety of channels on the
community, documentation, and all major contribution areas in the Rust ecosystem.
A good place to ask for help would be the #help channel.

The [rustc guide] might be a good place to start if you want to find out how
The [rustc dev guide] might be a good place to start if you want to find out how
various parts of the compiler work.

Also, you may find the [rustdocs for the compiler itself][rustdocs] useful.

[rust-discord]: https://discord.gg/rust-lang
[rustc guide]: https://rust-lang.github.io/rustc-guide/about-this-guide.html
[rustc dev guide]: https://rustc-dev-guide.rust-lang.org/about-this-guide.html
[rustdocs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/

## License
Expand Down
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ This directory contains the source code of the rust project, including:
- `libstd`
- Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the [rustc guide].
For more information on how various parts of the compiler work, see the [rustc dev guide].

[rustc guide]: https://rust-lang.github.io/rustc-guide/about-this-guide.html
[rustc dev guide]: https://rustc-dev-guide.rust-lang.org/about-this-guide.html
55 changes: 22 additions & 33 deletions src/bootstrap/toolstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,21 @@ impl Step for ToolStateCheck {
tool, old_state, state
);
} else {
// This warning only appears in the logs, which most
// people won't read. It's mostly here for testing and
// debugging.
eprintln!(
"warning: Tool `{}` is not test-pass (is `{}`), \
this should be fixed before beta is branched.",
tool, state
);
}
}
// `publish_toolstate.py` is responsible for updating
// `latest.json` and creating comments/issues warning people
// if there is a regression. That all happens in a separate CI
// job on the master branch once the PR has passed all tests
// on the `auto` branch.
}
}

Expand All @@ -230,7 +238,7 @@ impl Step for ToolStateCheck {
}

if builder.config.channel == "nightly" && env::var_os("TOOLSTATE_PUBLISH").is_some() {
commit_toolstate_change(&toolstates, in_beta_week);
commit_toolstate_change(&toolstates);
}
}

Expand Down Expand Up @@ -325,11 +333,11 @@ fn prepare_toolstate_config(token: &str) {
Err(_) => false,
};
if !success {
panic!("git config key={} value={} successful (status: {:?})", key, value, status);
panic!("git config key={} value={} failed (status: {:?})", key, value, status);
}
}

// If changing anything here, then please check that src/ci/publish_toolstate.sh is up to date
// If changing anything here, then please check that `src/ci/publish_toolstate.sh` is up to date
// as well.
git_config("user.email", "7378925+rust-toolstate-update@users.noreply.github.com");
git_config("user.name", "Rust Toolstate Update");
Expand Down Expand Up @@ -373,14 +381,14 @@ fn read_old_toolstate() -> Vec<RepoState> {
///
/// * See <https://help.github.com/articles/about-commit-email-addresses/>
/// if a private email by GitHub is wanted.
fn commit_toolstate_change(current_toolstate: &ToolstateData, in_beta_week: bool) {
let old_toolstate = read_old_toolstate();

fn commit_toolstate_change(current_toolstate: &ToolstateData) {
let message = format!("({} CI update)", OS.expect("linux/windows only"));
let mut success = false;
for _ in 1..=5 {
// Update the toolstate results (the new commit-to-toolstate mapping) in the toolstate repo.
change_toolstate(&current_toolstate, &old_toolstate, in_beta_week);
// Upload the test results (the new commit-to-toolstate mapping) to the toolstate repo.
// This does *not* change the "current toolstate"; that only happens post-landing
// via `src/ci/docker/publish_toolstate.sh`.
publish_test_results(&current_toolstate);

// `git commit` failing means nothing to commit.
let status = t!(Command::new("git")
Expand Down Expand Up @@ -429,31 +437,12 @@ fn commit_toolstate_change(current_toolstate: &ToolstateData, in_beta_week: bool
}
}

fn change_toolstate(
current_toolstate: &ToolstateData,
old_toolstate: &[RepoState],
in_beta_week: bool,
) {
let mut regressed = false;
for repo_state in old_toolstate {
let tool = &repo_state.tool;
let state = repo_state.state();
let new_state = current_toolstate[tool.as_str()];

if new_state != state {
eprintln!("The state of `{}` has changed from `{}` to `{}`", tool, state, new_state);
if new_state < state {
if !NIGHTLY_TOOLS.iter().any(|(name, _path)| name == tool) {
regressed = true;
}
}
}
}

if regressed && in_beta_week {
std::process::exit(1);
}

/// Updates the "history" files with the latest results.
///
/// These results will later be promoted to `latest.json` by the
/// `publish_toolstate.py` script if the PR passes all tests and is merged to
/// master.
fn publish_test_results(current_toolstate: &ToolstateData) {
let commit = t!(std::process::Command::new("git").arg("rev-parse").arg("HEAD").output());
let commit = t!(String::from_utf8(commit.stdout));

Expand Down
4 changes: 3 additions & 1 deletion src/ci/publish_toolstate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ GIT_COMMIT_MSG="$(git log --format=%s -n1 HEAD)"
cd rust-toolstate
FAILURE=1
for RETRY_COUNT in 1 2 3 4 5; do
# The purpose is to publish the new "current" toolstate in the toolstate repo.
# The purpose of this is to publish the new "current" toolstate in the toolstate repo.
# This happens post-landing, on master.
# (Publishing the per-commit test results happens pre-landing in src/bootstrap/toolstate.rs).
"$(ciCheckoutPath)/src/tools/publish_toolstate.py" "$GIT_COMMIT" \
"$GIT_COMMIT_MSG" \
"$MESSAGE_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Rust. It's also sometimes called "the 'nomicon."

## The `rustc` Contribution Guide

[The `rustc` Guide](https://rust-lang.github.io/rustc-guide/) documents how
[The `rustc` Guide](https://rustc-dev-guide.rust-lang.org/) documents how
the compiler works and how to contribute to it. This is useful if you want to build
or modify the Rust compiler from source (e.g. to target something non-standard).

Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustc/src/contributing.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Contributing to rustc

We'd love to have your help improving `rustc`! To that end, we've written [a
whole book][rustc_guide] on its
whole book][rustc_dev_guide] on its
internals, how it works, and how to get started working on it. To learn
more, you'll want to check that out.

If you would like to contribute to _this_ book, you can find its source in the
rustc source at [src/doc/rustc][rustc_book].

[rustc_guide]: https://rust-lang.github.io/rustc-guide/
[rustc_dev_guide]: https://rustc-dev-guide.rust-lang.org/
[rustc_book]: https://github.com/rust-lang/rust/tree/master/src/doc/rustc
6 changes: 4 additions & 2 deletions src/libcore/fmt/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use crate::fmt::{Debug, Display, Formatter, LowerExp, Result, UpperExp};
use crate::mem::MaybeUninit;
use crate::num::flt2dec;

// ignore-tidy-undocumented-unsafe

// Don't inline this so callers don't use the stack space this function
// requires unless they have to.
#[inline(never)]
Expand All @@ -16,6 +14,7 @@ fn float_to_decimal_common_exact<T>(
where
T: flt2dec::DecodableFloat,
{
// SAFETY: Possible undefined behavior, see FIXME(#53491)
unsafe {
let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit();
Expand Down Expand Up @@ -48,6 +47,7 @@ fn float_to_decimal_common_shortest<T>(
where
T: flt2dec::DecodableFloat,
{
// SAFETY: Possible undefined behavior, see FIXME(#53491)
unsafe {
// enough for f32 and f64
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninit();
Expand Down Expand Up @@ -103,6 +103,7 @@ fn float_to_exponential_common_exact<T>(
where
T: flt2dec::DecodableFloat,
{
// SAFETY: Possible undefined behavior, see FIXME(#53491)
unsafe {
let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 6]>::uninit();
Expand Down Expand Up @@ -132,6 +133,7 @@ fn float_to_exponential_common_shortest<T>(
where
T: flt2dec::DecodableFloat,
{
// SAFETY: Possible undefined behavior, see FIXME(#53491)
unsafe {
// enough for f32 and f64
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninit();
Expand Down
18 changes: 16 additions & 2 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Utilities for formatting and printing strings.

// ignore-tidy-undocumented-unsafe

#![stable(feature = "rust1", since = "1.0.0")]

use crate::cell::{Cell, Ref, RefCell, RefMut, UnsafeCell};
Expand Down Expand Up @@ -281,6 +279,14 @@ impl<'a> ArgumentV1<'a> {
#[doc(hidden)]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> {
// SAFETY: `mem::transmute(x)` is safe because
// 1. `&'b T` keeps the lifetime it originated with `'b`
// (so as to not have an unbounded lifetime)
// 2. `&'b T` and `&'b Void` have the same memory layout
// (when `T` is `Sized`, as it is here)
// `mem::transmute(f)` is safe since `fn(&T, &mut Formatter<'_>) -> Result`
// and `fn(&Void, &mut Formatter<'_>) -> Result` have the same ABI
// (as long as `T` is `Sized`)
unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } }
}

Expand Down Expand Up @@ -1399,6 +1405,14 @@ impl<'a> Formatter<'a> {

fn write_formatted_parts(&mut self, formatted: &flt2dec::Formatted<'_>) -> Result {
fn write_bytes(buf: &mut dyn Write, s: &[u8]) -> Result {
// SAFETY: This is used for `flt2dec::Part::Num` and `flt2dec::Part::Copy`.
// It's safe to use for `flt2dec::Part::Num` since every char `c` is between
// `b'0'` and `b'9'`, which means `s` is valid UTF-8.
// It's also probably safe in practice to use for `flt2dec::Part::Copy(buf)`
// since `buf` should be plain ASCII, but it's possible for someone to pass
// in a bad value for `buf` into `flt2dec::to_shortest_str` since it is a
// public function.
// FIXME: Determine whether this could result in UB.
buf.write_str(unsafe { str::from_utf8_unchecked(s) })
}

Expand Down
Loading