-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Removed @self and @Trait. #12030
Removed @self and @Trait. #12030
Conversation
@@ -136,10 +137,10 @@ pub fn build_configuration(sess: Session) -> | |||
} | |||
|
|||
// Convert strings provided as --cfg [cfgspec] into a crate_cfg | |||
fn parse_cfgspecs(cfgspecs: ~[~str], demitter: @diagnostic::Emitter) |
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.
How come the emitter was removed from all of these functions?
You could imagine a compiler invocation to want a different emitter, but if it was too painful to pass around then removing @
is probably more pressing.
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.
There is no other implementation of Emitter
at this moment, seems a bit ridiculous to go through a trait object.
I've left most of the framework in place, in case we need something generic later (and then we can implement it sanely).
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.
Ok, I'm fine with that.
Heroic effort, nice work! |
nice |
As a side-effect, some trait operations produce cleaner IR (now that fn foo(x: ~Clone) {
let y: &Clone = x;
} ; before
define internal void @foo({ void (i8*)**, i8* }*) unnamed_addr #4 {
entry-block:
%x = alloca { void (i8*)**, i8* }
%y = alloca { void (i8*)**, i8* }
%__auto_borrow_obj = alloca { void (i8*)**, i8* }
%1 = bitcast { void (i8*)**, i8* }* %0 to i8*
%2 = bitcast { void (i8*)**, i8* }* %x to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %1, i64 16, i32 8, i1 false)
%3 = getelementptr inbounds { void (i8*)**, i8* }* %x, i32 0, i32 0
%4 = load void (i8*)*** %3
%5 = getelementptr inbounds { void (i8*)**, i8* }* %__auto_borrow_obj, i32 0, i32 0
store void (i8*)** %4, void (i8*)*** %5
%6 = getelementptr inbounds { void (i8*)**, i8* }* %x, i32 0, i32 1
%7 = load i8** %6
%8 = getelementptr inbounds { void (i8*)**, i8* }* %__auto_borrow_obj, i32 0, i32 1
store i8* %7, i8** %8
%9 = bitcast { void (i8*)**, i8* }* %__auto_borrow_obj to i8*
%10 = bitcast { void (i8*)**, i8* }* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %10, i8* %9, i64 16, i32 8, i1 false)
call void @"~std::clone::Clone.Send::glue_drop"({ void (i8*)**, i8* }* %x)
ret void
} ; after
define internal void @foo({ void (i8*)**, i8* }*) unnamed_addr #4 {
entry-block:
%y = alloca { void (i8*)**, i8* }
%1 = bitcast { void (i8*)**, i8* }* %0 to i8*
%2 = bitcast { void (i8*)**, i8* }* %y to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %1, i64 16, i32 8, i1 false)
call void @"~std::clone::Clone.Send::glue_drop"({ void (i8*)**, i8* }* %0)
ret void
} |
…uote-in-char-literal, r=llogiq 11973: Don't escape `"` in `'"'` Fixes rust-lang#11973. ``` changelog: [`single_char_pattern`]: don't escape `"` in `'"'` ```
No description provided.