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 11 pull requests #79104

Merged
merged 46 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a97abb4
Rename LayoutErr to LayoutError in core
Sep 24, 2020
bf0adc3
Rename LayoutErr to LayoutError outside of core
Sep 25, 2020
0266c13
Deprecate LayoutErr
Sep 28, 2020
2b1fa1f
Update RELEASES.md for 1.48.0
XAMPPRocky Oct 25, 2020
ff89b80
Update RELEASES.md
XAMPPRocky Oct 25, 2020
a268264
Update RELEASES.md
XAMPPRocky Oct 25, 2020
149ca76
Apply suggestions from code review
XAMPPRocky Oct 25, 2020
3cb0775
Apply suggestions from code review
XAMPPRocky Oct 26, 2020
a9a26b8
Update RELEASES.md
XAMPPRocky Oct 26, 2020
e6bf0c3
Update RELEASES.md
XAMPPRocky Oct 26, 2020
1186f28
Update RELEASES.md
XAMPPRocky Oct 26, 2020
8ff0c14
Change layouterr deprecation message
Oct 27, 2020
3f6726d
Update RELEASES.md
XAMPPRocky Oct 27, 2020
1c6d4d2
Update RELEASES.md
XAMPPRocky Oct 27, 2020
c899998
Update RELEASES.md
XAMPPRocky Oct 27, 2020
0a9cf84
Update RELEASES.md
XAMPPRocky Oct 29, 2020
5058cad
Remove unneeded lifetimes in array/mod.rs
est31 Nov 5, 2020
6728240
Test structural matching for all range types
CDirkx Nov 7, 2020
72e9660
Remove io::LocalOutput and use Arc<Mutex<dyn>> for local streams.
m-ou-se Nov 3, 2020
ccbce1d
Update tests for updated set_panic.
m-ou-se Nov 3, 2020
f534b75
Use Vec<u8> for LOCAL_STD{OUT,ERR} instead of dyn Write.
m-ou-se Nov 3, 2020
08b7cb7
Use Cell instead of RefCell for LOCAL_{STDOUT,STDERR}.
m-ou-se Nov 3, 2020
aff7bd6
Merge set_panic and set_print into set_output_capture.
m-ou-se Nov 3, 2020
8972bcb
BTreeMap: test chaotic ordering & other bits & bobs
ssomers Nov 9, 2020
a81a64e
Update RELEASES.md
XAMPPRocky Nov 12, 2020
49c0b31
tbh what
lcnr Nov 13, 2020
06c9c59
lessen restriction in `check_kind_count`
lcnr Nov 13, 2020
c34350a
Add tests and improve rendering of features on traits
Nemo157 Nov 2, 2020
d6c16e4
Make all rustdoc functions and structs crate-private
jyn514 Nov 14, 2020
9a3548c
Fix warnings
jyn514 Nov 14, 2020
487c0ce
Make `markdown` module public for doc-tests
jyn514 Nov 15, 2020
9b84c91
Make `Playground` public for error index generator
jyn514 Nov 15, 2020
c03dfa6
Implement Index[Mut] for arrays
pubfnbar Jul 31, 2020
69b43c2
improve error message for const ty param mismatch
lcnr Nov 13, 2020
0bc04e3
Update E0744 about control flow in `const` contexts to reflect the cu…
ThePuzzlemaker Nov 16, 2020
4cdd220
Rollup merge of #74989 - pubfnbar:impl-array-indexing, r=KodrAus
m-ou-se Nov 16, 2020
de0aa61
Rollup merge of #76339 - CDirkx:structural-match-range, r=Mark-Simula…
m-ou-se Nov 16, 2020
5bbf75d
Rollup merge of #77691 - exrook:rename-layouterr, r=KodrAus
m-ou-se Nov 16, 2020
c75f210
Rollup merge of #78364 - XAMPPRocky:relnote-1.48.0, r=pietroalbini
m-ou-se Nov 16, 2020
7a1bd80
Rollup merge of #78678 - Nemo157:doc-cfg-w-traits, r=jyn514,Guillaume…
m-ou-se Nov 16, 2020
11ce918
Rollup merge of #78714 - m-ou-se:simplify-local-streams, r=KodrAus
m-ou-se Nov 16, 2020
c0a9bf9
Rollup merge of #78769 - est31:remove_lifetimes, r=KodrAus
m-ou-se Nov 16, 2020
bac213b
Rollup merge of #78903 - ssomers:btree_order_chaos_testing, r=Mark-Si…
m-ou-se Nov 16, 2020
835faa5
Rollup merge of #79032 - lcnr:arg-count, r=varkor
m-ou-se Nov 16, 2020
c3da682
Rollup merge of #79061 - jyn514:no-pub, r=GuillaumeGomez
m-ou-se Nov 16, 2020
e6b6c8e
Rollup merge of #79087 - ThePuzzlemaker:issue-79083-docfix, r=RalfJung
m-ou-se Nov 16, 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
141 changes: 141 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,143 @@
Version 1.48.0 (2020-11-19)
==========================

Language
--------

- [The `unsafe` keyword is now syntactically permitted on modules.][75857] This
is still rejected *semantically*, but can now be parsed by procedural macros.

Compiler
--------
- [Stabilised the `-C link-self-contained=<yes|no>` compiler flag.][76158] This tells
`rustc` whether to link its own C runtime and libraries or to rely on a external
linker to find them. (Supported only on `windows-gnu`, `linux-musl`, and `wasi` platforms.)
- [You can now use `-C target-feature=+crt-static` on `linux-gnu` targets.][77386]
Note: If you're using cargo you must explicitly pass the `--target` flag.
- [Added tier 2\* support for `aarch64-unknown-linux-musl`.][76420]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`io::Write` is now implemented for `&ChildStdin` `&Sink`, `&Stdout`,
and `&Stderr`.][76275]
- [All arrays of any length now implement `TryFrom<Vec<T>>`.][76310]
- [The `matches!` macro now supports having a trailing comma.][74880]
- [`Vec<A>` now implements `PartialEq<[B]>` where `A: PartialEq<B>`.][74194]
- [The `RefCell::{replace, replace_with, clone}` methods now all use `#[track_caller]`.][77055]

Stabilized APIs
---------------
- [`slice::as_ptr_range`]
- [`slice::as_mut_ptr_range`]
- [`VecDeque::make_contiguous`]
- [`future::pending`]
- [`future::ready`]

The following previously stable methods are now `const fn`'s:

- [`Option::is_some`]
- [`Option::is_none`]
- [`Option::as_ref`]
- [`Result::is_ok`]
- [`Result::is_err`]
- [`Result::as_ref`]
- [`Ordering::reverse`]
- [`Ordering::then`]

Cargo
-----

Rustdoc
-------
- [You can now link to items in `rustdoc` using the intra-doc link
syntax.][74430] E.g. ``/// Uses [`std::future`]`` will automatically generate
a link to `std::future`'s documentation. See ["Linking to items by
name"][intradoc-links] for more information.
- [You can now specify `#[doc(alias = "<alias>")]` on items to add search aliases
when searching through `rustdoc`'s UI.][75740]

Compatibility Notes
-------------------
- [Promotion of references to `'static` lifetime inside `const fn` now follows the
same rules as inside a `fn` body.][75502] In particular, `&foo()` will not be
promoted to `'static` lifetime any more inside `const fn`s.
- [Associated type bindings on trait objects are now verified to meet the bounds
declared on the trait when checking that they implement the trait.][27675]
- [When trait bounds on associated types or opaque types are ambiguous, the
compiler no longer makes an arbitrary choice on which bound to use.][54121]
- [Fixed recursive nonterminals not being expanded in macros during
pretty-print/reparse check.][77153] This may cause errors if your macro wasn't
correctly handling recursive nonterminal tokens.
- [`&mut` references to non zero-sized types are no longer promoted.][75585]
- [`rustc` will now warn if you use attributes like `#[link_name]` or `#[cold]`
in places where they have no effect.][73461]
- [Updated `_mm256_extract_epi8` and `_mm256_extract_epi16` signatures in
`arch::{x86, x86_64}` to return `i32` to match the vendor signatures.][73166]
- [`mem::uninitialized` will now panic if any inner types inside a struct or enum
disallow zero-initialization.][71274]
- [`#[target_feature]` will now error if used in a place where it has no effect.][78143]
- [Foreign exceptions are now caught by `catch_unwind` and will cause an abort.][70212]
Note: This behaviour is not guaranteed and is still considered undefined behaviour,
see the [`catch_unwind`] documentation for further information.



Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [Building `rustc` from source now uses `ninja` by default over `make`.][74922]
You can continue building with `make` by setting `ninja=false` in
your `config.toml`.
- [cg_llvm: `fewer_names` in `uncached_llvm_type`][76030]
- [Made `ensure_sufficient_stack()` non-generic][76680]

[78143]: https://github.com/rust-lang/rust/issues/78143
[76680]: https://github.com/rust-lang/rust/pull/76680/
[76030]: https://github.com/rust-lang/rust/pull/76030/
[70212]: https://github.com/rust-lang/rust/pull/70212/
[27675]: https://github.com/rust-lang/rust/issues/27675/
[54121]: https://github.com/rust-lang/rust/issues/54121/
[71274]: https://github.com/rust-lang/rust/pull/71274/
[77386]: https://github.com/rust-lang/rust/pull/77386/
[77153]: https://github.com/rust-lang/rust/pull/77153/
[77055]: https://github.com/rust-lang/rust/pull/77055/
[76275]: https://github.com/rust-lang/rust/pull/76275/
[76310]: https://github.com/rust-lang/rust/pull/76310/
[76420]: https://github.com/rust-lang/rust/pull/76420/
[76158]: https://github.com/rust-lang/rust/pull/76158/
[75857]: https://github.com/rust-lang/rust/pull/75857/
[75585]: https://github.com/rust-lang/rust/pull/75585/
[75740]: https://github.com/rust-lang/rust/pull/75740/
[75502]: https://github.com/rust-lang/rust/pull/75502/
[74880]: https://github.com/rust-lang/rust/pull/74880/
[74922]: https://github.com/rust-lang/rust/pull/74922/
[74430]: https://github.com/rust-lang/rust/pull/74430/
[74194]: https://github.com/rust-lang/rust/pull/74194/
[73461]: https://github.com/rust-lang/rust/pull/73461/
[73166]: https://github.com/rust-lang/rust/pull/73166/
[intradoc-links]: https://doc.rust-lang.org/rustdoc/linking-to-items-by-name.html
[`catch_unwind`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html
[`Option::is_some`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some
[`Option::is_none`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_none
[`Option::as_ref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref
[`Result::is_ok`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_ok
[`Result::is_err`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_err
[`Result::as_ref`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.as_ref
[`Ordering::reverse`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.reverse
[`Ordering::then`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then
[`slice::as_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_ptr_range
[`slice::as_mut_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_mut_ptr_range
[`VecDeque::make_contiguous`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.make_contiguous
[`future::pending`]: https://doc.rust-lang.org/std/future/fn.pending.html
[`future::ready`]: https://doc.rust-lang.org/std/future/fn.ready.html


Version 1.47.0 (2020-10-08)
==========================

Expand Down Expand Up @@ -90,6 +230,7 @@ Compatibility Notes

Internal Only
--------

- [Improved default settings for bootstrapping in `x.py`.][73964] You can read details about this change in the ["Changes to `x.py` defaults"](https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html) post on the Inside Rust blog.

[1.47.0-cfg]: https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
Expand Down
19 changes: 11 additions & 8 deletions compiler/rustc_error_codes/src/error_codes/E0744.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A control-flow expression was used inside a const context.
An unsupported expression was used inside a const context.

Erroneous code example:

Expand All @@ -12,12 +12,15 @@ const _: i32 = {
};
```

At the moment, `if` and `match`, as well as the looping constructs `for`,
`while`, and `loop`, are forbidden inside a `const`, `static`, or `const fn`.
At the moment, `for` loops, `.await`, and the `Try` operator (`?`) are forbidden
inside a `const`, `static`, or `const fn`.

This will be allowed at some point in the future, but the implementation is not
yet complete. See the tracking issue for [conditionals] or [loops] in a const
context for the current status.
This may be allowed at some point in the future, but the implementation is not
yet complete. See the tracking issues for [`async`] and [`?`] in `const fn`, and
(to support `for` loops in `const fn`) the tracking issues for [`impl const
Trait for Ty`] and [`&mut T`] in `const fn`.

[conditionals]: https://github.com/rust-lang/rust/issues/49146
[loops]: https://github.com/rust-lang/rust/issues/52000
[`async`]: https://github.com/rust-lang/rust/issues/69431
[`?`]: https://github.com/rust-lang/rust/issues/74935
[`impl const Trait for Ty`]: https://github.com/rust-lang/rust/issues/67792
[`&mut T`]: https://github.com/rust-lang/rust/issues/57349
8 changes: 8 additions & 0 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ impl GenericArg<'_> {
GenericArg::Const(_) => "constant",
}
}

pub fn short_descr(&self) -> &'static str {
match self {
GenericArg::Lifetime(_) => "lifetime",
GenericArg::Type(_) => "type",
GenericArg::Const(_) => "const",
}
}
}

#[derive(Debug, HashStable_Generic)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(bool_to_option)]
#![feature(box_syntax)]
#![feature(set_stdio)]
#![feature(internal_output_capture)]
#![feature(nll)]
#![feature(generator_trait)]
#![feature(generators)]
Expand Down
25 changes: 3 additions & 22 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use rustc_span::symbol::{sym, Symbol};
use smallvec::SmallVec;
use std::env;
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
use std::io::{self, Write};
use std::io;
use std::lazy::SyncOnceCell;
use std::mem;
use std::ops::DerefMut;
Expand Down Expand Up @@ -106,21 +106,6 @@ fn get_stack_size() -> Option<usize> {
env::var_os("RUST_MIN_STACK").is_none().then_some(STACK_SIZE)
}

struct Sink(Arc<Mutex<Vec<u8>>>);
impl Write for Sink {
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
Write::write(&mut *self.0.lock().unwrap(), data)
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
impl io::LocalOutput for Sink {
fn clone_box(&self) -> Box<dyn io::LocalOutput> {
Box::new(Self(self.0.clone()))
}
}

/// Like a `thread::Builder::spawn` followed by a `join()`, but avoids the need
/// for `'static` bounds.
#[cfg(not(parallel_compiler))]
Expand Down Expand Up @@ -163,9 +148,7 @@ pub fn setup_callbacks_and_run_in_thread_pool_with_globals<F: FnOnce() -> R + Se

let main_handler = move || {
rustc_span::with_session_globals(edition, || {
if let Some(stderr) = stderr {
io::set_panic(Some(box Sink(stderr.clone())));
}
io::set_output_capture(stderr.clone());
f()
})
};
Expand Down Expand Up @@ -203,9 +186,7 @@ pub fn setup_callbacks_and_run_in_thread_pool_with_globals<F: FnOnce() -> R + Se
// on the new threads.
let main_handler = move |thread: rayon::ThreadBuilder| {
rustc_span::SESSION_GLOBALS.set(session_globals, || {
if let Some(stderr) = stderr {
io::set_panic(Some(box Sink(stderr.clone())));
}
io::set_output_capture(stderr.clone());
thread.run()
})
};
Expand Down
Loading