Accept less invalid Rust in rustdoc
This commit is contained in:
parent
22b27120b9
commit
4512f211ae
35 changed files with 428 additions and 127 deletions
25
tests/rustdoc-ui/not-wf-ambiguous-normalization.rs
Normal file
25
tests/rustdoc-ui/not-wf-ambiguous-normalization.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
// compile-flags: -Znormalize-docs
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait Allocator {
|
||||
type Buffer;
|
||||
}
|
||||
|
||||
struct DefaultAllocator;
|
||||
|
||||
// This unconstrained impl parameter causes the normalization of
|
||||
// `<DefaultAllocator as Allocator>::Buffer` to be ambiguous,
|
||||
// which caused an ICE with `-Znormalize-docs`.
|
||||
impl<T> Allocator for DefaultAllocator {
|
||||
//~^ ERROR: type annotations needed
|
||||
type Buffer = ();
|
||||
}
|
||||
|
||||
type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
|
||||
|
||||
fn foo() -> A {
|
||||
|_| ()
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue