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 #81113

Merged
merged 30 commits into from
Jan 17, 2021
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b498870
use hir::Place instead of Symbol in closure_kind_origin
roxelo Dec 3, 2020
b7071b2
resolve: Simplify collection of traits in scope
petrochenkov Jan 6, 2021
7aca2fa
Remove is_dllimport_foreign_item def from cg_ssa
bjorn3 Jan 13, 2021
6766070
Allow downloading LLVM on Windows
jyn514 Jan 12, 2021
5c4adbe
Add all tier 1 platforms to supported platforms for "if-available"
jyn514 Jan 13, 2021
8b702e0
Support non-stage0 check
Mark-Simulacrum Jan 16, 2021
c17ed34
Print which stage is being checked (now that it may not be stage0)
jyn514 Jan 16, 2021
53989e4
Allow configuring the default stage for `x.py check`
jyn514 Jan 16, 2021
50ee0b2
BTreeMap: clean up a few more comments
ssomers Nov 18, 2020
15f0921
correctly deal with late-bound lifetimes in anon consts
lcnr Nov 22, 2020
76003f3
Use Option::map instead of open-coding it
LingMan Dec 30, 2020
5a706cf
Use Option::unwrap_or instead of open-coding it
LingMan Jan 16, 2021
7f9a2cf
resolve: Reject ambiguity built-in attr vs different built-in attr
petrochenkov Dec 13, 2020
4e27ed3
Add benchmark and fast path for BufReader::read_exact
saethlin Dec 19, 2020
3e16e92
Add NonZeroUn::is_power_of_two
scottmcm Jan 17, 2021
f07dd6d
Remove dead code
rylev Dec 18, 2020
c127ed6
Force vec! to expressions only
bugadani Jan 16, 2021
f783871
Rollup merge of #79298 - lcnr:new-elysium, r=matthewjasper
m-ou-se Jan 17, 2021
3d5e7e0
Rollup merge of #80031 - petrochenkov:builtina, r=estebank
m-ou-se Jan 17, 2021
152f425
Rollup merge of #80201 - saethlin:bufreader-read-exact, r=KodrAus
m-ou-se Jan 17, 2021
19f9780
Rollup merge of #80635 - sexxi-goose:use-place-instead-of-symbol, r=n…
m-ou-se Jan 17, 2021
ffcbeef
Rollup merge of #80765 - petrochenkov:traitsinscope, r=matthewjasper
m-ou-se Jan 17, 2021
cfe2253
Rollup merge of #80932 - jyn514:download-windows-llvm, r=Mark-Simulacrum
m-ou-se Jan 17, 2021
8f2ee87
Rollup merge of #80983 - bjorn3:no_dup_is_dllimport_foreign_item, r=n…
m-ou-se Jan 17, 2021
92dbfb5
Rollup merge of #81064 - Mark-Simulacrum:support-stage1-check, r=jyn514
m-ou-se Jan 17, 2021
19370a4
Rollup merge of #81080 - bugadani:vec-diag, r=oli-obk,m-ou-se
m-ou-se Jan 17, 2021
366f97b
Rollup merge of #81082 - ssomers:btree_cleanup_comments, r=Mark-Simul…
m-ou-se Jan 17, 2021
34e073f
Rollup merge of #81084 - LingMan:map, r=oli-obk
m-ou-se Jan 17, 2021
7e2425a
Rollup merge of #81095 - LingMan:unwrap, r=oli-obk
m-ou-se Jan 17, 2021
8016846
Rollup merge of #81107 - scottmcm:nonzero-is_power_of_two, r=kennytm
m-ou-se Jan 17, 2021
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: 8 additions & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -140,6 +140,7 @@
#![feature(type_alias_impl_trait)]
#![feature(associated_type_bounds)]
#![feature(slice_group_by)]
#![feature(decl_macro)]
// Allow testing this library

#[cfg(test)]
@@ -193,4 +194,11 @@ mod std {
#[unstable(feature = "liballoc_internals", issue = "none", reason = "implementation detail")]
pub mod __export {
pub use core::format_args;

/// Force AST node to an expression to improve diagnostics in pattern position.
#[rustc_macro_transparency = "semitransparent"]
#[unstable(feature = "liballoc_internals", issue = "none", reason = "implementation detail")]
pub macro force_expr($e:expr) {
$e
}
}
8 changes: 4 additions & 4 deletions library/alloc/src/macros.rs
Original file line number Diff line number Diff line change
@@ -37,16 +37,16 @@
#[cfg(not(test))]
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(box_syntax)]
#[allow_internal_unstable(box_syntax, liballoc_internals)]
macro_rules! vec {
() => (
$crate::vec::Vec::new()
$crate::__export::force_expr!($crate::vec::Vec::new())
);
($elem:expr; $n:expr) => (
$crate::vec::from_elem($elem, $n)
$crate::__export::force_expr!($crate::vec::from_elem($elem, $n))
);
($($x:expr),+ $(,)?) => (
<[_]>::into_vec(box [$($x),+])
$crate::__export::force_expr!(<[_]>::into_vec(box [$($x),+]))
);
}

10 changes: 10 additions & 0 deletions src/test/ui/macros/vec-macro-in-pattern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This is a regression test for #61933
// Verify that the vec![] macro may not be used in patterns
// and that the resulting diagnostic is actually helpful.

fn main() {
match Some(vec![42]) {
Some(vec![43]) => {} //~ ERROR arbitrary expressions aren't allowed in patterns
_ => {}
}
}
10 changes: 10 additions & 0 deletions src/test/ui/macros/vec-macro-in-pattern.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: arbitrary expressions aren't allowed in patterns
--> $DIR/vec-macro-in-pattern.rs:7:14
|
LL | Some(vec![43]) => {}
| ^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

8 changes: 0 additions & 8 deletions src/test/ui/suggestions/vec-macro-in-pattern.fixed

This file was deleted.

8 changes: 0 additions & 8 deletions src/test/ui/suggestions/vec-macro-in-pattern.rs

This file was deleted.

16 changes: 0 additions & 16 deletions src/test/ui/suggestions/vec-macro-in-pattern.stderr

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/ui/type/ascription/issue-47666.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: expected type, found reserved keyword `box`
error: expected type, found `<[_]>::into_vec(box [0, 1])`
--> $DIR/issue-47666.rs:3:25
|
LL | let _ = Option:Some(vec![0, 1]);