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 9 pull requests #73310

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4548eb8
Clarify the behaviour of Pattern when used with methods like str::con…
poliorcetics Jun 2, 2020
6f6620b
Rename "cyclone" to "apple-a7" per changes in upstream LLVM
trevyn Jun 7, 2020
fb58b7b
Add compare-mode=chalk and add a little bit more implementations and …
jackh726 May 13, 2020
045dfc0
Update chalk
jackh726 May 13, 2020
6ba003e
Update chalk
jackh726 May 27, 2020
3d73030
Use builtin types for Never, Array, and FnDef
jackh726 May 27, 2020
2544b8c
Implement fn_def_datum
jackh726 May 27, 2020
7f2708c
Remove RustDefId
jackh726 May 27, 2020
ebdc950
Test error order is non-deterministic
jackh726 May 27, 2020
1d8264a
Update Chalk
jackh726 May 27, 2020
6172e9a
Update chalk and add LifetimeOutlives and ObjectSafe lowering
jackh726 May 30, 2020
7a5b939
Lower consts
jackh726 May 30, 2020
4028c21
Fix building
jackh726 May 30, 2020
8aa2898
Update chalk to 0.11.0
jackh726 Jun 2, 2020
852313a
Nits and change skip_binder to no_bound_vars for fndef
jackh726 Jun 3, 2020
645af62
Change InternedAdtDef to &'tcx AdtDef
jackh726 Jun 3, 2020
4cf2833
Return type is bound too
jackh726 Jun 3, 2020
687767a
Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static`…
estebank May 29, 2020
c91320f
When `'static` is explicit, suggest constraining argument with it
estebank May 30, 2020
abf74b9
Reduce verbosity of suggestion message and mention lifetime in label
estebank May 30, 2020
50c422e
Move overlapping span to a note
estebank May 30, 2020
17951e2
Tweak output for overlapping required/captured spans
estebank May 30, 2020
19bb589
Tweak wording and add error code
estebank May 30, 2020
3cfecde
review comments: wording
estebank Jun 1, 2020
bdfb9b1
Use note for requirement source span
estebank Jun 2, 2020
215de3b
Register new eror code
estebank Jun 2, 2020
187e105
small tweaks
estebank Jun 2, 2020
6145918
Change E0758 to E0759 to avoid conflict with #72912
estebank Jun 3, 2020
975f7df
compiletest: Add directives to detect sanitizer support
tmiasko Jun 5, 2020
754da88
Make `fn_arg_names` return `Ident` instead of symbol
Aaron1011 Jun 11, 2020
2c11c35
Explain move errors that occur due to method calls involving `self`
Aaron1011 Jun 11, 2020
5902b2f
Use `fn_span` to point to the actual method call
Aaron1011 Jun 11, 2020
4646e2d
Run fmt
Aaron1011 Jun 12, 2020
57b54c4
Use the built cargo for cargotest.
ehuss Jun 12, 2020
b126f32
Fix links when pinging notification groups
LeSeulArtichaut Jun 12, 2020
249a46f
pretty/asm.rs should only be tested for x86_64 and not AArch64
yerke Jun 13, 2020
1e89cc1
Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, r=nikoma…
RalfJung Jun 13, 2020
6beb38a
Rollup merge of #72804 - estebank:opaque-missing-lts-in-fn-2, r=nikom…
RalfJung Jun 13, 2020
fead5f8
Rollup merge of #72932 - poliorcetics:pattern-contains-behaviour, r=h…
RalfJung Jun 13, 2020
7b31dbf
Rollup merge of #72936 - jackh726:chalk-more, r=nikomatsakis
RalfJung Jun 13, 2020
cbbc200
Rollup merge of #73044 - tmiasko:compiletest-san, r=nikomatsakis
RalfJung Jun 13, 2020
dad3622
Rollup merge of #73086 - trevyn:apple-a7, r=nikic
RalfJung Jun 13, 2020
b3c4f41
Rollup merge of #73267 - ehuss:cargotest-this-cargo, r=Mark-Simulacrum
RalfJung Jun 13, 2020
d8091e3
Rollup merge of #73290 - LeSeulArtichaut:patch-1, r=Dylan-DPC
RalfJung Jun 13, 2020
d63778d
Rollup merge of #73308 - yerke:fix-pretty-asm-rs-test-for-aarch64, r=…
RalfJung Jun 13, 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
82 changes: 20 additions & 62 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ dependencies = [

[[package]]
name = "chalk-derive"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d4620afad4d4d9e63f915cfa10c930b7a3c9c3ca5cd88dd771ff8e5bf04ea10"
checksum = "5b9bd01eab87277d973183a1d2e56bace1c11f8242c52c20636fb7dddf343ac9"
dependencies = [
"proc-macro2 1.0.3",
"quote 1.0.2",
Expand All @@ -446,58 +446,35 @@ dependencies = [

[[package]]
name = "chalk-engine"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ca6e5cef10197789da0b4ec310eda58da4c55530613b2323432642a97372735"
checksum = "6c7a637c3d17ed555aef16e16952a5d1e127bd55178cc30be22afeb92da90c7d"
dependencies = [
"chalk-macros",
"chalk-derive",
"chalk-ir",
"rustc-hash",
]

[[package]]
name = "chalk-ir"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d45df5fb6328527f976e8a32c9e1c9970084d937ebe93d0d34f5bbf4231cb956"
checksum = "595e5735ded16c3f3dc348f7b15bbb2521a0080b1863cac38ad5271589944670"
dependencies = [
"chalk-derive",
"chalk-engine",
"chalk-macros",
]

[[package]]
name = "chalk-macros"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e4782d108e420a1fcf94d8a919cf248db33c5071678e87d9c2d4f20ed1feb32"
dependencies = [
"lazy_static",
]

[[package]]
name = "chalk-rust-ir"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0ec96dbe0ab5fdbadfca4179ec2e1d35f0439c3b53a74988b1aec239c63eb08"
dependencies = [
"chalk-derive",
"chalk-engine",
"chalk-ir",
"chalk-macros",
]

[[package]]
name = "chalk-solve"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfb99fa9530f0e101475fb60adc931f51bdea05b4642a48928b814d7f0141a6b"
checksum = "5d9d938139db425867a30cc0cfec0269406d8238d0571d829041eaa7a8455d11"
dependencies = [
"chalk-derive",
"chalk-engine",
"chalk-ir",
"chalk-macros",
"chalk-rust-ir",
"ena 0.13.1",
"ena",
"itertools 0.9.0",
"petgraph",
"rustc-hash",
Expand Down Expand Up @@ -1061,15 +1038,6 @@ dependencies = [
"strum_macros",
]

[[package]]
name = "ena"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8944dc8fa28ce4a38f778bd46bf7d923fe73eed5a439398507246c8e017e6f36"
dependencies = [
"log",
]

[[package]]
name = "ena"
version = "0.14.0"
Expand Down Expand Up @@ -1181,9 +1149,9 @@ dependencies = [

[[package]]
name = "fixedbitset"
version = "0.1.9"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"

[[package]]
name = "flate2"
Expand Down Expand Up @@ -2370,12 +2338,6 @@ dependencies = [
"vcpkg",
]

[[package]]
name = "ordermap"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"

[[package]]
name = "ordslice"
version = "0.3.0"
Expand Down Expand Up @@ -2546,12 +2508,12 @@ dependencies = [

[[package]]
name = "petgraph"
version = "0.4.13"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f"
checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
dependencies = [
"fixedbitset",
"ordermap",
"indexmap",
]

[[package]]
Expand Down Expand Up @@ -3296,7 +3258,7 @@ dependencies = [
"bitflags",
"cfg-if",
"crossbeam-utils 0.7.2",
"ena 0.14.0",
"ena",
"indexmap",
"jobserver",
"lazy_static",
Expand Down Expand Up @@ -3499,12 +3461,9 @@ dependencies = [

[[package]]
name = "rustc-hash"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
dependencies = [
"byteorder",
]
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustc-main"
Expand Down Expand Up @@ -3755,7 +3714,7 @@ dependencies = [
"bitflags",
"cfg-if",
"crossbeam-utils 0.7.2",
"ena 0.14.0",
"ena",
"indexmap",
"jobserver",
"lazy_static",
Expand Down Expand Up @@ -4373,7 +4332,6 @@ name = "rustc_traits"
version = "0.0.0"
dependencies = [
"chalk-ir",
"chalk-rust-ir",
"chalk-solve",
"log",
"rustc_ast",
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ impl Step for Cargotest {
fn run(self, builder: &Builder<'_>) {
let compiler = builder.compiler(self.stage, self.host);
builder.ensure(compile::Rustc { compiler, target: compiler.host });
let cargo = builder.ensure(tool::Cargo { compiler, target: compiler.host });

// Note that this is a short, cryptic, and not scoped directory name. This
// is currently to minimize the length of path on Windows where we otherwise
Expand All @@ -165,7 +166,7 @@ impl Step for Cargotest {
let mut cmd = builder.tool_cmd(Tool::CargoTest);
try_run(
builder,
cmd.arg(&builder.initial_cargo)
cmd.arg(&cargo)
.arg(&out_dir)
.env("RUSTC", builder.rustc(compiler))
.env("RUSTDOC", builder.rustdoc(compiler)),
Expand Down
37 changes: 37 additions & 0 deletions src/libcore/str/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,43 @@ use crate::slice::memchr;
/// The trait itself acts as a builder for an associated
/// `Searcher` type, which does the actual work of finding
/// occurrences of the pattern in a string.
///
/// Depending on the type of the pattern, the behaviour of methods like
/// [`str::find`] and [`str::contains`] can change. The table below describes
/// some of those behaviours.
///
/// | Pattern type | Match condition |
/// |--------------------------|-------------------------------------------|
/// | `&str` | is substring |
/// | `char` | is contained in string |
/// | `&[char] | any char in slice is contained in string |
/// | `F: FnMut(char) -> bool` | `F` returns `true` for a char in string |
/// | `&&str` | is substring |
/// | `&String` | is substring |
///
/// # Examples
/// ```
/// // &str
/// assert_eq!("abaaa".find("ba"), Some(1));
/// assert_eq!("abaaa".find("bac"), None);
///
/// // char
/// assert_eq!("abaaa".find('a'), Some(0));
/// assert_eq!("abaaa".find('b'), Some(1));
/// assert_eq!("abaaa".find('c'), None);
///
/// // &[char]
/// assert_eq!("ab".find(&['b', 'a'][..]), Some(0));
/// assert_eq!("abaaa".find(&['a', 'z'][..]), Some(0));
/// assert_eq!("abaaa".find(&['c', 'd'][..]), None);
///
/// // FnMut(char) -> bool
/// assert_eq!("abcdef_z".find(|ch| ch > 'd' && ch < 'y'), Some(4));
/// assert_eq!("abcddd_z".find(|ch| ch > 'd' && ch < 'y'), None);
/// ```
///
/// [`str::find`]: ../../../std/primitive.str.html#method.find
/// [`str::contains`]: ../../../std/primitive.str.html#method.contains
pub trait Pattern<'a>: Sized {
/// Associated searcher for this pattern
type Searcher: Searcher<'a>;
Expand Down
24 changes: 19 additions & 5 deletions src/librustc_ast_lowering/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_data_structures::thin_vec::ThinVec;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::Res;
use rustc_span::source_map::{respan, DesugaringKind, Span, Spanned};
use rustc_span::source_map::{respan, DesugaringKind, ForLoopLoc, Span, Spanned};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_target::asm;
use std::collections::hash_map::Entry;
Expand All @@ -25,6 +25,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}

pub(super) fn lower_expr_mut(&mut self, e: &Expr) -> hir::Expr<'hir> {
let mut span = e.span;
ensure_sufficient_stack(|| {
let kind = match e.kind {
ExprKind::Box(ref inner) => hir::ExprKind::Box(self.lower_expr(inner)),
Expand Down Expand Up @@ -53,6 +54,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::ExprKind::MethodCall(hir_seg, seg.ident.span, args, span)
}
ExprKind::Binary(binop, ref lhs, ref rhs) => {
span = self.mark_span_with_reason(DesugaringKind::Operator, e.span, None);
let binop = self.lower_binop(binop);
let lhs = self.lower_expr(lhs);
let rhs = self.lower_expr(rhs);
Expand Down Expand Up @@ -222,7 +224,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::Expr {
hir_id: self.lower_node_id(e.id),
kind,
span: e.span,
span,
attrs: e.attrs.iter().map(|a| self.lower_attr(a)).collect::<Vec<_>>().into(),
}
})
Expand All @@ -237,6 +239,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}

fn lower_binop(&mut self, b: BinOp) -> hir::BinOp {
let span = self.mark_span_with_reason(DesugaringKind::Operator, b.span, None);
Spanned {
node: match b.node {
BinOpKind::Add => hir::BinOpKind::Add,
Expand All @@ -258,7 +261,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
BinOpKind::Ge => hir::BinOpKind::Ge,
BinOpKind::Gt => hir::BinOpKind::Gt,
},
span: b.span,
span,
}
}

Expand Down Expand Up @@ -1360,9 +1363,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
body: &Block,
opt_label: Option<Label>,
) -> hir::Expr<'hir> {
let orig_head_span = head.span;
// expand <head>
let mut head = self.lower_expr_mut(head);
let desugared_span = self.mark_span_with_reason(DesugaringKind::ForLoop, head.span, None);
let desugared_span = self.mark_span_with_reason(
DesugaringKind::ForLoop(ForLoopLoc::Head),
orig_head_span,
None,
);
head.span = desugared_span;

let iter = Ident::with_dummy_span(sym::iter);
Expand Down Expand Up @@ -1457,10 +1465,16 @@ impl<'hir> LoweringContext<'_, 'hir> {
// `mut iter => { ... }`
let iter_arm = self.arm(iter_pat, loop_expr);

let into_iter_span = self.mark_span_with_reason(
DesugaringKind::ForLoop(ForLoopLoc::IntoIter),
orig_head_span,
None,
);

// `match ::std::iter::IntoIterator::into_iter(<head>) { ... }`
let into_iter_expr = {
let into_iter_path = &[sym::iter, sym::IntoIterator, sym::into_iter];
self.expr_call_std_path(desugared_span, into_iter_path, arena_vec![self; head])
self.expr_call_std_path(into_iter_span, into_iter_path, arena_vec![self; head])
};

let match_expr = self.arena.alloc(self.expr_match(
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ crossbeam-utils = { version = "0.7", features = ["nightly"] }
stable_deref_trait = "1.0.0"
rayon = { version = "0.3.0", package = "rustc-rayon" }
rayon-core = { version = "0.3.0", package = "rustc-rayon-core" }
rustc-hash = "1.0.1"
rustc-hash = "1.1.0"
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_index = { path = "../librustc_index", package = "rustc_index" }
bitflags = "1.2.1"
Expand Down
1 change: 1 addition & 0 deletions src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ E0752: include_str!("./error_codes/E0752.md"),
E0753: include_str!("./error_codes/E0753.md"),
E0754: include_str!("./error_codes/E0754.md"),
E0758: include_str!("./error_codes/E0758.md"),
E0759: include_str!("./error_codes/E0759.md"),
E0760: include_str!("./error_codes/E0760.md"),
E0761: include_str!("./error_codes/E0761.md"),
E0762: include_str!("./error_codes/E0762.md"),
Expand Down
Loading