Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
833b915
Make encode_attrs use opt_local_def_id_to_hir_id so we can feed it wi…
spastorino Dec 15, 2022
0610df9
lint: don't suggest assume_init for uninhabited types
y21 Feb 13, 2023
4e703a2
Add associated_items_for_impl_trait_in_trait query
spastorino Oct 26, 2022
b7dd609
Add associated_item_for_impl_trait_in_trait query
spastorino Dec 16, 2022
45b0d9d
Make associated_items_for_impl_trait_in_trait handle impl traits on i…
spastorino Feb 16, 2023
5e763b6
Document associated_item methods
spastorino Feb 17, 2023
76ac270
docs: wrong naming convention in struct keyword doc
mrnossiom Feb 20, 2023
18f5f0c
use UpperCamelCase
mrnossiom Feb 20, 2023
ec9a4ce
Explain the default panic hook better
majaha Feb 16, 2023
4f2001a
remove flag
BoxyUwU Feb 20, 2023
2895731
Name placeholder in some region errors
compiler-errors Feb 20, 2023
dfc4a58
Add a test for default trait method with RPITITs
compiler-errors Feb 21, 2023
4dea3a2
Rollup merge of #108000 - y21:no-zero-init-for-uninhabited, r=jackh726
Dylan-DPC Feb 21, 2023
e781a6f
Rollup merge of #108105 - majaha:patch-1, r=cuviper
Dylan-DPC Feb 21, 2023
076e627
Rollup merge of #108141 - spastorino:add_rpitit_queries, r=compiler-e…
Dylan-DPC Feb 21, 2023
7dcf7fe
Rollup merge of #108272 - MrNossiom:master, r=thomcc
Dylan-DPC Feb 21, 2023
6a21237
Rollup merge of #108285 - BoxyUwU:remove_pick_stable_before_unstable_…
Dylan-DPC Feb 21, 2023
270f45e
Rollup merge of #108289 - compiler-errors:name-placeholder, r=petroch…
Dylan-DPC Feb 21, 2023
60c0972
Rollup merge of #108290 - compiler-errors:rpitit-trait-default-constr…
Dylan-DPC Feb 21, 2023
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
Prev Previous commit
Next Next commit
Add a test for default trait method with RPITITs
  • Loading branch information
compiler-errors committed Feb 21, 2023
commit dfc4a580f2e03eea67d8739d1ac369a5ceef71b5
17 changes: 17 additions & 0 deletions tests/ui/impl-trait/in-trait/default-method-constraint.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// check-pass

// This didn't work in the previous default RPITIT method hack attempt

#![feature(return_position_impl_trait_in_trait)]
//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete

trait Foo {
fn bar(x: bool) -> impl Sized {
if x {
let _: u32 = Self::bar(!x);
}
Default::default()
}
}

fn main() {}
11 changes: 11 additions & 0 deletions tests/ui/impl-trait/in-trait/default-method-constraint.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-method-constraint.rs:5:12
|
LL | #![feature(return_position_impl_trait_in_trait)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted