-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Don't normalize in AstConv #101947
Merged
+1,182
−503
Merged
Don't normalize in AstConv #101947
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d227506
don't normalize in astconv
aliemjay 34329d6
introduce AstConv::probe_adt
aliemjay be5a45d
fix struct path
aliemjay 37b40e4
fix method substs
aliemjay c6a17bf
make ascribe_user_type a TypeOp
aliemjay 8afd3c4
remove unnecessary normalize call
aliemjay dca15fd
rename create_raw_ty -> handle_raw_ty
aliemjay 030d60f
more tests
aliemjay bf228ac
don't eagerly normalize SelfCtor type
aliemjay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
more tests
- Loading branch information
commit 030d60f1c729c01ef9ea11a1adb153c7c58e5fe2
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
error[E0597]: `a` does not live long enough | ||
--> $DIR/normalization.rs:9:31 | ||
--> $DIR/normalization.rs:10:31 | ||
| | ||
LL | let b: <() as Foo>::Out = &a; | ||
LL | let _: <() as Foo>::Out = &a; | ||
| ---------------- ^^ borrowed value does not live long enough | ||
| | | ||
| type annotation requires that `a` is borrowed for `'static` | ||
... | ||
LL | } | ||
| - `a` dropped here while still borrowed | ||
|
||
error: aborting due to previous error | ||
error[E0597]: `a` does not live long enough | ||
--> $DIR/normalization.rs:13:40 | ||
| | ||
LL | let _: <&'static () as Foo>::Out = &a; | ||
| ------------------------- ^^ borrowed value does not live long enough | ||
| | | ||
| type annotation requires that `a` is borrowed for `'static` | ||
... | ||
LL | } | ||
| - `a` dropped here while still borrowed | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0597`. |
20 changes: 20 additions & 0 deletions
20
src/test/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//check-pass | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
trait Trait { | ||
type Opaque1; | ||
type Opaque2; | ||
fn constrain(self); | ||
} | ||
|
||
impl<'a> Trait for &'a () { | ||
type Opaque1 = impl Sized; | ||
type Opaque2 = impl Sized + 'a; | ||
fn constrain(self) { | ||
let _: Self::Opaque1 = (); | ||
let _: Self::Opaque2 = self; | ||
} | ||
} | ||
|
||
fn main() {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a similar test for inherent associated types. cc #105315.