about summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2020-02-19Rollup merge of #69280 - ecstatic-morse:promote-shuffle-no-special-case, ↵Dylan DPC-1/+2
r=petrochenkov Remove special case for `simd_shuffle` arg promotion After rust-lang/stdarch#825, these intrinsics are now defined with `#[rustc_args_required_const(2)]`, so the special-case is no longer necessary.
2020-02-19avoid excessive number of revisionsRalf Jung-151/+1
2020-02-18Add `#[rustc_args_required_const]` to `simd_shuffle` testsDylan MacKenzie-1/+2
2020-02-19Auto merge of #69241 - shahn:checked_add_revert, r=Mark-Simulacrum,lqdbors-0/+31
Revert "Remove `checked_add` in `Layout::repeat`" This fixes a a segfault in safe code, a stable regression. Reported in #69225. This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494.
2020-02-18Revert "Remove `checked_add` in `Layout::repeat`"Sebastian Hahn-0/+31
This fixes a a segfault in safe code, a stable regression. Reported in \#69225. This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494. Also adds a test for the expected behaviour.
2020-02-18better lint namesRalf Jung-9/+9
2020-02-18Rollup merge of #69217 - LeSeulArtichaut:remove-lint-impl-op, r=estebankMazdak Farrokhzad-17/+0
Do not emit note suggesting to implement operation trait to foreign type When a binary operation isn't valid, you will get a lint proposing to add a trait implementation to make the operation possible. However, this cannot be done for foreign types, such as types from `core` or `std`. For example: ``` = note: an implementation of `std::ops::Add` might be missing for `std::option::Option<i8>` ``` As mentioned in https://github.com/rust-lang/rust/issues/60497#issuecomment-562665539: > The note suggesting implementing Add<i8> should only be emitted if Option<i8> were local to the current crate, which it isn't, so in this case it shouldn't be emitted. (I will use the CI to check tests for me, or my computer will just burn... and running IDEs is not possible on a pile of ashes) r? @estebank
2020-02-18Rollup merge of #69211 - petrochenkov:prevtok, r=CentrilMazdak Farrokhzad-6/+6
parser: Simplify treatment of macro variables in `Parser::bump` Follow-up to https://github.com/rust-lang/rust/pull/69006. Token normalization for `$ident` and `$lifetime` is merged directly into `bump`. Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling (as a result `bump` also doesn't call itself recursively anymore and can't make `prev_token` inconsistent). r? @Centril
2020-02-18Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkovMazdak Farrokhzad-3/+3
parse: fuse associated and extern items up to defaultness Language changes: - The grammar of extern `type` aliases is unified with associated ones, and becomes: ```rust TypeItem = "type" ident generics {":" bounds}? where_clause {"=" type}? ";" ; ``` Semantic restrictions (`ast_validation`) are added to forbid any parameters in `generics`, any bounds in `bounds`, and any predicates in `where_clause`, as well as the presence of a type expression (`= u8`). (Work still remains to fuse this with free `type` aliases, but this can be done later.) - The grammar of constants and static items (free, associated, and extern) now permits the absence of an expression, and becomes: ```rust GlobalItem = {"const" {ident | "_"} | "static" "mut"? ident} {"=" expr}? ";" ; ``` - A semantic restriction is added to enforce the presence of the expression (the body). - A semantic restriction is added to reject `const _` in associated contexts. Together, these changes allow us to fuse the grammar of associated items and extern items up to `default`ness which is the main goal of the PR. ----------------------- We are now very close to fully fusing the entirely of item parsing and their ASTs. To progress further, we must make a decision: should we parse e.g. `default use foo::bar;` and whatnot? Accepting that is likely easiest from a parsing perspective, as it does not require using look-ahead, but it is perhaps not too onerous to only accept it for `fn`s (and all their various qualifiers), `const`s, `static`s, and `type`s. r? @petrochenkov
2020-02-17parser: Do not call `bump` recursivelyVadim Petrochenkov-6/+6
Token normalization is merged directly into `bump`. Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling.
2020-02-17Do not emit note suggesting to implement trait to foreign typeLeSeulArtichaut-17/+0
Update tests Extend to other operations Refractor check in a separate function Fix more tests
2020-02-15parse associated statics.Mazdak Farrokhzad-3/+3
2020-02-16Add test for issue-51798Yuki Okushi-0/+17
2020-02-15fix another testRalf Jung-7/+7
2020-02-15more revisions and use them for another testRalf Jung-2/+152
2020-02-15fix tests, and use variants to test debug and release builds togetherRalf Jung-471/+479
2020-02-13parser: misc small item related improvements & cleanups.Mazdak Farrokhzad-3/+3
2020-02-13ast_validation: tweak diagnostic outputMazdak Farrokhzad-3/+3
2020-02-13parser_fn_front_matter: allow `const .. extern`Mazdak Farrokhzad-8/+1
2020-02-12Rollup merge of #69002 - RalfJung:miri-op-overflow, r=oli-obk,wesleywiserDylan DPC-39/+117
miri: improve and simplify overflow detection This simplifies the overflow detection for signed binary operators, and adds overflow detection to unary operators so that const-prop doesn't have to crudely hand-roll that. It also fixes some bugs in the operator implementation that however, I think, were not observable. r? @oli-obk @wesleywiser
2020-02-11On mismatched argument count point at argumentsEsteban Küber-21/+29
2020-02-11Rollup merge of #68816 - estebank:fn-mut-closure, r=varkorDylan DPC-17/+16
Tweak borrow error on `FnMut` when `Fn` is expected Fix #31701, fix #66097.
2020-02-11Auto merge of #68929 - matprec:consistent-issue-references, r=Dylan-DPCbors-17/+18
Make issue references consistent Fixes https://github.com/rust-lang/rust/issues/62976 cc https://github.com/rust-lang/rust/pull/63008 r? @varkor because you reviewed the original pr
2020-02-10div/rem overflow tests: also test i128Ralf Jung-39/+117
2020-02-09Auto merge of #67665 - Patryk27:master, r=zackmdavisbors-23/+38
Improve reporting errors and suggestions for trait bounds Fix #66802 - When printing errors for unsized function parameter, properly point at the parameter instead of function's body. - Improve `consider further restricting this bound` (and related) messages by separating human-oriented hints from the machine-oriented ones.
2020-02-09--bless --compare-mode=nllMatthias Prechtl-17/+18
2020-02-09Improve reporting errors and suggestions for trait boundsPatryk Wychowaniec-23/+38
2020-02-09Auto merge of #68689 - estebank:where-clause-sugg-missing-fn, r=varkorbors-1/+1
When suggesting associated fn with type parameters, include in the structured suggestion Address #50734. ``` error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `baz` --> file.rs:14:1 | 14 | impl TraitA<()> for S { | ^^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `baz` in implementation | = help: implement the missing item: `fn foo<T>(_: T) -> Self where T: TraitB, TraitB::Item = A { unimplemented!() }` = help: implement the missing item: `fn bar<T>(_: T) -> Self { unimplemented!() }` = help: implement the missing item: `fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: std::marker::Copy { unimplemented!() }` ``` It doesn't work well for associated types with `ty::Predicate::Projection`s as we need to resugar `T: Trait, Trait::Assoc = K` → `T: Trait<Assoc = K>`.
2020-02-08review commentEsteban Küber-1/+1
2020-02-09Auto merge of #68376 - Centril:move-ref-patterns, r=matthewjasperbors-40/+0
Initial implementation of `#![feature(move_ref_pattern)]` Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary. Closes #45600. Tracking issue: #68354. r? @matthewjasper
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-8/+75
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-8/+8
2020-02-06Rollup merge of #68788 - Centril:unified-fn-bodies, r=petrochenkovDylan DPC-4/+3
Towards unified `fn` grammar Part of https://github.com/rust-lang/rust/pull/68728. - Syntactically, `fn` items in `extern { ... }` blocks can now have bodies (`fn foo() { ... }` as opposed to `fn foo();`). As above, we use semantic restrictions instead. - Syntactically, `fn` items in free contexts (directly in a file or a module) can now be without bodies (`fn foo();` as opposed to `fn foo() { ... }`. As above, we use semantic restrictions instead, including for non-ident parameter patterns. - We move towards unifying the `fn` front matter; this is fully realized in https://github.com/rust-lang/rust/pull/68728. r? @petrochenkov
2020-02-06Auto merge of #68583 - estebank:hrlt, r=oli-obkbors-18/+28
Account for HR lifetimes when suggesting introduction of named lifetime ``` error[E0106]: missing lifetime specifier --> src/test/ui/suggestions/fn-missing-lifetime-in-item.rs:2:32 | 2 | struct S2<F: Fn(&i32, &i32) -> &i32>(F); | ---- ---- ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2 = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html help: consider making the bound lifetime-generic with a new `'a` lifetime | 2 | struct S2<F: for<'a> Fn(&'a i32, &'a i32) -> &'a i32>(F); | ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^ help: consider introducing a named lifetime parameter | 2 | struct S2<'a, F: Fn(&'a i32, &'a i32) -> &'a i32>(F);= | ^^^ ^^^^^^^ ^^^^^^^ ^^^ ``` Follow up to #68267. Addresses the diagnostics part of #49287.
2020-02-05review comments: wordingEsteban Küber-2/+2
2020-02-05Account for `fn()` types in lifetime suggestionsEsteban Küber-36/+17
2020-02-05review commentsEsteban Küber-9/+9
2020-02-05Suggest `'r` instead of `'lifetime`Esteban Küber-14/+14
2020-02-05When suggesting lifetimes, propose adding the new lifetime to all argumentsEsteban Küber-12/+12
2020-02-05Use spans for input borrowed types unrelated to return typeEsteban Küber-6/+30
2020-02-05Account for HKTB when suggesting introduction of named lifetimeEsteban Küber-0/+5
2020-02-05`#![recursion_limit = "X"]`: note current crate name.Mazdak Farrokhzad-7/+7
2020-02-05parser: merge `fn` grammars wrt. bodies & headersMazdak Farrokhzad-4/+3
also refactor `FnKind` and `visit_assoc_item` visitors
2020-02-04Auto merge of #68377 - estebank:fn-obligations-spans, r=oli-obkbors-121/+128
Tweak obligation error output - Point at arguments or output when fn obligations come from them, or ident when they don't - Point at `Sized` bound (fix #47990) - When object unsafe trait uses itself in associated item suggest using `Self` (fix #66424, fix #33375, partially address #38376, cc #61525) - Point at reason in object unsafe trait with `Self` in supertraits or `where`-clause (cc #40533, cc #68377) - On implicit type parameter `Sized` obligations, suggest `?Sized` (fix #57744, fix #46683)
2020-02-03Tweak borrow error on `FnMut` when `Fn` is expectedEsteban Küber-17/+16
2020-02-03Auto merge of #67668 - matthewjasper:or-patterns, r=pnkfelixbors-12/+4
Implement MIR lowering for or-patterns This is the last thing needed to get meaningful run-pass tests for or-patterns. There probably need to be more tests before stabilizing this, but the most important cases should have been covered. Note: we can generate exponentially large MIR CFGs when using or-patterns containing bindings, type ascriptions, or that are for a match arm with a guard. `src/test/mir-opt/exponential-or.rs` shows the best case for what we currently do. cc #54883 closes #60350 closes #67514 cc @Centril r? @pnkfelix
2020-02-03Auto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwcobors-1/+3
Fix ICE with save-analysis Fixes #68749 It should be fine since it's the same way as `visit_expr`.
2020-02-02Point at reason in object unsafe trait with `Self` in supertraits or ↵Esteban Küber-9/+26
`where`-clause
2020-02-02Account for `?Sized` type parameter boundsEsteban Küber-1/+1
2020-02-02Use more appropriate spans on object unsafe traits and provide structured ↵Esteban Küber-1/+4
suggestions when possible