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 13 pull requests #59046

Closed
wants to merge 80 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
13ffbee
Add MaybeUninit::read_uninitialized
RalfJung Feb 22, 2019
dc570fb
also add examples to MaybeUninit::into_initialized
RalfJung Feb 22, 2019
10f511d
misc tweaks
RalfJung Feb 22, 2019
48aa59e
examples for as[_mut]_ptr
RalfJung Feb 22, 2019
084ee7a
examples for MaybeUninit::zeroed
RalfJung Feb 22, 2019
d10366f
avoid unnecessary use of MaybeUninit::get_ref, and expand comment on …
RalfJung Feb 22, 2019
aa4a9b0
make MaybeUninit Copy
RalfJung Feb 22, 2019
53c0275
Apply suggestions from code review
Centril Feb 23, 2019
ac2284b
expand type name
RalfJung Feb 23, 2019
8ce9b86
fix link
RalfJung Feb 23, 2019
a5e2d0c
remark that the rules are unfinished
RalfJung Feb 24, 2019
be8d728
show how to set with ptr::write
RalfJung Feb 24, 2019
6d32e5a
prefer into_initialized over read_initialited
RalfJung Feb 24, 2019
b11502f
Mention `unwind(aborts)` in diagnostics for `#[unwind]`
petrochenkov Feb 26, 2019
dc00a8a
Validate `#[unwind]` syntax regardless of platform-specific panic str…
petrochenkov Feb 27, 2019
fc4b916
Add a test for #10876
varkor Feb 25, 2019
e206d4e
Add tests for #26448
varkor Feb 25, 2019
93ff7dc
Add a test for #26619
varkor Feb 25, 2019
987d71f
Add a test for #44127
varkor Feb 25, 2019
bdd3826
Add a test for #44255
varkor Feb 25, 2019
36b1326
Add a test for #46101
varkor Feb 25, 2019
1068424
Add a test for #55731
varkor Feb 25, 2019
525dc46
Add a test for #57781
varkor Feb 25, 2019
5fb2d8b
Add a test for #22892
varkor Feb 25, 2019
0976e5e
Add a test for #28587
varkor Feb 25, 2019
42a89c6
Add a test for #26577
varkor Feb 25, 2019
0df193f
Add a test for #27054
varkor Feb 25, 2019
70b853d
Update test for issue #55731
varkor Feb 26, 2019
797d8ea
Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const
Feb 28, 2019
009c91a
add option to calculate documentation coverage
QuietMisdreavus Jan 30, 2019
9e98a25
tabs -> spaces
QuietMisdreavus Jan 30, 2019
fc94593
count fewer items in calculate-doc-coverage
QuietMisdreavus Feb 20, 2019
95500c0
refactor: combine item count numbers into a new struct
QuietMisdreavus Feb 20, 2019
5eb1ab5
print doc coverage as a table of individual item types
QuietMisdreavus Feb 21, 2019
a3a2559
add a coverage mode for private items
QuietMisdreavus Feb 21, 2019
3ce19b4
tweak wording of extern types
QuietMisdreavus Feb 21, 2019
63bdd29
add tests for doc coverage
QuietMisdreavus Feb 21, 2019
80b4919
update docs for doc coverage
QuietMisdreavus Feb 21, 2019
1b63543
track items per-file instead of per-type
QuietMisdreavus Feb 28, 2019
74cf1ad
tweak docs for rustdoc's `--show-coverage`
QuietMisdreavus Feb 28, 2019
515dbe7
update rustdoc coverage tests with new table layout
QuietMisdreavus Feb 28, 2019
5360ded
fix an issue with path probing on Windows
euclio Mar 2, 2019
12d8a7d
look for python2 symlinks before bootstrap python
euclio Feb 22, 2019
c38c959
Ignore WASM on asm tests
varkor Mar 2, 2019
60a649e
Add .nll.stderr output
Mar 3, 2019
5c0615b
Use early unwraps instead of bubbling up errors just to unwrap in the…
oli-obk Feb 16, 2019
538a096
Add as_slice() to slice::IterMut and vec::Drain
cuviper Mar 4, 2019
9902f8c
fixes rust-lang#52482
Feb 23, 2019
e28cf74
remove unused Display impl
QuietMisdreavus Mar 5, 2019
3df0b89
only print coverage pass lists if running on nightly
QuietMisdreavus Mar 5, 2019
5384a11
Apply suggestions from code review
Centril Mar 6, 2019
51e0d1c
Clean up the example on slice::IterMut::as_slice()
cuviper Mar 6, 2019
e478cad
Add a tracking issue for new as_slice methods
cuviper Mar 6, 2019
d5bb71c
Split up privacy checking so privacy_access_levels only does computat…
Zoxc Feb 23, 2019
d2923e5
Run the first block in a parallel! macro directly in the scope which …
Zoxc Feb 23, 2019
1745957
Make misc checking 2 more parallel
Zoxc Feb 23, 2019
140a837
Make misc checking 1 more parallel
Zoxc Feb 23, 2019
350f72f
Make wf checking parallel
Zoxc Feb 23, 2019
01f7450
Update tests
Zoxc Feb 23, 2019
7cc7b8f
Execute all parallel blocks even if they panic in a single-threaded c…
Zoxc Feb 24, 2019
db9a1c1
Add some comments
Zoxc Mar 6, 2019
7985c6f
Rename check_privacy to check_private_in_public
Zoxc Mar 6, 2019
9e5def9
rust-lldb: fix crash when printing empty string
euclio Feb 22, 2019
90bb07e
Apply suggestions from code review
Centril Mar 6, 2019
cefe9b0
Apply suggestions from code review
RalfJung Mar 6, 2019
e5b3ed8
Actually publish miri in the manifest
oli-obk Mar 7, 2019
6465257
std: Delete a by-definition spuriously failing test
alexcrichton Mar 8, 2019
d6234ba
Rollup merge of #58518 - oli-obk:unreachable_result_errors, r=RalfJung
Centril Mar 9, 2019
1812e5b
Rollup merge of #58626 - QuietMisdreavus:doc-coverage, r=GuillaumeGomez
Centril Mar 9, 2019
63cca75
Rollup merge of #58629 - euclio:debug-empty-str, r=alexcrichton
Centril Mar 9, 2019
60a24db
Rollup merge of #58660 - RalfJung:maybe-uninit, r=Centril
Centril Mar 9, 2019
2b53d60
Rollup merge of #58670 - saleemjaffer:refactor_typecast_check_kinds, …
Centril Mar 9, 2019
1b737b9
Rollup merge of #58676 - euclio:bootstrap-python, r=alexcrichton
Centril Mar 9, 2019
7c6d8cc
Rollup merge of #58679 - Zoxc:passes-refactor, r=michaelwoerister
Centril Mar 9, 2019
eec629b
Rollup merge of #58743 - varkor:bulk-needstest-1, r=alexcrichton
Centril Mar 9, 2019
2485fb3
Rollup merge of #58750 - TimDiekmann:master, r=oli-obk
Centril Mar 9, 2019
df1b061
Rollup merge of #58762 - petrochenkov:unwind, r=Mark-Simulacrum
Centril Mar 9, 2019
73ac551
Rollup merge of #58924 - cuviper:more-as_slice, r=dtolnay
Centril Mar 9, 2019
081cf87
Rollup merge of #58990 - oli-obk:miri_manifest, r=alexcrichton
Centril Mar 9, 2019
aba3c79
Rollup merge of #59018 - alexcrichton:omg, r=sfackler
Centril Mar 9, 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
3 changes: 3 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
# Python interpreter to use for various tasks throughout the build, notably
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
# Note that Python 2 is currently required.
#
# Defaults to python2.7, then python2. If neither executable can be found, then
# it defaults to the Python interpreter used to execute x.py.
#python = "python2.7"

# Force Cargo to check that Cargo.lock describes the precise dependency
Expand Down
18 changes: 10 additions & 8 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ impl Finder {

fn maybe_have<S: AsRef<OsStr>>(&mut self, cmd: S) -> Option<PathBuf> {
let cmd: OsString = cmd.as_ref().into();
let path = self.path.clone();
let path = &self.path;
self.cache.entry(cmd.clone()).or_insert_with(|| {
for path in env::split_paths(&path) {
for path in env::split_paths(path) {
let target = path.join(&cmd);
let mut cmd_alt = cmd.clone();
cmd_alt.push(".exe");
if target.is_file() || // some/path/git
target.with_extension("exe").exists() || // some/path/git.exe
target.join(&cmd_alt).exists() { // some/path/git/git.exe
let mut cmd_exe = cmd.clone();
cmd_exe.push(".exe");

if target.is_file() // some/path/git
|| path.join(&cmd_exe).exists() // some/path/git.exe
|| target.join(&cmd_exe).exists() // some/path/git/git.exe
{
return Some(target);
}
}
Expand Down Expand Up @@ -107,9 +109,9 @@ pub fn check(build: &mut Build) {
}

build.config.python = build.config.python.take().map(|p| cmd_finder.must_have(p))
.or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
.or_else(|| cmd_finder.maybe_have("python2.7"))
.or_else(|| cmd_finder.maybe_have("python2"))
.or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
.or_else(|| Some(cmd_finder.must_have("python")));

build.config.nodejs = build.config.nodejs.take().map(|p| cmd_finder.must_have(p))
Expand Down
35 changes: 31 additions & 4 deletions src/doc/rustdoc/src/unstable-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ For example, in the following code:
```rust
/// Does the thing.
pub fn do_the_thing(_: SomeType) {
println!("Let's do the thing!");
println!("Let's do the thing!");
}

/// Token you use to [`do_the_thing`].
Expand All @@ -66,15 +66,15 @@ target out also works:

```rust
pub mod some_module {
/// Token you use to do the thing.
pub struct SomeStruct;
/// Token you use to do the thing.
pub struct SomeStruct;
}

/// Does the thing. Requires one [`SomeStruct`] for the thing to work.
///
/// [`SomeStruct`]: some_module::SomeStruct
pub fn do_the_thing(_: some_module::SomeStruct) {
println!("Let's do the thing!");
println!("Let's do the thing!");
}
```

Expand Down Expand Up @@ -428,3 +428,30 @@ $ rustdoc src/lib.rs --test -Z unstable-options --persist-doctests target/rustdo
This flag allows you to keep doctest executables around after they're compiled or run.
Usually, rustdoc will immediately discard a compiled doctest after it's been tested, but
with this option, you can keep those binaries around for farther testing.

### `--show-coverage`: calculate the percentage of items with documentation

Using this flag looks like this:

```bash
$ rustdoc src/lib.rs -Z unstable-options --show-coverage
```

If you want to determine how many items in your crate are documented, pass this flag to rustdoc.
When it receives this flag, it will count the public items in your crate that have documentation,
and print out the counts and a percentage instead of generating docs.

Some methodology notes about what rustdoc counts in this metric:

* Rustdoc will only count items from your crate (i.e. items re-exported from other crates don't
count).
* Docs written directly onto inherent impl blocks are not counted, even though their doc comments
are displayed, because the common pattern in Rust code is to write all inherent methods into the
same impl block.
* Items in a trait implementation are not counted, as those impls will inherit any docs from the
trait itself.
* By default, only public items are counted. To count private items as well, pass
`--document-private-items` at the same time.

Public items that are not documented can be seen with the built-in `missing_docs` lint. Private
items that are not documented can be seen with Clippy's `missing_docs_in_private_items` lint.
2 changes: 2 additions & 0 deletions src/etc/lldb_rust_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def render_element(i):


def read_utf8_string(ptr_val, byte_count):
if byte_count == 0:
return '""'
error = lldb.SBError()
process = ptr_val.get_wrapped_value().GetProcess()
data = process.ReadMemory(ptr_val.as_integer(), byte_count, error)
Expand Down
19 changes: 19 additions & 0 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,25 @@ impl<T: fmt::Debug> fmt::Debug for Drain<'_, T> {
}
}

impl<'a, T> Drain<'a, T> {
/// Returns the remaining items of this iterator as a slice.
///
/// # Examples
///
/// ```
/// # #![feature(vec_drain_as_slice)]
/// let mut vec = vec!['a', 'b', 'c'];
/// let mut drain = vec.drain(..);
/// assert_eq!(drain.as_slice(), &['a', 'b', 'c']);
/// let _ = drain.next().unwrap();
/// assert_eq!(drain.as_slice(), &['b', 'c']);
/// ```
#[unstable(feature = "vec_drain_as_slice", reason = "recently added", issue = "58957")]
pub fn as_slice(&self) -> &[T] {
self.iter.as_slice()
}
}

#[stable(feature = "drain", since = "1.6.0")]
unsafe impl<T: Sync> Sync for Drain<'_, T> {}
#[stable(feature = "drain", since = "1.6.0")]
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/fmt/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn float_to_decimal_common_exact<T>(fmt: &mut Formatter, num: &T,
// FIXME(#53491): Technically, this is calling `get_mut` on an uninitialized
// `MaybeUninit` (here and elsewhere in this file). Revisit this once
// we decided whether that is valid or not.
// Using `freeze` is *not enough*; `flt2dec::Part` is an enum!
let formatted = flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact,
*num, sign, precision,
false, buf.get_mut(), parts.get_mut());
Expand All @@ -33,6 +34,7 @@ fn float_to_decimal_common_shortest<T>(fmt: &mut Formatter, num: &T,
// enough for f32 and f64
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninitialized();
let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninitialized();
// FIXME(#53491)
let formatted = flt2dec::to_shortest_str(flt2dec::strategy::grisu::format_shortest, *num,
sign, precision, false, buf.get_mut(),
parts.get_mut());
Expand Down Expand Up @@ -71,6 +73,7 @@ fn float_to_exponential_common_exact<T>(fmt: &mut Formatter, num: &T,
unsafe {
let mut buf = MaybeUninit::<[u8; 1024]>::uninitialized(); // enough for f32 and f64
let mut parts = MaybeUninit::<[flt2dec::Part; 6]>::uninitialized();
// FIXME(#53491)
let formatted = flt2dec::to_exact_exp_str(flt2dec::strategy::grisu::format_exact,
*num, sign, precision,
upper, buf.get_mut(), parts.get_mut());
Expand All @@ -90,6 +93,7 @@ fn float_to_exponential_common_shortest<T>(fmt: &mut Formatter,
// enough for f32 and f64
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninitialized();
let mut parts = MaybeUninit::<[flt2dec::Part; 6]>::uninitialized();
// FIXME(#53491)
let formatted = flt2dec::to_shortest_exp_str(flt2dec::strategy::grisu::format_shortest,
*num, sign, (0, 0), upper,
buf.get_mut(), parts.get_mut());
Expand Down
Loading