about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-01-13Rollup merge of #68156 - JohnTitor:fix-path-in-doc, r=Dylan-DPCYuki Okushi-1/+1
Fix crate paths in comments Tiny follow-up of #67806 and others r? @Centril
2020-01-13Auto merge of #67900 - nikic:prepare-llvm-10, r=nagisabors-943/+28
Prepare for LLVM 10 upgrade Split off from #67759, this just adds the necessary compatibility bits and updates codegen tests, without performing the actual LLVM upgrade. r? @alexcrichton
2020-01-13Fix crate paths in commentsYuki Okushi-1/+1
2020-01-12Auto merge of #67901 - matthewjasper:split-mir-build, r=nagisabors-1/+1
Split MIR building into its own crate This moves `rustc_mir::{build, hair, lints}` to `rustc_mir_build`. The new crate only has a `provide` function as it's public API. Based on #67898 cc @Centril @rust-lang/compiler r? @oli-obk
2020-01-12Split `rustc_mir::{build, hair, lints}` into their own crateMatthew Jasper-1/+1
2020-01-12Rollup merge of #68108 - varkor:chained-comparison-suggestions, r=CentrilMazdak Farrokhzad-17/+242
Add suggestions when encountering chained comparisons Ideally, we'd also prevent the type error, which is just extra noise, but that will require moving the error from the parser, and I think the suggestion makes things clear enough for now. Fixes https://github.com/rust-lang/rust/issues/65659.
2020-01-12Rollup merge of #68045 - Centril:liberate-lints, r=Mark-SimulacrumMazdak Farrokhzad-18/+18
Move more of `rustc::lint` into `rustc_lint` Based on https://github.com/rust-lang/rust/pull/67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after https://github.com/rust-lang/rust/pull/68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::lint::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
2020-01-12Rollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obkMazdak Farrokhzad-0/+39
Correctly check for opaque types in `assoc_ty_def` Closes #67856
2020-01-11Auto merge of #67458 - ↵bors-0/+43
pnkfelix:fix-66530-by-propagating-fatal-error-from-worker, r=matthewjasper When a codegen worker has a FatalError, propagate it instead of ICE'ing. Fix #66530
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-196/+270
Promote references to constants instead of statics r? @oli-obk
2020-01-11Make codegen tests wordsize independentOliver Scherer-7/+6
2020-01-11Rollup merge of #68120 - Centril:ban-range-to-dotdotdot, r=oli-obkMazdak Farrokhzad-117/+236
Ban `...X` pats, harden tests, and improve diagnostics Follow up to https://github.com/rust-lang/rust/pull/67258#issuecomment-565656155 and https://github.com/rust-lang/rust/pull/67258#discussion_r357879932. r? @cramertj @oli-obk
2020-01-11Rollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=CentrilMazdak Farrokhzad-31/+49
Don't require `allow_internal_unstable` unless `staged_api` is enabled. #63770 changed `qualify_min_const_fn` to require `allow_internal_unstable` for *all* crates that used an unstable feature, regardless of whether `staged_api` was enabled or the `fn` that used that feature was stably const. In practice, this meant that every crate in the ecosystem that wanted to use nightly features added `#![feature(const_fn)]`, which skips `qualify_min_const_fn` entirely. After this PR, crates that do not have `#![feature(staged_api)]` will only need to enable the feature they are interested in. For example, `#![feature(const_if_match)]` will be enough to enable `if` and `match` in constants. Crates with `staged_api` (e.g., `libstd`) require `#[allow_internal_unstable]` to be added to a function if it uses nightly features unless that function is also marked `#[rustc_const_unstable]`. This prevents proliferation of `#[allow_internal_unstable]` into functions that are not callable in a `const` context on stable. r? @oli-obk (author of #63770) cc @Centril
2020-01-11Rollup merge of #68072 - JohnTitor:fix-macro-ice, r=petrochenkovMazdak Farrokhzad-0/+14
Fix ICE #68058 Fixes #68058 r? @petrochenkov
2020-01-11Rollup merge of #67930 - lzutao:result-as_deref, r=dtolnayMazdak Farrokhzad-38/+2
Rename Result::as_deref_ok to as_deref Addresses https://github.com/rust-lang/rust/issues/50264#issuecomment-533952247 r? @dtolnay
2020-01-11Ban `...X` pats, harden tests, and improve diagnostics.Mazdak Farrokhzad-117/+236
Also fix a bug with the span passed in `mk_range`.
2020-01-11fix ui-fulldeps & tests falloutMazdak Farrokhzad-18/+18
2020-01-11Auto merge of #65912 - estebank:variants-orig, r=petrochenkovbors-56/+297
Point at the span for the definition of crate foreign ADTs Follow up to #65421. Partially addresses #65386. Blocked on #53081.
2020-01-11Update test after renaming Result::as_derefLzu Tao-38/+2
2020-01-11Rollup merge of #68106 - varkor:self_self_use, r=estebankMazdak Farrokhzad-0/+6
Fix issue with using `self` module via indirection Fixes https://github.com/rust-lang/rust/issues/68103.
2020-01-11Rollup merge of #68084 - estebank:ice-68000, r=varkorMazdak Farrokhzad-0/+67
Do not ICE on unicode next point Use `shrink_to_hi` instead of `next_point` and fix `next_point`. Fix #68000, fix #68091, fix #68092.
2020-01-11Rollup merge of #68079 - varkor:E0013-clarify, r=CentrilMazdak Farrokhzad-11/+28
Clarify suggestion for E0013 Fixes https://github.com/rust-lang/rust/issues/68038.
2020-01-11Rollup merge of #67806 - Centril:splitsynmore, r=petrochenkovMazdak Farrokhzad-5/+4
Extract `rustc_ast_passes`, move gating, & refactor linting Based on https://github.com/rust-lang/rust/pull/67770. This PR extracts a crate `rustc_ast_passes`: - `ast_validation.rs`, which is contributed by `rustc_passes` (now only has HIR based passes) -- the goal here is to improve recompilation of the parser, - `feature_gate.rs`, which is contributed by `syntax` and performs post-expansion-gating & final erroring for pre-expansion gating, - `show_span`, which is contributed by `syntax`. To facilitate this, we first have to also: - Move `{leveled_}feature_err{_err}` from `syntax::feature_gate::check` into `rustc_session::parse`. - Move `get_features` into `rustc_parse::config`, the only place it is used. - Move some some lint datatypes and traits, e.g. `LintBuffer`, `BufferedEarlyLint`, `BuiltinLintDiagnostics`, `LintPass`, and `LintArray` into `rustc_session::lint`. - Move all the hard-wired lint `static`s into `rustc_session::lint::builtin`.
2020-01-10Test that stable `const fn` requires `allow_internal_unstable`Dylan MacKenzie-0/+22
2020-01-10Remove unnecessary `const_fn` feature gatesDylan MacKenzie-31/+27
This flag opts out of the min-const-fn checks entirely, which is usually not what we want. The few cases where the flag is still necessary have been annotated.
2020-01-11fix fallout in ui-fulldepsMazdak Farrokhzad-5/+4
2020-01-11Add suggestions when encountering chained comparisonsvarkor-17/+242
2020-01-11Fix test not to depend on environmentYuki Okushi-6/+5
2020-01-10Fix issue with using `self` module via indirectionvarkor-0/+6
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-38/+5
build-std compatible sanitizer support ### Motivation When using `-Z sanitizer=*` feature it is essential that both user code and standard library is instrumented. Otherwise the utility of sanitizer will be limited, or its use will be impractical like in the case of memory sanitizer. The recently introduced cargo feature build-std makes it possible to rebuild standard library with arbitrary rustc flags. Unfortunately, those changes alone do not make it easy to rebuild standard library with sanitizers, since runtimes are dependencies of std that have to be build in specific environment, generally not available outside rustbuild process. Additionally rebuilding them requires presence of llvm-config and compiler-rt sources. The goal of changes proposed here is to make it possible to avoid rebuilding sanitizer runtimes when rebuilding the std, thus making it possible to instrument standard library for use with sanitizer with simple, although verbose command: ``` env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu ``` ### Implementation * Sanitizer runtimes are no long packed into crates. Instead, libraries build from compiler-rt are used as is, after renaming them into `librusc_rt.*`. * rustc obtains runtimes from target libdir for default sysroot, so that they are not required in custom build sysroots created with build-std. * The runtimes are only linked-in into executables to address issue #64629. (in previous design it was hard to avoid linking runtimes into static libraries produced by rustc as demonstrated by sanitizer-staticlib-link test, which still passes despite changes made in #64780). cc @kennytm, @japaric, @firstyear, @choller
2020-01-11Rollup merge of #68014 - estebank:unify-e0599, r=cramertjYuki Okushi-250/+251
Unify output of "variant not found" errors Fix #49566.
2020-01-10Ignore platforms that can't point to stdEsteban Küber-64/+120
2020-01-10Use `def_span` to minimize definition span to first line when possibleEsteban Küber-76/+41
2020-01-10Point at the span for the definition of crate foreign ADTsEsteban Küber-18/+238
2020-01-10Add ICE regression testsEsteban Küber-0/+44
2020-01-10Clarify suggestion for E0013varkor-11/+28
2020-01-10Rebase falloutOliver Scherer-2/+4
2020-01-10Add regression tests for promotion mir expansionOliver Scherer-0/+59
2020-01-10Errors in promoteds may only cause lints not hard errorsOliver Scherer-163/+137
2020-01-10Promoteds also need param envs.Oliver Scherer-1/+1
This also allows us to use the `const_eval` query again without causing cycles
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-104/+144
2020-01-10Introduce `#![feature(half_open_range_patterns)]`.Mazdak Farrokhzad-483/+1775
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-09Do not ICE on unicode next pointEsteban Küber-0/+23
Use `shrink_to_hi` instead of `next_point` Fix #68000.
2020-01-10Rollup merge of #68073 - Centril:fix-68062, r=estebankMazdak Farrokhzad-0/+41
expect `fn` after `const unsafe` / `const extern` Fixes #68062 r? @estebank @petrochenkov cc @Aaron1011
2020-01-10Rollup merge of #68071 - estebank:ice-67995, r=CentrilMazdak Farrokhzad-80/+245
Extend support of `_` in type parameters - Account for `impl Trait<_>`. - Provide a reasonable `Span` for empty `Generics` in `impl`s. - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`. - Fix #67995. Follow up to #67597.
2020-01-10Rollup merge of #67820 - ecstatic-morse:const-trait, r=oli-obkMazdak Farrokhzad-1/+371
Parse the syntax described in RFC 2632 This adds support for both `impl const Trait for Ty` and `?const Trait` bound syntax from rust-lang/rfcs#2632 to the parser. For now, both modifiers end up in a newly-added `constness` field on `ast::TraitRef`, although this may change once the implementation is fleshed out. I was planning on using `delay_span_bug` when this syntax is encountered during lowering, but I can't write `should-ice` UI tests. I emit a normal error instead, which causes duplicates when the feature gate is not enabled (see the `.stderr` files for the feature gate tests). Not sure what the desired approach is; Maybe just do nothing when the syntax is encountered with the feature gate is enabled? @oli-obk I went with `const_trait_impl` and `const_trait_bound_opt_out` for the names of these features. Are these to your liking? cc #67792 #67794 r? @Centril
2020-01-10Rollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=CentrilMazdak Farrokhzad-8/+92
Point at opaque and closure type definitions in type errors Fixes #57266, fixes #67117.
2020-01-09Add test for `?const` in nested impl/dyn traitDylan MacKenzie-1/+17
2020-01-09Add test for `?const` and `?` on the same boundDylan MacKenzie-0/+22
2020-01-09Add tests for RFC 2632Dylan MacKenzie-1/+333