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 10 pull requests #80436

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d404840
Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_…
bjorn3 Nov 27, 2020
3d357e6
Sync from rust 760430e6fdd70cdb09b5b6d696905c0ee0ea27c8
bjorn3 Nov 29, 2020
7760894
Allow cranelift to handle atomic pointers
oli-obk Nov 29, 2020
a8cda1a
Rustup to rustc 1.50.0-nightly (f4db9ffb2 2020-12-02)
bjorn3 Dec 3, 2020
64e7ff2
Update Cranelift
bjorn3 Dec 3, 2020
d95d03a
Support #[repr(simd)] on array wrappers
bjorn3 Dec 3, 2020
3f28a49
Update Cranelift
bjorn3 Dec 4, 2020
5f21ff2
Inline codegen_mono_item
bjorn3 Oct 11, 2020
6ada445
Lint on redundant trailing semicolon after item
Aaron1011 Dec 7, 2020
8913419
Update RELEASES.md for 1.49.0
XAMPPRocky Dec 7, 2020
fdc336c
Remove trailing semicolon in librustdoc
Aaron1011 Dec 8, 2020
7bb1889
Apply suggestions from code review
XAMPPRocky Dec 8, 2020
468c578
Update RELEASES.md
XAMPPRocky Dec 8, 2020
edb55e9
Update RELEASES.md
XAMPPRocky Dec 8, 2020
4aaace9
Update RELEASES.md
XAMPPRocky Dec 8, 2020
994b91a
Optimize branches when the target is statically known to a jump
bjorn3 Dec 9, 2020
aec0fc5
Auto merge of #77611 - oli-obk:atomic_miri_leakage, r=nagisa
bors Dec 9, 2020
42b267d
Move binder for dyn to each list item
jackh726 Dec 11, 2020
f8e22bf
Update Cranelift
bjorn3 Dec 12, 2020
3f47f93
Enable Cranelift optimizations when optimizing
bjorn3 Dec 12, 2020
bb6b6ae
Update RELEASES.md
XAMPPRocky Dec 12, 2020
cd21269
Fix Cranelift link in readme (#1118)
Jjagg Dec 13, 2020
44b3310
Also emit vcode when emitting clif ir while using new style backends
bjorn3 Dec 14, 2020
5f6c32a
cg_clif: fix build with split dwarf
davidtwco Nov 8, 2020
2c0dccb
Move some code out of CodegenBackend::{codegen_crate,link}
bjorn3 Dec 3, 2020
3a3a23f
Fix tests
bjorn3 Dec 17, 2020
0f57e1c
Sync from rust caeb3335c052f286f6e7257ac0ff21e4f73fd8c5
bjorn3 Dec 17, 2020
8e234d5
Rustup to rustc 1.50.0-nightly (b32e6e6ac 2020-12-16)
bjorn3 Dec 17, 2020
a921a47
Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis
bors Dec 17, 2020
06e77b9
Sync from rust fee693d08e98d25f566075cbed73e12236c05abd
bjorn3 Dec 18, 2020
32f92aa
Rustup to rustc 1.50.0-nightly (eb4fc71dc 2020-12-17)
bjorn3 Dec 18, 2020
54ba238
Remove implementation of intrinsics that are now lowered
bjorn3 Dec 18, 2020
6c1fc32
Make BoundRegion have a kind of BoungRegionKind
jackh726 Dec 18, 2020
cce4c72
Update RELEASES.md
XAMPPRocky Dec 18, 2020
4f6be46
Suggest fn ptr rather than fn item and suggest to use `Fn` trait boun…
ThePuzzlemaker Dec 22, 2020
5e6dc92
Add regression test for #80179
ThePuzzlemaker Dec 22, 2020
dfe6495
Sync from rust 28d73a3ee3e2c32f2768d1cbc9b42cb63472e9e9
bjorn3 Dec 23, 2020
510616f
Rustup to rustc 1.50.0-nightly (bb1fbbf84 2020-12-22)
bjorn3 Dec 23, 2020
979d3ce
Add more comments to trait queries
jyn514 Dec 23, 2020
481f6db
Update RELEASES.md
XAMPPRocky Dec 23, 2020
d12a358
use matches!() macro in more places
matthiaskrgr Dec 24, 2020
d473cbe
BTreeMap: test split_off (and append) more thoroughly
ssomers Nov 18, 2020
82acbc8
Document rustc_macros on nightly-rustc
jyn514 Dec 25, 2020
c556e4d
Use PIC in JIT mode too
bjorn3 Dec 17, 2020
20ffea6
Change the way JIT mode is selected
bjorn3 Dec 25, 2020
0b9b253
Move finalize CodegenCx timer out of codegen mono items timer
bjorn3 Dec 25, 2020
3f6a3b5
Implement lazy compilation in JIT mode
bjorn3 Dec 25, 2020
35f4a25
Add documentation
bjorn3 Dec 25, 2020
2ca8daa
Merge pull request #1120 from bjorn3/lazy_jit
bjorn3 Dec 25, 2020
5b32489
Set rust-analyzer importMergeBehaviour option to last
bjorn3 Dec 25, 2020
dbee136
Rustfmt
bjorn3 Dec 25, 2020
53da233
Remove FIXME in rustc_privacy
jyn514 Dec 27, 2020
52cf01c
Merge commit 'dbee13661efa269cb4cd57bb4c6b99a19732b484' into sync_cg_…
bjorn3 Dec 27, 2020
58aefbd
Rollup merge of #79662 - bjorn3:move_more_code_out_of_codegen_backend…
Dylan-DPC Dec 28, 2020
761400f
Rollup merge of #79812 - Aaron1011:lint-item-trailing-semi, r=oli-obk
Dylan-DPC Dec 28, 2020
549b591
Rollup merge of #79815 - XAMPPRocky:relnotes-1.49.0, r=Mark-Simulacrum
Dylan-DPC Dec 28, 2020
aa28a91
Rollup merge of #80284 - ThePuzzlemaker:issue-80179-fix, r=varkor
Dylan-DPC Dec 28, 2020
80bf28e
Rollup merge of #80331 - jyn514:docs, r=varkor
Dylan-DPC Dec 28, 2020
14c42d8
Rollup merge of #80344 - matthiaskrgr:matches, r=Dylan-DPC
Dylan-DPC Dec 28, 2020
2660e04
Rollup merge of #80353 - ssomers:btree_test_split_off, r=Mark-Simulacrum
Dylan-DPC Dec 28, 2020
cc579a1
Rollup merge of #80362 - jyn514:rustc-macros, r=ehuss
Dylan-DPC Dec 28, 2020
1a18fb4
Rollup merge of #80399 - jyn514:hir-id-cleanup, r=marmeladema
Dylan-DPC Dec 28, 2020
d3409f8
Rollup merge of #80408 - bjorn3:sync_cg_clif-2020-12-27, r=bjorn3
Dylan-DPC Dec 28, 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
134 changes: 131 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,131 @@
Version 1.49.0 (2020-12-31)
============================

Language
-----------------------

- [Unions can now implement `Drop`, and you can now have a field in a union
with `ManuallyDrop<T>`.][77547]
- [You can now cast uninhabited enums to integers.][76199]
- [You can now bind by reference and by move in patterns.][76119] This
allows you to selectively borrow individual components of a type. E.g.
```rust
#[derive(Debug)]
struct Person {
name: String,
age: u8,
}

let person = Person {
name: String::from("Alice"),
age: 20,
};

// `name` is moved out of person, but `age` is referenced.
let Person { name, ref age } = person;
println!("{} {}", name, age);
```

Compiler
-----------------------

- [Added tier 1\* support for `aarch64-unknown-linux-gnu`.][78228]
- [Added tier 2 support for `aarch64-apple-darwin`.][75991]
- [Added tier 2 support for `aarch64-pc-windows-msvc`.][75914]
- [Added tier 3 support for `mipsel-unknown-none`.][78676]
- [Raised the minimum supported LLVM version to LLVM 9.][78848]
- [Output from threads spawned in tests is now captured.][78227]
- [Change os and vendor values to "none" and "unknown" for some targets][78951]

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

Libraries
-----------------------

- [`RangeInclusive` now checks for exhaustion when calling `contains` and indexing.][78109]
- [`ToString::to_string` now no longer shrinks the internal buffer in the default implementation.][77997]
- [`ops::{Index, IndexMut}` are now implemented for fixed sized arrays of any length.][74989]

Stabilized APIs
---------------

- [`slice::select_nth_unstable`]
- [`slice::select_nth_unstable_by`]
- [`slice::select_nth_unstable_by_key`]

The following previously stable methods are now `const`.

- [`Poll::is_ready`]
- [`Poll::is_pending`]

Cargo
-----------------------
- [Building a crate with `cargo-package` should now be independently reproducible.][cargo/8864]
- [`cargo-tree` now marks proc-macro crates.][cargo/8765]
- [Added `CARGO_PRIMARY_PACKAGE` build-time environment variable.][cargo/8758] This
variable will be set if the crate being built is one the user selected to build, either
with `-p` or through defaults.
- [You can now use glob patterns when specifying packages & targets.][cargo/8752]


Compatibility Notes
-------------------

- [Demoted `i686-unknown-freebsd` from host tier 2 to target tier 2 support.][78746]
- [Macros that end with a semi-colon are now treated as statements even if they expand to nothing.][78376]
- [Rustc will now check for the validity of some built-in attributes on enum variants.][77015]
Previously such invalid or unused attributes could be ignored.
- Leading whitespace is stripped more uniformly in documentation comments, which may change behavior. You
read [this post about the changes][rustdoc-ws-post] for more details.
- [Trait bounds are no longer inferred for associated types.][79904]

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.

- [rustc's internal crates are now compiled using the `initial-exec` Thread
Local Storage model.][78201]
- [Calculate visibilities once in resolve.][78077]
- [Added `system` to the `llvm-libunwind` bootstrap config option.][77703]
- [Added `--color` for configuring terminal color support to bootstrap.][79004]


[75991]: https://github.com/rust-lang/rust/pull/75991
[78951]: https://github.com/rust-lang/rust/pull/78951
[78848]: https://github.com/rust-lang/rust/pull/78848
[78746]: https://github.com/rust-lang/rust/pull/78746
[78376]: https://github.com/rust-lang/rust/pull/78376
[78228]: https://github.com/rust-lang/rust/pull/78228
[78227]: https://github.com/rust-lang/rust/pull/78227
[78201]: https://github.com/rust-lang/rust/pull/78201
[78109]: https://github.com/rust-lang/rust/pull/78109
[78077]: https://github.com/rust-lang/rust/pull/78077
[77997]: https://github.com/rust-lang/rust/pull/77997
[77703]: https://github.com/rust-lang/rust/pull/77703
[77547]: https://github.com/rust-lang/rust/pull/77547
[77015]: https://github.com/rust-lang/rust/pull/77015
[76199]: https://github.com/rust-lang/rust/pull/76199
[76119]: https://github.com/rust-lang/rust/pull/76119
[75914]: https://github.com/rust-lang/rust/pull/75914
[74989]: https://github.com/rust-lang/rust/pull/74989
[79004]: https://github.com/rust-lang/rust/pull/79004
[78676]: https://github.com/rust-lang/rust/pull/78676
[79904]: https://github.com/rust-lang/rust/issues/79904
[cargo/8864]: https://github.com/rust-lang/cargo/pull/8864
[cargo/8765]: https://github.com/rust-lang/cargo/pull/8765
[cargo/8758]: https://github.com/rust-lang/cargo/pull/8758
[cargo/8752]: https://github.com/rust-lang/cargo/pull/8752
[`slice::select_nth_unstable`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable
[`slice::select_nth_unstable_by`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by
[`slice::select_nth_unstable_by_key`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by_key
[`hint::spin_loop`]: https://doc.rust-lang.org/stable/std/hint/fn.spin_loop.html
[`Poll::is_ready`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_ready
[`Poll::is_pending`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_pending
[rustdoc-ws-post]: https://blog.guillaume-gomez.fr/articles/2020-11-11+New+doc+comment+handling+in+rustdoc

Version 1.48.0 (2020-11-19)
==========================

Expand All @@ -10,7 +138,7 @@ Language
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
`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.
Expand Down Expand Up @@ -82,7 +210,7 @@ Compatibility Notes
- [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
Expand All @@ -102,7 +230,7 @@ related tools.
[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/
[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/
Expand Down
45 changes: 9 additions & 36 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ pub enum GenericArgs {

impl GenericArgs {
pub fn is_angle_bracketed(&self) -> bool {
match *self {
AngleBracketed(..) => true,
_ => false,
}
matches!(self, AngleBracketed(..))
}

pub fn span(&self) -> Span {
Expand Down Expand Up @@ -629,10 +626,7 @@ impl Pat {

/// Is this a `..` pattern?
pub fn is_rest(&self) -> bool {
match self.kind {
PatKind::Rest => true,
_ => false,
}
matches!(self.kind, PatKind::Rest)
}
}

Expand Down Expand Up @@ -852,10 +846,7 @@ impl BinOpKind {
}
}
pub fn lazy(&self) -> bool {
match *self {
BinOpKind::And | BinOpKind::Or => true,
_ => false,
}
matches!(self, BinOpKind::And | BinOpKind::Or)
}

pub fn is_comparison(&self) -> bool {
Expand Down Expand Up @@ -963,17 +954,11 @@ impl Stmt {
}

pub fn is_item(&self) -> bool {
match self.kind {
StmtKind::Item(_) => true,
_ => false,
}
matches!(self.kind, StmtKind::Item(_))
}

pub fn is_expr(&self) -> bool {
match self.kind {
StmtKind::Expr(_) => true,
_ => false,
}
matches!(self.kind, StmtKind::Expr(_))
}
}

Expand Down Expand Up @@ -1652,26 +1637,17 @@ pub enum LitKind {
impl LitKind {
/// Returns `true` if this literal is a string.
pub fn is_str(&self) -> bool {
match *self {
LitKind::Str(..) => true,
_ => false,
}
matches!(self, LitKind::Str(..))
}

/// Returns `true` if this literal is byte literal string.
pub fn is_bytestr(&self) -> bool {
match self {
LitKind::ByteStr(_) => true,
_ => false,
}
matches!(self, LitKind::ByteStr(_))
}

/// Returns `true` if this is a numeric literal.
pub fn is_numeric(&self) -> bool {
match *self {
LitKind::Int(..) | LitKind::Float(..) => true,
_ => false,
}
matches!(self, LitKind::Int(..) | LitKind::Float(..))
}

/// Returns `true` if this literal has no suffix.
Expand Down Expand Up @@ -2237,10 +2213,7 @@ impl FnDecl {
self.inputs.get(0).map_or(false, Param::is_self)
}
pub fn c_variadic(&self) -> bool {
self.inputs.last().map_or(false, |arg| match arg.ty.kind {
TyKind::CVarArgs => true,
_ => false,
})
self.inputs.last().map_or(false, |arg| matches!(arg.ty.kind, TyKind::CVarArgs))
}
}

Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ impl MetaItem {
}

pub fn is_word(&self) -> bool {
match self.kind {
MetaItemKind::Word => true,
_ => false,
}
matches!(self.kind, MetaItemKind::Word)
}

pub fn has_name(&self, name: Symbol) -> bool {
Expand Down
53 changes: 19 additions & 34 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ impl LitKind {
}

crate fn may_have_suffix(self) -> bool {
match self {
Integer | Float | Err => true,
_ => false,
}
matches!(self, Integer | Float | Err)
}
}

Expand Down Expand Up @@ -305,10 +302,7 @@ impl TokenKind {
}

pub fn should_end_const_arg(&self) -> bool {
match self {
Gt | Ge | BinOp(Shr) | BinOpEq(Shr) => true,
_ => false,
}
matches!(self, Gt | Ge | BinOp(Shr) | BinOpEq(Shr))
}
}

Expand Down Expand Up @@ -346,18 +340,21 @@ impl Token {
}

pub fn is_op(&self) -> bool {
match self.kind {
OpenDelim(..) | CloseDelim(..) | Literal(..) | DocComment(..) | Ident(..)
| Lifetime(..) | Interpolated(..) | Eof => false,
_ => true,
}
!matches!(
self.kind,
OpenDelim(..)
| CloseDelim(..)
| Literal(..)
| DocComment(..)
| Ident(..)
| Lifetime(..)
| Interpolated(..)
| Eof
)
}

pub fn is_like_plus(&self) -> bool {
match self.kind {
BinOp(Plus) | BinOpEq(Plus) => true,
_ => false,
}
matches!(self.kind, BinOp(Plus) | BinOpEq(Plus))
}

/// Returns `true` if the token can appear at the start of an expression.
Expand All @@ -379,13 +376,10 @@ impl Token {
ModSep | // global path
Lifetime(..) | // labeled loop
Pound => true, // expression attributes
Interpolated(ref nt) => match **nt {
NtLiteral(..) |
Interpolated(ref nt) => matches!(**nt, NtLiteral(..) |
NtExpr(..) |
NtBlock(..) |
NtPath(..) => true,
_ => false,
},
NtPath(..)),
_ => false,
}
}
Expand All @@ -405,10 +399,7 @@ impl Token {
Lifetime(..) | // lifetime bound in trait object
Lt | BinOp(Shl) | // associated path
ModSep => true, // global path
Interpolated(ref nt) => match **nt {
NtTy(..) | NtPath(..) => true,
_ => false,
},
Interpolated(ref nt) => matches!(**nt, NtTy(..) | NtPath(..)),
_ => false,
}
}
Expand All @@ -417,10 +408,7 @@ impl Token {
pub fn can_begin_const_arg(&self) -> bool {
match self.kind {
OpenDelim(Brace) => true,
Interpolated(ref nt) => match **nt {
NtExpr(..) | NtBlock(..) | NtLiteral(..) => true,
_ => false,
},
Interpolated(ref nt) => matches!(**nt, NtExpr(..) | NtBlock(..) | NtLiteral(..)),
_ => self.can_begin_literal_maybe_minus(),
}
}
Expand All @@ -436,10 +424,7 @@ impl Token {

/// Returns `true` if the token is any literal.
pub fn is_lit(&self) -> bool {
match self.kind {
Literal(..) => true,
_ => false,
}
matches!(self.kind, Literal(..))
}

/// Returns `true` if the token is any literal, a minus (which can prefix a literal,
Expand Down
18 changes: 9 additions & 9 deletions compiler/rustc_ast/src/util/classify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use crate::ast;
/// |x| 5
/// isn't parsed as (if true {...} else {...} | x) | 5
pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool {
match e.kind {
!matches!(
e.kind,
ast::ExprKind::If(..)
| ast::ExprKind::Match(..)
| ast::ExprKind::Block(..)
| ast::ExprKind::While(..)
| ast::ExprKind::Loop(..)
| ast::ExprKind::ForLoop(..)
| ast::ExprKind::TryBlock(..) => false,
_ => true,
}
| ast::ExprKind::Match(..)
| ast::ExprKind::Block(..)
| ast::ExprKind::While(..)
| ast::ExprKind::Loop(..)
| ast::ExprKind::ForLoop(..)
| ast::ExprKind::TryBlock(..)
)
}
Loading